summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2019-04-01 15:07:05 -0700
committerGitHub <noreply@github.com>2019-04-01 15:07:05 -0700
commit8a9ffdbb248ddcc6a41f628f6dcbc070b57e6a28 (patch)
treebf9e85f9950c2c52f7795bdebdfd0183f114060d /test
parent41355e412a142809f63a1939a4515486ccd4c6fb (diff)
FP: Fix wrong model due to partial assignment (#2910)
For a simple query `(not (= (fp.isSubnormal x) false))`, we were getting a wrong model. The issue was that `(sign x)` was not assigned a value and did not appear in the shared terms. In `TheoryFp::collectModelInfo()`, however, we generate an expression that connects the components of `x` to `x`, which contains `(sign x)`. As a result, the normalization while building a model did not result in a constant. This commit fixes the issue by marking `(sign x)` (and `(significand x)`) as assignable. Assignable terms can take any value while building a model if there is no existing value.
Diffstat (limited to 'test')
-rw-r--r--test/regress/CMakeLists.txt1
-rw-r--r--test/regress/regress0/fp/wrong-model.smt211
2 files changed, 12 insertions, 0 deletions
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index c6ccab464..13d1540f6 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -451,6 +451,7 @@ set(regress_0_tests
regress0/fp/abs-unsound2.smt2
regress0/fp/ext-rew-test.smt2
regress0/fp/simple.smt2
+ regress0/fp/wrong-model.smt2
regress0/fuzz_1.smt
regress0/fuzz_3.smt
regress0/get-value-incremental.smt2
diff --git a/test/regress/regress0/fp/wrong-model.smt2 b/test/regress/regress0/fp/wrong-model.smt2
new file mode 100644
index 000000000..4bb7645d5
--- /dev/null
+++ b/test/regress/regress0/fp/wrong-model.smt2
@@ -0,0 +1,11 @@
+; REQUIRES: symfpu
+; EXPECT: sat
+
+; NOTE: the (set-logic ALL) is on purpose because the problem was not triggered
+; with QF_FP.
+(set-logic ALL)
+(declare-const r RoundingMode)
+(declare-const x (_ FloatingPoint 5 11))
+(declare-const y (_ FloatingPoint 5 11))
+(assert (not (= (fp.isSubnormal x) false)))
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback