diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2020-03-16 10:37:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-16 10:37:19 -0700 |
commit | 33f77f7e95575cbaf5249042fa83d7b0d0650ce0 (patch) | |
tree | 985a074d0cec25a6eadbbb1c7621d1a9bacc1b4d /src/theory/uf/equality_engine.cpp | |
parent | 227cd8c26c508b7b444fbed6f2868f90c8281eed (diff) |
Create master equality engine at context level 0 (#4081)
Fixes #4077. The master equality engine in `TheoryEngine` was being
created at SAT context level 1. If the context was popped to level zero
by `(reset-assertions)`, `true` and `false` were removed from the master
equality engine, which lead for example to `(= ((_ extract 3 3) x) (_
bv1 1))` and `(_ bv1 4)` being merged (this can be gathered from looking
at `-t equality`). This commit fixes the issue by postponing the global
context pushes until after the theory engine has been initialized.
Diffstat (limited to 'src/theory/uf/equality_engine.cpp')
-rw-r--r-- | src/theory/uf/equality_engine.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/theory/uf/equality_engine.cpp b/src/theory/uf/equality_engine.cpp index 693b7bd66..b6896e45d 100644 --- a/src/theory/uf/equality_engine.cpp +++ b/src/theory/uf/equality_engine.cpp @@ -81,6 +81,11 @@ void EqualityEngine::init() { Debug("equality") << "EqualityEdge::EqualityEngine(): edge_null = " << +null_edge << std::endl; Debug("equality") << "EqualityEdge::EqualityEngine(): trigger_null = " << +null_trigger << std::endl; + // If we are not at level zero when we initialize this equality engine, we + // may remove true/false from the equality engine when we pop to level zero, + // which leads to issues. + Assert(d_context->getLevel() == 0); + d_true = NodeManager::currentNM()->mkConst<bool>(true); d_false = NodeManager::currentNM()->mkConst<bool>(false); |