3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-19 04:13:38 +00:00
This commit is contained in:
Nikolaj Bjorner 2022-08-21 18:27:14 -07:00
parent daa24ef4ce
commit 09ab575d29

View file

@ -356,18 +356,14 @@ namespace qe {
expr *c, *d; expr *c, *d;
max_level lvl2; max_level lvl2;
TRACE("qe", tout << mk_pp(a, m) << " " << lvl << "\n";); TRACE("qe", tout << mk_pp(a, m) << " " << lvl << "\n";);
if (m_asm2pred.find(a, b)) { if (m_asm2pred.find(a, b))
q = b; q = b;
} else if (m.is_not(a, c) && m_asm2pred.find(c, b))
else if (m.is_not(a, c) && m_asm2pred.find(c, b)) { q = m.mk_not(b);
q = m.mk_not(b); else if (m_pred2asm.find(a, d))
} q = a;
else if (m_pred2asm.find(a, d)) { else if (m.is_not(a, c) && m_pred2asm.find(c, d))
q = a; q = a;
}
else if (m.is_not(a, c) && m_pred2asm.find(c, d)) {
q = a;
}
else { else {
p = fresh_bool("def"); p = fresh_bool("def");
if (m.is_not(a, a)) { if (m.is_not(a, a)) {
@ -425,12 +421,10 @@ namespace qe {
} }
} }
if (args.size() == sz) { if (args.size() == sz) {
if (diff) { if (diff)
r = m.mk_app(a->get_decl(), args); r = m.mk_app(a->get_decl(), args);
} else
else { r = to_app(a);
r = to_app(a);
}
cache.insert(a, r); cache.insert(a, r);
trail.push_back(r); trail.push_back(r);
todo.pop_back(); todo.pop_back();
@ -465,12 +459,10 @@ namespace qe {
for (unsigned j = 0; j < m_preds[i].size(); ++j) { for (unsigned j = 0; j < m_preds[i].size(); ++j) {
app* p = m_preds[i][j]; app* p = m_preds[i][j];
expr* e; expr* e;
if (m_pred2lit.find(p, e)) { if (m_pred2lit.find(p, e))
out << mk_pp(p, m) << " := " << mk_pp(e, m) << "\n"; out << mk_pp(p, m) << " := " << mk_pp(e, m) << "\n";
} else
else { out << mk_pp(p, m) << "\n";
out << mk_pp(p, m) << "\n";
}
} }
} }
} }
@ -481,12 +473,10 @@ namespace qe {
expr* e = a; expr* e = a;
bool is_not = m.is_not(a, e); bool is_not = m.is_not(a, e);
out << mk_pp(a, m); out << mk_pp(a, m);
if (m_elevel.find(e, lvl)) { if (m_elevel.find(e, lvl))
lvl.display(out << " - "); lvl.display(out << " - ");
} if (m_pred2lit.find(e, e))
if (m_pred2lit.find(e, e)) { out << " : " << (is_not?"!":"") << mk_pp(e, m);
out << " : " << (is_not?"!":"") << mk_pp(e, m);
}
out << "\n"; out << "\n";
} }
} }
@ -498,9 +488,8 @@ namespace qe {
while (sz0 != todo.size()) { while (sz0 != todo.size()) {
expr* e = todo.back(); expr* e = todo.back();
todo.pop_back(); todo.pop_back();
if (mark.is_marked(e) || is_var(e)) { if (mark.is_marked(e) || is_var(e))
continue; continue;
}
mark.mark(e); mark.mark(e);
if (is_quantifier(e)) { if (is_quantifier(e)) {
todo.push_back(to_quantifier(e)->get_expr()); todo.push_back(to_quantifier(e)->get_expr());
@ -508,12 +497,10 @@ namespace qe {
} }
SASSERT(is_app(e)); SASSERT(is_app(e));
app* a = to_app(e); app* a = to_app(e);
if (is_uninterp_const(a)) { // TBD generalize for uninterpreted functions. if (is_uninterp_const(a)) // TBD generalize for uninterpreted functions.
vars.push_back(a); vars.push_back(a);
} for (expr* arg : *a)
for (expr* arg : *a) { todo.push_back(arg);
todo.push_back(arg);
}
} }
} }
@ -929,6 +916,7 @@ namespace qe {
SASSERT(validate_core(mdl, core)); SASSERT(validate_core(mdl, core));
get_vars(m_level-1); get_vars(m_level-1);
SASSERT(validate_project(mdl, core)); SASSERT(validate_project(mdl, core));
mdl.set_inline();
m_mbp(force_elim(), m_avars, mdl, core); m_mbp(force_elim(), m_avars, mdl, core);
TRACE("qe", tout << "aux vars: " << m_avars << "\n";); TRACE("qe", tout << "aux vars: " << m_avars << "\n";);
for (app* v : m_avars) m_pred_abs.ensure_expr_level(v, m_level-1); for (app* v : m_avars) m_pred_abs.ensure_expr_level(v, m_level-1);