diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2021-11-13 06:43:59 -0800 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2021-11-13 06:43:59 -0800 |
commit | 9aeb23f2ae58e4f6dd2b53dbb47cf8c173e56d83 (patch) | |
tree | 4571c563de220997d5292a985e2af9e182354bda /src/theory/strings | |
parent | 765488e5eba75086fca9c3c385bbdebed288eb2e (diff) |
address
Diffstat (limited to 'src/theory/strings')
-rw-r--r-- | src/theory/strings/eager_solver.cpp | 11 | ||||
-rw-r--r-- | src/theory/strings/eager_solver.h | 2 | ||||
-rw-r--r-- | src/theory/strings/theory_strings.cpp | 5 |
3 files changed, 7 insertions, 11 deletions
diff --git a/src/theory/strings/eager_solver.cpp b/src/theory/strings/eager_solver.cpp index 1bd317e04..ce47ff4fc 100644 --- a/src/theory/strings/eager_solver.cpp +++ b/src/theory/strings/eager_solver.cpp @@ -79,15 +79,10 @@ void EagerSolver::eqNotifyNewClass(TNode t) } } -void EagerSolver::eqNotifyMerge(TNode t1, TNode t2) +void EagerSolver::eqNotifyMerge(EqcInfo* e1, TNode t1, EqcInfo* e2, TNode t2) { - EqcInfo* e2 = d_state.getOrMakeEqcInfo(t2, false); - if (e2 == nullptr) - { - return; - } - // always create it if e2 was non-null - EqcInfo* e1 = d_state.getOrMakeEqcInfo(t1); + Assert(e1 != nullptr); + Assert(e2 != nullptr); // check for conflict Node conf = checkForMergeConflict(t1, t2, e1, e2); if (!conf.isNull()) diff --git a/src/theory/strings/eager_solver.h b/src/theory/strings/eager_solver.h index fd7db1432..4181a15c3 100644 --- a/src/theory/strings/eager_solver.h +++ b/src/theory/strings/eager_solver.h @@ -46,7 +46,7 @@ class EagerSolver : protected EnvObj /** called when a new equivalence class is created */ void eqNotifyNewClass(TNode t); /** called when two equivalence classes merge */ - void eqNotifyMerge(TNode t1, TNode t2); + void eqNotifyMerge(EqcInfo* e1, TNode t1, EqcInfo* e2, TNode t2); /** notify fact, called when a fact is asserted to theory of strings */ void notifyFact(TNode atom, bool polarity, TNode fact, bool isInternal); diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp index 907c6ceee..17d9752c2 100644 --- a/src/theory/strings/theory_strings.cpp +++ b/src/theory/strings/theory_strings.cpp @@ -767,8 +767,6 @@ void TheoryStrings::eqNotifyNewClass(TNode t){ void TheoryStrings::eqNotifyMerge(TNode t1, TNode t2) { - d_eagerSolver.eqNotifyMerge(t1, t2); - EqcInfo* e2 = d_state.getOrMakeEqcInfo(t2, false); if (e2 == nullptr) { @@ -776,6 +774,9 @@ void TheoryStrings::eqNotifyMerge(TNode t1, TNode t2) } // always create it if e2 was non-null EqcInfo* e1 = d_state.getOrMakeEqcInfo(t1); + + d_eagerSolver.eqNotifyMerge(e1, t1, e2, t2); + // add information from e2 to e1 if (!e2->d_lengthTerm.get().isNull()) { |