summaryrefslogtreecommitdiff
path: root/test/regress/regress0/unconstrained/issue4644.smt2
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2020-06-24 00:06:23 -0700
committerAndres Noetzli <andres.noetzli@gmail.com>2020-06-24 00:16:19 -0700
commitb422b152b4a21400f200cc5133e43fc7073a08a1 (patch)
tree415a032372b68c4de093a5b493ed71b8a7fc6d3d /test/regress/regress0/unconstrained/issue4644.smt2
parentfeea2d248ebe0c024c9c5ed14a9f0bf34b06c146 (diff)
[unconstrained] Fix gathering of visited-once varsfix4644
Fixes #4644. This commit fixes an issue where the set `d_unconstrained` in the unconstrained simplification pass was not computed correctly. The problem was that visiting the same term multiple times did not remove the variables appearing in that term from the visited-once set. A simple example that triggers the issue is the following: ``` (set-logic ALL) (declare-fun a () Bool) (declare-fun b () Bool) (assert (not (= a b))) (assert (= a (= a b))) (check-sat) ``` After running `UnconstrainedSimplifier::visitAll()` on both assertions, we end up with `[b]` as our `d_unconstrained` set. We end up inferring the substitution `(= a b) --> b` and get `(not b)` and `b`, which is unsat even though the original problem is sat. This commit fixes the issue by visiting all the children of a node if we visit a node for a second time. This makes sure that we remove any children from the visisted-once set.
Diffstat (limited to 'test/regress/regress0/unconstrained/issue4644.smt2')
-rw-r--r--test/regress/regress0/unconstrained/issue4644.smt29
1 files changed, 9 insertions, 0 deletions
diff --git a/test/regress/regress0/unconstrained/issue4644.smt2 b/test/regress/regress0/unconstrained/issue4644.smt2
new file mode 100644
index 000000000..aeb2bfc84
--- /dev/null
+++ b/test/regress/regress0/unconstrained/issue4644.smt2
@@ -0,0 +1,9 @@
+; COMMAND-LINE: --unconstrained-simp
+(set-logic ALL)
+(declare-fun a () Bool)
+(declare-fun b () Bool)
+(declare-fun c () Bool)
+(assert (distinct a c))
+(assert (= a b (= b c)))
+(set-info :status sat)
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback