3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00

improve diagnosability

This commit is contained in:
Nikolaj Bjorner 2021-03-26 14:58:17 -07:00
parent e89071d366
commit 0c25d2560d

View file

@ -183,7 +183,7 @@ class theory_lra::imp {
// non-linear arithmetic // non-linear arithmetic
scoped_ptr<nla::solver> m_nla; scoped_ptr<nla::solver> m_nla;
scoped_ptr<scoped_anum> m_a1, m_a2; mutable scoped_ptr<scoped_anum> m_a1, m_a2;
// integer arithmetic // integer arithmetic
scoped_ptr<lp::int_solver> m_lia; scoped_ptr<lp::int_solver> m_lia;
@ -200,7 +200,7 @@ class theory_lra::imp {
} }
}; };
bool use_nra_model() { bool use_nra_model() const {
if (m_nla && m_nla->use_nra_model()) { if (m_nla && m_nla->use_nra_model()) {
if (!m_a1) { if (!m_a1) {
m_a1 = alloc(scoped_anum, m_nla->am()); m_a1 = alloc(scoped_anum, m_nla->am());
@ -1237,12 +1237,13 @@ public:
return; return;
} }
expr_ref mod_r(a.mk_add(a.mk_mul(q, div), mod), m); expr_ref mod_r(a.mk_add(a.mk_mul(q, div), mod), m);
#if 0 #if 0
expr_ref eqr(m.mk_eq(a.mk_add(a.mk_mul(q, div), mod), p), m); expr_ref eqr(m.mk_eq(mod_r, p), m);
ctx().get_rewriter()(eqr); ctx().get_rewriter()(eqr);
literal eq = mk_literal(eqr); literal eq = mk_literal(eqr);
#else #else
literal eq = th.mk_eq(a.mk_add(a.mk_mul(q, div), mod), p, false); literal eq = th.mk_eq(mod_r, p, false);
#endif #endif
literal mod_ge_0 = mk_literal(a.mk_ge(mod, zero)); literal mod_ge_0 = mk_literal(a.mk_ge(mod, zero));
@ -2195,7 +2196,6 @@ public:
TRACE("arith", tout << "v" << v << " " << be.kind() << " " << be.m_bound << "\n";); TRACE("arith", tout << "v" << v << " " << be.kind() << " " << be.m_bound << "\n";);
reserve_bounds(v); reserve_bounds(v);
if (m_unassigned_bounds[v] == 0 && !should_refine_bounds()) { if (m_unassigned_bounds[v] == 0 && !should_refine_bounds()) {
TRACE("arith", tout << "return\n";); TRACE("arith", tout << "return\n";);
@ -3238,7 +3238,7 @@ public:
TRACE("arith", display(tout);); TRACE("arith", display(tout););
} }
nlsat::anum const& nl_value(theory_var v, scoped_anum& r) { nlsat::anum const& nl_value(theory_var v, scoped_anum& r) const {
SASSERT(use_nra_model()); SASSERT(use_nra_model());
auto t = get_tv(v); auto t = get_tv(v);
if (t.is_term()) { if (t.is_term()) {
@ -3658,7 +3658,7 @@ public:
} }
void display(std::ostream & out) { void display(std::ostream & out) const {
if (m_solver) { if (m_solver) {
m_solver->display(out); m_solver->display(out);
} }