Consider PI to be a model value (#8176)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Fri, 25 Feb 2022 22:48:12 +0000 (16:48 -0600)
committerGitHub <noreply@github.com>
Fri, 25 Feb 2022 22:48:12 +0000 (16:48 -0600)
Fixes cvc5/cvc5-projects#460.

The special case is necessary due to the node representation of nullary operators, which uses variables internally to represent operators. The other nullary operators are not model values.

src/theory/theory_model.cpp
test/regress/CMakeLists.txt
test/regress/regress0/nl/nta/proj-issue460-pi-value.smt2 [new file with mode: 0644]

index 58bd3299503c6dbc2e47d694040b8ccac7ab6505..c8af6abcbcc36405266def0c9bfbe80896533fd2 100644 (file)
@@ -784,7 +784,7 @@ bool TheoryModel::isBaseModelValue(TNode n) const
   }
   Kind k = n.getKind();
   if (k == kind::REAL_ALGEBRAIC_NUMBER || k == kind::LAMBDA
-      || k == kind::WITNESS)
+      || k == kind::WITNESS || k == kind::PI)
   {
     // we are a value if we are one of the above kinds
     return true;
index e2b234950a652605d9783f68fc546353b6f643c3..35fec03874548166bde27c16cbe83bc7e1ed3c10 100644 (file)
@@ -792,6 +792,7 @@ set(regress_0_tests
   regress0/nl/nta/issue7938-tf-model.smt2
   regress0/nl/nta/issue8147-unc-model.smt2
   regress0/nl/nta/issue8160-model-purify.smt2
+  regress0/nl/nta/proj-issue460-pi-value.smt2
   regress0/nl/nta/real-pi.smt2
   regress0/nl/nta/sin-sym.smt2
   regress0/nl/nta/sqrt-simple.smt2
diff --git a/test/regress/regress0/nl/nta/proj-issue460-pi-value.smt2 b/test/regress/regress0/nl/nta/proj-issue460-pi-value.smt2
new file mode 100644 (file)
index 0000000..6b7c101
--- /dev/null
@@ -0,0 +1,7 @@
+; COMMAND-LINE: -q
+; EXPECT: sat
+(set-logic ALL)
+(set-info :status sat)
+(set-option :global-declarations true)
+(set-option :sets-ext true)
+(check-sat-assuming ( (let ((_let0 real.pi))(set.member (- _let0) (set.complement (set.singleton _let0))))))