mirror of
https://github.com/Z3Prover/z3
synced 2025-04-13 12:28:44 +00:00
fix #6488
This commit is contained in:
parent
039de6a2c8
commit
a3e6885680
|
@ -96,7 +96,7 @@ void elim_unconstrained::eliminate() {
|
||||||
m_trail.push_back(r);
|
m_trail.push_back(r);
|
||||||
SASSERT(r);
|
SASSERT(r);
|
||||||
gc(e);
|
gc(e);
|
||||||
init_children(e, r);
|
freeze_rec(r);
|
||||||
|
|
||||||
m_root.setx(r->get_id(), e->get_id(), UINT_MAX);
|
m_root.setx(r->get_id(), e->get_id(), UINT_MAX);
|
||||||
get_node(e).m_term = r;
|
get_node(e).m_term = r;
|
||||||
|
@ -180,9 +180,8 @@ void elim_unconstrained::init_terms(expr_ref_vector const& terms) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void elim_unconstrained::init_children(expr* e, expr* r) {
|
void elim_unconstrained::freeze_rec(expr* r) {
|
||||||
expr_ref_vector children(m);
|
expr_ref_vector children(m);
|
||||||
SASSERT(e != r);
|
|
||||||
if (is_quantifier(r))
|
if (is_quantifier(r))
|
||||||
children.push_back(to_quantifier(r)->get_expr());
|
children.push_back(to_quantifier(r)->get_expr());
|
||||||
else if (is_app(r))
|
else if (is_app(r))
|
||||||
|
@ -191,11 +190,20 @@ void elim_unconstrained::init_children(expr* e, expr* r) {
|
||||||
return;
|
return;
|
||||||
if (children.empty())
|
if (children.empty())
|
||||||
return;
|
return;
|
||||||
init_terms(children);
|
for (expr* t : subterms::all(children))
|
||||||
for (expr* arg : children) {
|
freeze(t);
|
||||||
get_node(arg).m_parents.push_back(e);
|
}
|
||||||
inc_ref(arg);
|
|
||||||
}
|
void elim_unconstrained::freeze(expr* t) {
|
||||||
|
if (!is_uninterp_const(t))
|
||||||
|
return;
|
||||||
|
if (m_nodes.size() <= t->get_id())
|
||||||
|
return;
|
||||||
|
node& n = get_node(t);
|
||||||
|
if (!n.m_term)
|
||||||
|
return;
|
||||||
|
n.m_refcount = UINT_MAX / 2;
|
||||||
|
m_heap.increased(root(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void elim_unconstrained::gc(expr* t) {
|
void elim_unconstrained::gc(expr* t) {
|
||||||
|
|
|
@ -58,8 +58,9 @@ class elim_unconstrained : public dependent_expr_simplifier {
|
||||||
unsigned get_refcount(expr* t) const { return get_node(t).m_refcount; }
|
unsigned get_refcount(expr* t) const { return get_node(t).m_refcount; }
|
||||||
void inc_ref(expr* t) { ++get_node(t).m_refcount; if (is_uninterp_const(t)) m_heap.increased(root(t)); }
|
void inc_ref(expr* t) { ++get_node(t).m_refcount; if (is_uninterp_const(t)) m_heap.increased(root(t)); }
|
||||||
void dec_ref(expr* t) { --get_node(t).m_refcount; if (is_uninterp_const(t)) m_heap.decreased(root(t)); }
|
void dec_ref(expr* t) { --get_node(t).m_refcount; if (is_uninterp_const(t)) m_heap.decreased(root(t)); }
|
||||||
|
void freeze(expr* t);
|
||||||
|
void freeze_rec(expr* r);
|
||||||
void gc(expr* t);
|
void gc(expr* t);
|
||||||
void init_children(expr* e, expr* r);
|
|
||||||
expr* get_parent(unsigned n) const;
|
expr* get_parent(unsigned n) const;
|
||||||
void init_terms(expr_ref_vector const& terms);
|
void init_terms(expr_ref_vector const& terms);
|
||||||
void init_nodes();
|
void init_nodes();
|
||||||
|
|
Loading…
Reference in a new issue