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

reset visited (fast mark) to not clash with occurs

This commit is contained in:
Nikolaj Bjorner 2022-11-17 17:36:21 +09:00
parent 6662afdd26
commit 59b7845c7d
4 changed files with 19 additions and 14 deletions

View file

@ -451,7 +451,7 @@ namespace euf {
add_literal(n1, false);
if (n1->is_equality() && n1->value() == l_false)
new_diseq(n1);
remove_parents(r1, r2);
remove_parents(r1);
push_eq(r1, n1, r2->num_parents());
merge_justification(n1, n2, j);
for (enode* c : enode_class(n1))
@ -464,8 +464,8 @@ namespace euf {
cb(r2, r1);
}
void egraph::remove_parents(enode* r1, enode* r2) {
for (enode* p : enode_parents(r1)) {
void egraph::remove_parents(enode* r) {
for (enode* p : enode_parents(r)) {
if (p->is_marked1())
continue;
if (p->merge_enabled()) {

View file

@ -220,7 +220,7 @@ namespace euf {
void merge_th_eq(enode* n, enode* root);
void merge_justification(enode* n1, enode* n2, justification j);
void reinsert_parents(enode* r1, enode* r2);
void remove_parents(enode* r1, enode* r2);
void remove_parents(enode* r);
void unmerge_justification(enode* n1);
void reinsert_equality(enode* p);
void update_children(enode* n);

View file

@ -80,18 +80,22 @@ namespace euf {
};
for (unsigned i = m_qhead; i < sz; ++i) {
auto [f,d] = m_fmls[i]();
auto* n = mk_enode(f);
if (m.is_eq(f)) {
m_egraph.merge(n->get_arg(0), n->get_arg(1), d);
add_children(n->get_arg(0));
add_children(n->get_arg(1));
expr* x, * y;
auto [f, d] = m_fmls[i]();
if (m.is_eq(f, x, y)) {
enode* a = mk_enode(x);
enode* b = mk_enode(y);
m_egraph.merge(a, b, d);
add_children(a);
add_children(b);
}
if (m.is_not(f)) {
m_egraph.merge(n->get_arg(0), m_ff, d);
add_children(n->get_arg(0));
else if (m.is_not(f, f)) {
enode* n = mk_enode(f);
m_egraph.merge(n, m_ff, d);
add_children(n);
}
else {
enode* n = mk_enode(f);
m_egraph.merge(n, m_tt, d);
add_children(n);
}

View file

@ -129,7 +129,8 @@ namespace euf {
todo.push_back(var2id(e));
}
m_todo.reset();
visited.reset();
if (!is_safe) {
todo.shrink(todo_sz);
continue;