mirror of
https://github.com/Z3Prover/z3
synced 2026-05-04 17:35:17 +00:00
This commit is contained in:
parent
f7d1cce69a
commit
4a0a678e3f
4 changed files with 41 additions and 9 deletions
|
|
@ -192,20 +192,26 @@ namespace q {
|
|||
}
|
||||
|
||||
struct ematch::remove_binding : public trail {
|
||||
euf::solver& ctx;
|
||||
clause& c;
|
||||
binding* b;
|
||||
remove_binding(clause& c, binding* b): c(c), b(b) {}
|
||||
void undo() override {
|
||||
remove_binding(euf::solver& ctx, clause& c, binding* b): ctx(ctx), c(c), b(b) {}
|
||||
void undo() override {
|
||||
SASSERT(binding::contains(c.m_bindings, b));
|
||||
binding::remove_from(c.m_bindings, b);
|
||||
binding::detach(b);
|
||||
}
|
||||
};
|
||||
|
||||
struct ematch::insert_binding : public trail {
|
||||
euf::solver& ctx;
|
||||
clause& c;
|
||||
binding* b;
|
||||
insert_binding(clause& c, binding* b): c(c), b(b) {}
|
||||
void undo() override {
|
||||
insert_binding(euf::solver& ctx, clause& c, binding* b): ctx(ctx), c(c), b(b) {}
|
||||
void undo() override {
|
||||
SASSERT(!c.m_bindings || c.m_bindings->invariant());
|
||||
binding::push_to_front(c.m_bindings, b);
|
||||
SASSERT(!c.m_bindings || c.m_bindings->invariant());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -230,7 +236,7 @@ namespace q {
|
|||
for (unsigned i = 0; i < n; ++i)
|
||||
b->m_nodes[i] = _binding[i];
|
||||
binding::push_to_front(c.m_bindings, b);
|
||||
ctx.push(remove_binding(c, b));
|
||||
ctx.push(remove_binding(ctx, c, b));
|
||||
}
|
||||
|
||||
void ematch::on_binding(quantifier* q, app* pat, euf::enode* const* _binding, unsigned max_generation, unsigned min_gen, unsigned max_gen) {
|
||||
|
|
@ -503,8 +509,10 @@ namespace q {
|
|||
while (b != c.m_bindings);
|
||||
|
||||
for (auto* b : to_remove) {
|
||||
SASSERT(binding::contains(c.m_bindings, b));
|
||||
binding::remove_from(c.m_bindings, b);
|
||||
ctx.push(insert_binding(c, b));
|
||||
binding::detach(b);
|
||||
ctx.push(insert_binding(ctx, c, b));
|
||||
}
|
||||
to_remove.reset();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue