mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
#5417 normalize clause
This commit is contained in:
parent
7d915eb295
commit
776f270b64
|
@ -29,7 +29,9 @@ namespace q {
|
||||||
expr_ref rhs;
|
expr_ref rhs;
|
||||||
bool sign;
|
bool sign;
|
||||||
lit(expr_ref const& lhs, expr_ref const& rhs, bool sign):
|
lit(expr_ref const& lhs, expr_ref const& rhs, bool sign):
|
||||||
lhs(lhs), rhs(rhs), sign(sign) {}
|
lhs(lhs), rhs(rhs), sign(sign) {
|
||||||
|
SASSERT(!rhs.m().is_false(rhs) || !sign);
|
||||||
|
}
|
||||||
std::ostream& display(std::ostream& out) const;
|
std::ostream& display(std::ostream& out) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -419,6 +419,16 @@ namespace q {
|
||||||
r = sign ? m.mk_false() : m.mk_true();
|
r = sign ? m.mk_false() : m.mk_true();
|
||||||
sign = false;
|
sign = false;
|
||||||
}
|
}
|
||||||
|
if (m.is_true(l) || m.is_false(l))
|
||||||
|
std::swap(l, r);
|
||||||
|
if (sign && m.is_false(r)) {
|
||||||
|
r = m.mk_true();
|
||||||
|
sign = false;
|
||||||
|
}
|
||||||
|
else if (sign && m.is_true(r)) {
|
||||||
|
r = m.mk_false();
|
||||||
|
sign = false;
|
||||||
|
}
|
||||||
cl->m_lits.push_back(lit(expr_ref(l, m), expr_ref(r, m), sign));
|
cl->m_lits.push_back(lit(expr_ref(l, m), expr_ref(r, m), sign));
|
||||||
}
|
}
|
||||||
if (q->get_num_patterns() == 0) {
|
if (q->get_num_patterns() == 0) {
|
||||||
|
|
Loading…
Reference in a new issue