summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbdalrhman Mohamed <32971963+abdoo8080@users.noreply.github.com>2021-04-14 07:36:58 -0700
committerGitHub <noreply@github.com>2021-04-14 14:36:58 +0000
commitf3ecc4bfe17776d08efbbb5ed76a5879efa419ca (patch)
treef52f2421fee5bc8d915528125ac3b102569635df /test
parent3114f91e3fc62380a18dd0c9b8607b564d609640 (diff)
Merge equivalent sub-obligations instead of discarding them. (#6353)
This PR modifies the behavior of the reconstruction algorithm when the term to reconstruct contains two or more equivalent sub-terms, but one is easier to reconstruct than the others. Since we do not know which one is easier to reconstruct by matching, we match against all sub-terms. If a solution is found for one sub-term, we use it to solve the others.
Diffstat (limited to 'test')
-rw-r--r--test/regress/CMakeLists.txt1
-rw-r--r--test/regress/regress1/sygus/eq-sub-obs.sy22
2 files changed, 23 insertions, 0 deletions
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index 5c3ceec21..710c06f96 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -2170,6 +2170,7 @@ set(regress_1_tests
regress1/sygus/double.sy
regress1/sygus/dt-test-ns.sy
regress1/sygus/dup-op.sy
+ regress1/sygus/eq-sub-obs.sy
regress1/sygus/error1-dt.sy
regress1/sygus/eval-uc.sy
regress1/sygus/extract.sy
diff --git a/test/regress/regress1/sygus/eq-sub-obs.sy b/test/regress/regress1/sygus/eq-sub-obs.sy
new file mode 100644
index 000000000..4c24a498d
--- /dev/null
+++ b/test/regress/regress1/sygus/eq-sub-obs.sy
@@ -0,0 +1,22 @@
+; COMMAND-LINE: --sygus-si=all --sygus-out=status
+; EXPECT: unsat
+
+; This regression tests the behavior of the reconstruction algorithm when the
+; term to reconstruct contains two equivalent sub-terms, but one is easier to
+; reconstruct than the other.
+
+(set-logic UF)
+
+(synth-fun f ((p Bool) (q Bool) (r Bool)) Bool
+ ((Start Bool))
+ ((Start Bool (true false p q r (not Start) (and Start Start) (or Start Start)))))
+
+(define-fun eqReduce ((p Bool) (q Bool)) Bool (or (and p q) (and (not p) (not q))))
+
+(declare-var p Bool)
+(declare-var q Bool)
+(declare-var r Bool)
+
+(constraint (= (f p q r) (and (= (and p q) (and q r)) (eqReduce (and p q) (and q r)))))
+
+(check-synth)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback