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

Fix UP registration in final callback (#6929)

* Fix registration in final

* Don't make it too complicated...
This commit is contained in:
Clemens Eisenhofer 2023-10-03 02:51:02 +02:00 committed by GitHub
parent ab8fe199c5
commit 4133a1cc5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,6 @@ void theory_user_propagator::add_expr(expr* term, bool ensure_enode) {
if (is_attached_to_var(n)) if (is_attached_to_var(n))
return; return;
theory_var v = mk_var(n); theory_var v = mk_var(n);
m_var2expr.reserve(v + 1); m_var2expr.reserve(v + 1);
m_var2expr[v] = term; m_var2expr[v] = term;
@ -146,7 +145,7 @@ final_check_status theory_user_propagator::final_check_eh() {
return FC_DONE; return FC_DONE;
force_push(); force_push();
unsigned sz1 = m_prop.size(); unsigned sz1 = m_prop.size();
unsigned sz2 = m_expr2var.size(); unsigned sz2 = get_num_vars();
try { try {
m_final_eh(m_user_context, this); m_final_eh(m_user_context, this);
} }
@ -157,7 +156,7 @@ final_check_status theory_user_propagator::final_check_eh() {
propagate(); propagate();
CTRACE("user_propagate", ctx.inconsistent(), tout << "inconsistent\n"); CTRACE("user_propagate", ctx.inconsistent(), tout << "inconsistent\n");
// check if it became inconsistent or something new was propagated/registered // check if it became inconsistent or something new was propagated/registered
bool done = (sz1 == m_prop.size()) && (sz2 == m_expr2var.size()) && !ctx.inconsistent(); bool done = (sz1 == m_prop.size()) && (sz2 == get_num_vars()) && !ctx.inconsistent();
return done ? FC_DONE : FC_CONTINUE; return done ? FC_DONE : FC_CONTINUE;
} }