diff --git a/src/util/lp/lar_term.h b/src/util/lp/lar_term.h index 534896d4c..7c69e4716 100644 --- a/src/util/lp/lar_term.h +++ b/src/util/lp/lar_term.h @@ -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(m_coeffs.size()); } diff --git a/src/util/lp/nla_solver.cpp b/src/util/lp/nla_solver.cpp index a17249c55..a554302e2 100644 --- a/src/util/lp/nla_solver.cpp +++ b/src/util/lp/nla_solver.cpp @@ -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)); } diff --git a/src/util/lp/ul_pair.h b/src/util/lp/ul_pair.h index e7ac68ed2..82bb8838a 100644 --- a/src/util/lp/ul_pair.h +++ b/src/util/lp/ul_pair.h @@ -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) {