Skip to content

Commit

Permalink
reset visited (fast mark) to not clash with occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Nov 17, 2022
1 parent 6662afd commit 59b7845
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/ast/euf/euf_egraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion src/ast/euf/euf_egraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 13 additions & 9 deletions src/ast/simplifiers/euf_completion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion src/ast/simplifiers/solve_eqs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ namespace euf {
todo.push_back(var2id(e));
}
m_todo.reset();

visited.reset();

if (!is_safe) {
todo.shrink(todo_sz);
continue;
Expand Down

0 comments on commit 59b7845

Please sign in to comment.