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/arith/theory_arith.cpp | |
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/arith/theory_arith.cpp')
-rw-r--r-- | src/theory/arith/theory_arith.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/theory/arith/theory_arith.cpp b/src/theory/arith/theory_arith.cpp index 52321ffd4..bc6e18a83 100644 --- a/src/theory/arith/theory_arith.cpp +++ b/src/theory/arith/theory_arith.cpp @@ -62,17 +62,15 @@ void TheoryArith::preRegisterTerm(TNode n){ void TheoryArith::finishInit() { - TheoryModel* tm = d_valuation.getModel(); - Assert(tm != nullptr); if (getLogicInfo().isTheoryEnabled(THEORY_ARITH) && getLogicInfo().areTranscendentalsUsed()) { // witness is used to eliminate square root - tm->setUnevaluatedKind(kind::WITNESS); + d_valuation.setUnevaluatedKind(kind::WITNESS); // we only need to add the operators that are not syntax sugar - tm->setUnevaluatedKind(kind::EXPONENTIAL); - tm->setUnevaluatedKind(kind::SINE); - tm->setUnevaluatedKind(kind::PI); + d_valuation.setUnevaluatedKind(kind::EXPONENTIAL); + d_valuation.setUnevaluatedKind(kind::SINE); + d_valuation.setUnevaluatedKind(kind::PI); } } |