summaryrefslogtreecommitdiff
path: root/test/regress/regress0/sets/sets-sample.smt2
blob: 4a11bcc78a001e30b31fa5fbda7f9d8136c12053 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; COMMAND-LINE: --incremental
; EXPECT: unsat
; EXPECT: unsat
; EXPECT: unsat
; EXPECT: unsat
; EXPECT: unsat
(set-logic ALL)
(define-sort SetInt () (Set Int))

; Something simple to test parsing
(push 1)
(declare-fun a () (Set Int))
(declare-fun b () (Set Int))
(declare-fun c () (Set Int))
(declare-fun e () Int)
(assert (= a (set.singleton 5)))
(assert (= c (set.union a b) ))
(assert (not (= c (set.inter a b) )))
(assert (= c (set.minus a b) ))
(assert (set.subset a b))
(assert (set.member e c))
(assert (set.member e a))
(assert (set.member e (set.inter a b)))
(check-sat)
(pop 1)

; UF can tell that this is UNSAT (set.union)
(push 1)
(declare-fun x () (Set Int))
(declare-fun y () (Set Int))
(declare-fun z () (Set Int))
(assert (= x y))
(assert (not (= (set.union x z) (set.union y z))))
(check-sat)
(pop 1)

; UF can tell that this is UNSAT (containment)
(push 1)
(declare-fun x () (Set Int))
(declare-fun y () (Set Int))
(declare-fun e1 () Int)
(declare-fun e2 () Int)
(assert (= x y))
(assert (= e1 e2))
(assert (set.member e1 x))
(assert (not (set.member e2 y)))
(check-sat)
(pop 1)

; UF can tell that this is UNSAT (merge set.union + containment examples)
(push 1)
(declare-fun x () (Set Int))
(declare-fun y () (Set Int))
(declare-fun z () (Set Int))
(declare-fun e1 () Int)
(declare-fun e2 () Int)
(assert (= x y))
(assert (= e1 e2))
(assert (set.member e1 (set.union x z)))
(assert (not (set.member e2 (set.union y z))))
(check-sat)
(pop 1)

; test all the other kinds for completeness
(push 1)
(assert (set.member 5 (set.insert 1 2 3 4 (set.singleton 5))))
(assert (set.member 5 (set.insert 1 2 3 4 (as set.empty (Set Int)))))
(check-sat)
 
(exit) 
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback