summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2020-05-31 18:17:02 -0700
committerAndres Noetzli <andres.noetzli@gmail.com>2020-05-31 18:17:02 -0700
commit92a708e16dc7039a1bfc07165397e3dbb6ef3080 (patch)
tree75697796e4aa6df6dcacb7c1d9743d5ac04f410b
parent6e4a5a8c865469aebec9d070c8c1976fed68914a (diff)
Set theoryof-mode after theory widening
Fixes #4367. We set the theoryof-mode depending on whether sharing is enabled or not. However, we were checking whether sharing was enabled before theory widening, leading to unexpected results. This commit moves the check after widening the theories.
-rw-r--r--src/smt/set_defaults.cpp25
-rw-r--r--test/regress/CMakeLists.txt1
-rw-r--r--test/regress/regress0/arith/issue4367.smt211
3 files changed, 25 insertions, 12 deletions
diff --git a/src/smt/set_defaults.cpp b/src/smt/set_defaults.cpp
index e06363883..b5d36f134 100644
--- a/src/smt/set_defaults.cpp
+++ b/src/smt/set_defaults.cpp
@@ -538,18 +538,6 @@ void setDefaults(SmtEngine& smte, LogicInfo& logic)
smte.setOption("produce-models", SExpr("true"));
}
- // Set the options for the theoryOf
- if (!options::theoryOfMode.wasSetByUser())
- {
- if (logic.isSharingEnabled() && !logic.isTheoryEnabled(THEORY_BV)
- && !logic.isTheoryEnabled(THEORY_STRINGS)
- && !logic.isTheoryEnabled(THEORY_SETS))
- {
- Trace("smt") << "setting theoryof-mode to term-based" << std::endl;
- options::theoryOfMode.set(options::TheoryOfMode::THEORY_OF_TERM_BASED);
- }
- }
-
/////////////////////////////////////////////////////////////////////////////
// Theory widening
//
@@ -607,8 +595,21 @@ void setDefaults(SmtEngine& smte, LogicInfo& logic)
logic.lock();
}
}
+
/////////////////////////////////////////////////////////////////////////////
+ // Set the options for the theoryOf
+ if (!options::theoryOfMode.wasSetByUser())
+ {
+ if (logic.isSharingEnabled() && !logic.isTheoryEnabled(THEORY_BV)
+ && !logic.isTheoryEnabled(THEORY_STRINGS)
+ && !logic.isTheoryEnabled(THEORY_SETS))
+ {
+ Trace("smt") << "setting theoryof-mode to term-based" << std::endl;
+ options::theoryOfMode.set(options::TheoryOfMode::THEORY_OF_TERM_BASED);
+ }
+ }
+
// by default, symmetry breaker is on only for non-incremental QF_UF
if (!options::ufSymmetryBreaker.wasSetByUser())
{
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index 38c60e0e3..20985a5f8 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -37,6 +37,7 @@ set(regress_0_tests
regress0/arith/issue3413.smt2
regress0/arith/issue3480.smt2
regress0/arith/issue3683.smt2
+ regress0/arith/issue4367.smt2
regress0/arith/issue4525.smt2
regress0/arith/ite-lift.smt2
regress0/arith/leq.01.smtv1.smt2
diff --git a/test/regress/regress0/arith/issue4367.smt2 b/test/regress/regress0/arith/issue4367.smt2
new file mode 100644
index 000000000..abe5b09fd
--- /dev/null
+++ b/test/regress/regress0/arith/issue4367.smt2
@@ -0,0 +1,11 @@
+; COMMAND-LINE: --incremental --check-unsat-cores
+; EXPECT: unsat
+; EXPECT: unsat
+(set-logic NRA)
+(declare-const r0 Real)
+(assert (! (forall ((q0 Bool) (q1 Real)) (= (* r0 r0) r0 r0)) :named IP_2))
+(assert (! (not (forall ((q2 Real)) (not (<= 55.033442 r0 55.033442 q2)))) :named IP_5))
+(push 1)
+(check-sat)
+(pop 1)
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback