diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-08-09 17:36:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-09 17:36:22 -0500 |
commit | 33b96c656515f9634ec97b021da8da5dee2b9bcd (patch) | |
tree | dcfb186b6bfadf2824e2b22b2f6ebb7f1fcc5cb6 /src/theory/quantifiers | |
parent | 28f5438df1e5ba87aab60552658aa09b79c35ba2 (diff) |
Make valuation class more robust to null underlying TheoryEngine. (#4864)
In some use cases (unit tests, old proofs infrastructure), we use a Theory with no associated TheoryEngine. This PR makes the Valuation class more robust to this case.
This includes making the "unevaluated kinds" a no-op in this case (this is necessary for Theory::finishInit with no TheoryEngine) and adding some assertions to cases that the Theory should never call without TheoryEngine.
This is required for a new policy for dynamically configuring equality engine infrastructure in Theory.
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r-- | src/theory/quantifiers/theory_quantifiers.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/theory/quantifiers/theory_quantifiers.cpp b/src/theory/quantifiers/theory_quantifiers.cpp index 7365960e9..1475446fe 100644 --- a/src/theory/quantifiers/theory_quantifiers.cpp +++ b/src/theory/quantifiers/theory_quantifiers.cpp @@ -67,12 +67,10 @@ TheoryQuantifiers::~TheoryQuantifiers() { void TheoryQuantifiers::finishInit() { // quantifiers are not evaluated in getModelValue - TheoryModel* tm = d_valuation.getModel(); - Assert(tm != nullptr); - tm->setUnevaluatedKind(EXISTS); - tm->setUnevaluatedKind(FORALL); + d_valuation.setUnevaluatedKind(EXISTS); + d_valuation.setUnevaluatedKind(FORALL); // witness is used in several instantiation strategies - tm->setUnevaluatedKind(WITNESS); + d_valuation.setUnevaluatedKind(WITNESS); } void TheoryQuantifiers::preRegisterTerm(TNode n) { |