diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-01-28 13:27:27 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 13:27:27 -0600 |
commit | 3234db430074e278258e6d687c07146a59769a92 (patch) | |
tree | 17db55e1ff335c3998e1c4e172d174dc9f6e3b21 /src/theory/theory_state.cpp | |
parent | 4cd2d73366aba081a38900ddc2f4f172ce9ed2f8 (diff) |
Use standard equality engine information in quantifiers state (#5824)
This refactors quantifiers so that it uses the standard interfaces for setting up an equality engine and using it via TheoryState.
This eliminates the need for several special interfaces including getMasterEqualityEngine, CombinationEngine::getCoreEqualityEngine, and most uses of EqualityQuery.
Diffstat (limited to 'src/theory/theory_state.cpp')
-rw-r--r-- | src/theory/theory_state.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/theory/theory_state.cpp b/src/theory/theory_state.cpp index 47528e1a6..e145baa6a 100644 --- a/src/theory/theory_state.cpp +++ b/src/theory/theory_state.cpp @@ -119,6 +119,26 @@ bool TheoryState::areDisequal(TNode a, TNode b) const return d_ee->areDisequal(a, b, false); } +void TheoryState::getEquivalenceClass(Node a, std::vector<Node>& eqc) const +{ + if (d_ee->hasTerm(a)) + { + Node rep = d_ee->getRepresentative(a); + eq::EqClassIterator eqc_iter(rep, d_ee); + while (!eqc_iter.isFinished()) + { + eqc.push_back(*eqc_iter); + eqc_iter++; + } + } + else + { + eqc.push_back(a); + } + // a should be in its equivalence class + Assert(std::find(eqc.begin(), eqc.end(), a) != eqc.end()); +} + eq::EqualityEngine* TheoryState::getEqualityEngine() const { return d_ee; } void TheoryState::notifyInConflict() { d_conflict = true; } |