summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2017-02-07 13:26:57 -0600
committerajreynol <andrew.j.reynolds@gmail.com>2017-02-07 13:26:57 -0600
commit3837f84ab251d1563726f3d13b95f541eaa331a4 (patch)
tree7afb6eb470b837b7e7600437356a8080fc329eb5 /test
parent0dd2aa21f35b221ea96d277e9ea7cbc816ffe83c (diff)
Generalize finite bound inference to unifiable variables in set membership literals.
Diffstat (limited to 'test')
-rw-r--r--test/regress/regress0/fmf/Makefile.am3
-rw-r--r--test/regress/regress0/fmf/cons-sets-bounds.smt226
2 files changed, 28 insertions, 1 deletions
diff --git a/test/regress/regress0/fmf/Makefile.am b/test/regress/regress0/fmf/Makefile.am
index 03fe780b8..af8776ace 100644
--- a/test/regress/regress0/fmf/Makefile.am
+++ b/test/regress/regress0/fmf/Makefile.am
@@ -64,7 +64,8 @@ TESTS = \
fmf-bound-2dim.smt2 \
memory_model-R_cpp-dd.cvc \
bug764.smt2 \
- ko-bound-set.cvc
+ ko-bound-set.cvc \
+ cons-sets-bounds.smt2
EXTRA_DIST = $(TESTS)
diff --git a/test/regress/regress0/fmf/cons-sets-bounds.smt2 b/test/regress/regress0/fmf/cons-sets-bounds.smt2
new file mode 100644
index 000000000..db9788a61
--- /dev/null
+++ b/test/regress/regress0/fmf/cons-sets-bounds.smt2
@@ -0,0 +1,26 @@
+; COMMAND-LINE: --fmf-bound
+; EXPECT: sat
+(set-logic ALL)
+(declare-datatypes () ((list (cons (head Int) (tail list)) (nil))))
+
+(declare-fun P (Int) Bool)
+(declare-fun S () (Set list))
+
+; can use simple unification to infer bounds on x and y
+(assert (forall ((x Int) (y list)) (=> (member (cons x y) S) (P x))))
+
+(assert (member (cons 4 (cons 1 nil)) S))
+(assert (member (cons 2 nil) S))
+
+; should construct instantiation involving selectors for l
+(declare-fun l () list)
+(assert (is-cons l))
+(assert (member l S))
+
+; should not contribute to instantiations
+(assert (member nil S))
+
+(assert (not (P 1)))
+(assert (not (P 0)))
+
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback