summaryrefslogtreecommitdiff
path: root/src/theory/arith/theory_arith.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-05-19 21:48:01 -0500
committerGitHub <noreply@github.com>2020-05-19 21:48:01 -0500
commitaf874a5c7a2ff134da0d4c20d06a0626d3e36d9b (patch)
tree16ad9de2b0c5753d2cd4cd3fcdd43bf8fbd55a71 /src/theory/arith/theory_arith.cpp
parent9712a20e6585728c7d0453e64e1e3b06a7d37b7f (diff)
Do not eliminate variables that are equal to unevaluatable terms (#4267)
When we eliminate a variable x -> v during simplification, it may be the case that v contains "unevaluated" operators like forall, choice, etc. Thus, we do not produce correct models for such inputs unless simplification is disabled. This PR ensures we only eliminate variables when v contains only evaluated operators. Additionally, the kinds registered as unevaluated were slightly modified so that when we are in a logic like QF_LIA, there are no registered unevaluated operators, hence the check above is unnecessary. This is to minimize the performance impact of this change. Fixes #4500.
Diffstat (limited to 'src/theory/arith/theory_arith.cpp')
-rw-r--r--src/theory/arith/theory_arith.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/theory/arith/theory_arith.cpp b/src/theory/arith/theory_arith.cpp
index cdb6c77f3..e65369f96 100644
--- a/src/theory/arith/theory_arith.cpp
+++ b/src/theory/arith/theory_arith.cpp
@@ -63,6 +63,18 @@ void TheoryArith::preRegisterTerm(TNode n){
d_internal->preRegisterTerm(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);
+ }
+}
+
Node TheoryArith::expandDefinition(Node node)
{
return d_internal->expandDefinition(node);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback