Global negate requires quantifiers (#8957)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 19 Jul 2022 13:54:47 +0000 (08:54 -0500)
committerGitHub <noreply@github.com>
Tue, 19 Jul 2022 13:54:47 +0000 (13:54 +0000)
Fixes cvc5/cvc5-projects#521.

Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
src/smt/set_defaults.cpp
test/regress/cli/CMakeLists.txt
test/regress/cli/regress0/quantifiers/global_negate.smt2 [new file with mode: 0644]

index 942af84e844c5c87f28a3981aa347ea1d318155f..63dd97ba27f54f4b8d8278255b75a341ad401a45 100644 (file)
@@ -1243,6 +1243,13 @@ void SetDefaults::widenLogic(LogicInfo& logic, const Options& opts) const
     logic = log;
     logic.lock();
   }
+  if (opts.quantifiers.globalNegate)
+  {
+    LogicInfo log(logic.getUnlockedCopy());
+    log.enableQuantifiers();
+    logic = log;
+    logic.lock();
+  }
   if (opts.quantifiers.preSkolemQuantNested
       && opts.quantifiers.preSkolemQuantNestedWasSetByUser)
   {
index 0545664b3be1e521d25ecb73c368216e228f14b6..51836ea021817191e37b60c813c79919e17e0db2 100644 (file)
@@ -1074,6 +1074,7 @@ set(regress_0_tests
   regress0/quantifiers/ex3.smt2
   regress0/quantifiers/ex6.smt2
   regress0/quantifiers/floor.smt2
+  regress0/quantifiers/global_negate.smt2
   regress0/quantifiers/horn-ground-pre-post.smt2
   regress0/quantifiers/is-even-pred.smt2
   regress0/quantifiers/is-int.smt2
diff --git a/test/regress/cli/regress0/quantifiers/global_negate.smt2 b/test/regress/cli/regress0/quantifiers/global_negate.smt2
new file mode 100644 (file)
index 0000000..e03babc
--- /dev/null
@@ -0,0 +1,11 @@
+; EXPECT: sat
+(set-option :global-declarations true)
+(set-logic QF_FP)
+(set-option :global-negate true)
+(set-option :fp-exp true)
+(declare-const _x0 (_ BitVec 23))
+(declare-const _x1 (_ BitVec 5))
+(declare-const _x2 (_ BitVec 16))
+(declare-const _x3 (_ BitVec 5))
+(assert (let ((_let0 ((_ to_fp 5 11) _x2)))(fp.leq _let0 _let0 _let0)))
+(check-sat)