3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 00:26:38 +00:00

Add eval_and

This commit is contained in:
Jakob Rath 2022-01-12 13:47:05 +01:00
parent 3895d8d6bb
commit 3a34995b03
2 changed files with 15 additions and 0 deletions

View file

@ -51,6 +51,8 @@ namespace polysat {
switch (m_op) {
case code::lshr_op:
return eval_lshr(p, q, r);
case code::and_op:
return eval_and(p, q, r);
default:
return l_undef;
}
@ -287,4 +289,16 @@ namespace polysat {
}
}
}
lbool op_constraint::eval_and(pdd const& p, pdd const& q, pdd const& r) const {
auto& m = p.manager();
if ((p.is_zero() || q.is_zero()) && r.is_zero())
return l_true;
if (p.is_val() && q.is_val() && r.is_val())
return r.val() == bitwise_and(p.val(), q.val()) ? l_true : l_false;
return l_undef;
}
}

View file

@ -44,6 +44,7 @@ namespace polysat {
lbool eval_lshr(pdd const& p, pdd const& q, pdd const& r) const;
void narrow_and(solver& s);
lbool eval_and(pdd const& p, pdd const& q, pdd const& r) const;
public:
~op_constraint() override {}