From 13ef9140d1ba6740ccb2c1f29bd2d243de6872c2 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Thu, 30 Jan 2020 03:32:47 -0600 Subject: [PATCH] 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. --- src/theory/theory_model_builder.cpp | 5 +++++ test/regress/CMakeLists.txt | 1 + test/regress/regress0/nl/issue3652.smt2 | 7 +++++++ 3 files changed, 13 insertions(+) create mode 100644 test/regress/regress0/nl/issue3652.smt2 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::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) -- 2.30.2