mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
avoid adding constantly false statements to the lemma
Signed-off-by: Lev <levnach@hotmail.com>
This commit is contained in:
parent
dbfa3fc84a
commit
489da283bb
3 changed files with 4 additions and 2 deletions
|
@ -47,7 +47,7 @@ public:
|
|||
}
|
||||
|
||||
bool is_empty() const {
|
||||
return m_coeffs.empty(); // && is_zero(m_v);
|
||||
return m_coeffs.empty();
|
||||
}
|
||||
|
||||
unsigned size() const { return static_cast<unsigned>(m_coeffs.size()); }
|
||||
|
|
|
@ -261,6 +261,9 @@ struct solver::imp {
|
|||
lp::lar_term t;
|
||||
t.add_coeff_var(a, j);
|
||||
t.add_coeff_var(b, k);
|
||||
if (t.is_empty() && rs.is_zero() &&
|
||||
(cmp == lp::lconstraint_kind::LT || cmp == lp::lconstraint_kind::GT || cmp == lp::lconstraint_kind::NE))
|
||||
return; // otherwise we get something like 0 < 0, which is always false and can be removed from the lemma
|
||||
m_lemma->push_back(ineq(cmp, t, rs));
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ namespace lp {
|
|||
|
||||
enum lconstraint_kind { LE = -2, LT = -1 , GE = 2, GT = 1, EQ = 0, NE = 3 };
|
||||
|
||||
|
||||
inline bool kind_is_strict(lconstraint_kind kind) { return kind == LT || kind == GT;}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, lconstraint_kind k) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue