summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-01-30 03:32:47 -0600
committerGitHub <noreply@github.com>2020-01-30 01:32:47 -0800
commit13ef9140d1ba6740ccb2c1f29bd2d243de6872c2 (patch)
tree1626d5979182f94f12c9fc28a4a9046edb5d1304
parente3361a428a1b24369d782120de1f050874a8ac44 (diff)
Do not debug check model for models with approximations (#3673)
We don't run check-model for models with approximate values, however we were still running the internal debugCheckModel method, which leads to assertion failures. This disables this check. Fixes #3652.
-rw-r--r--src/theory/theory_model_builder.cpp5
-rw-r--r--test/regress/CMakeLists.txt1
-rw-r--r--test/regress/regress0/nl/issue3652.smt27
3 files changed, 13 insertions, 0 deletions
diff --git a/src/theory/theory_model_builder.cpp b/src/theory/theory_model_builder.cpp
index 11758f1e9..02dded8b3 100644
--- a/src/theory/theory_model_builder.cpp
+++ b/src/theory/theory_model_builder.cpp
@@ -1127,6 +1127,11 @@ void TheoryEngineModelBuilder::debugCheckModel(TheoryModel* tm)
{
#ifdef CVC4_ASSERTIONS
Assert(tm->isBuilt());
+ if (tm->hasApproximations())
+ {
+ // models with approximations may fail the assertions below
+ return;
+ }
eq::EqClassesIterator eqcs_i = eq::EqClassesIterator(tm->d_equalityEngine);
std::map<Node, Node>::iterator itMap;
// Check that every term evaluates to its representative in the model
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index bd3665727..b35c13757 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -549,6 +549,7 @@ set(regress_0_tests
regress0/nl/issue3407.smt2
regress0/nl/issue3411.smt2
regress0/nl/issue3475.smt2
+ regress0/nl/issue3652.smt2
regress0/nl/magnitude-wrong-1020-m.smt2
regress0/nl/mult-po.smt2
regress0/nl/nia-wrong-tl.smt2
diff --git a/test/regress/regress0/nl/issue3652.smt2 b/test/regress/regress0/nl/issue3652.smt2
new file mode 100644
index 000000000..f3429b73d
--- /dev/null
+++ b/test/regress/regress0/nl/issue3652.smt2
@@ -0,0 +1,7 @@
+;COMMAND-LINE: --check-models
+;EXIT: 1
+;EXPECT: (error "Cannot run check-model on a model with approximate values.")
+(set-logic QF_NRA)
+(declare-fun a () Real)
+(assert (= (* a a) 2))
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback