3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

gc expressions in the scope of updates, not old expressions

This commit is contained in:
Nikolaj Bjorner 2023-12-18 20:08:17 -08:00
parent 842385a7d7
commit ea44c110bb
2 changed files with 8 additions and 3 deletions

View file

@ -113,7 +113,7 @@ void elim_unconstrained::eliminate() {
IF_VERBOSE(11, verbose_stream() << "replace " << mk_pp(t, m) << " / " << rr << " -> " << r << "\n");
TRACE("elim_unconstrained", tout << mk_pp(t, m) << " -> " << r << "\n");
TRACE("elim_unconstrained", tout << mk_pp(t, m) << " / " << rr << " -> " << r << "\n");
SASSERT(r->get_sort() == t->get_sort());
m_stats.m_num_eliminated++;
m_trail.push_back(r);
@ -271,12 +271,18 @@ void elim_unconstrained::gc(expr* t) {
while (!todo.empty()) {
t = todo.back();
todo.pop_back();
node& n = get_node(t);
if (n.m_refcount == 0)
continue;
if (n.m_term && !is_node(n.m_term))
continue;
dec_ref(t);
if (n.m_refcount != 0)
continue;
if (n.m_term)
t = n.m_term;
if (is_app(t)) {
for (expr* arg : *to_app(t))
todo.push_back(arg);
@ -436,5 +442,4 @@ void elim_unconstrained::reduce() {
update_model_trail(*mc, old_fmls);
mc->reset();
}
}