summaryrefslogtreecommitdiff
path: root/test/regress/regress2
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-11-09 07:42:03 -0600
committerGitHub <noreply@github.com>2020-11-09 07:42:03 -0600
commit6cb2e5743bd886115124256c2a3ad689a5b822a2 (patch)
tree9376134244e1fc6729bc10a1a78fcdf2ee73d76d /test/regress/regress2
parent63df35c477ee9e6c7bdeae677656dd374563de55 (diff)
Do not regress explanations of datatype lemmas (#5376)
This modifies datatypes to not regress explanations for lemmas. This avoids segfaults in some corner cases of sygus (see attached) and leads to slightly better performance on Facebook verification benchmarks.
Diffstat (limited to 'test/regress/regress2')
-rw-r--r--test/regress/regress2/sygus/policyM.sy41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/regress/regress2/sygus/policyM.sy b/test/regress/regress2/sygus/policyM.sy
new file mode 100644
index 000000000..0e9b33148
--- /dev/null
+++ b/test/regress/regress2/sygus/policyM.sy
@@ -0,0 +1,41 @@
+; EXPECT: unsat
+; COMMAND-LINE: --sygus-out=status --lang=sygus2
+(set-logic ALL)
+
+(declare-datatype Pair ((pair (pmin Int) (pmax Int))))
+
+(define-fun wf ((p Pair)) Bool
+ (<= (pmin p) (pmax p)))
+(define-fun a ((p Pair) (q Pair)) Bool
+ (< (pmax p) (pmin q)))
+(define-fun intMax ((x Int) (y Int)) Int
+ (ite (>= x y) x y))
+(define-fun intMin ((x Int) (y Int)) Int
+ (ite (>= x y) y x))
+(define-fun midpoint ((x Int) (y Int)) Int
+ (div (+ x y) 2))
+
+(synth-fun pW ((p Pair) (q Pair)) Pair
+ ((StartPair Pair) (StartInt Int)) (
+ (StartPair Pair ((pair StartInt StartInt)))
+ (StartInt Int ((pmin p) (pmax p) (pmin q) (pmax q) (intMax StartInt StartInt) (intMin StartInt StartInt) (midpoint StartInt StartInt)))
+))
+(synth-fun pL ((p Pair) (q Pair)) Pair
+ ((StartPair Pair) (StartInt Int)) (
+ (StartPair Pair ((pair StartInt StartInt)))
+ (StartInt Int ((+ StartInt StartInt) 0 1 (pmin p) (pmax p) (pmin q) (pmax q) (intMax StartInt StartInt) (intMin StartInt StartInt) (midpoint StartInt StartInt)))
+))
+
+(declare-var p Pair)
+(declare-var q Pair)
+(declare-var r Pair)
+
+(constraint (=> (and (wf p) (wf q)) (wf (pW p q))))
+(constraint (=> (and (wf p) (wf q)) (wf (pL p q))))
+
+(constraint (=> (and (wf p) (wf q) (wf r) (a p r)) (a (pW p q) r)))
+(constraint (=> (and (wf p) (wf q) (wf r) (a p r)) (a p (pL r q))))
+
+(constraint (=> (and (wf p) (wf q)) (not (a (pL q p) (pW p q)))))
+
+(check-synth)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback