Debian Codegraph @

test/regress/cli/regress0/sets/sets-sample.smt2

raw
1 ; COMMAND-LINE: --incremental
2 ; EXPECT: unsat
3 ; EXPECT: unsat
4 ; EXPECT: unsat
5 ; EXPECT: unsat
6 ; EXPECT: unsat
7 (set-logic ALL)
8 (define-sort SetInt () (Set Int))
9
10 ; Something simple to test parsing
11 (push 1)
12 (declare-fun a () (Set Int))
13 (declare-fun b () (Set Int))
14 (declare-fun c () (Set Int))
15 (declare-fun e () Int)
16 (assert (= a (set.singleton 5)))
17 (assert (= c (set.union a b) ))
18 (assert (not (= c (set.inter a b) )))
19 (assert (= c (set.minus a b) ))
20 (assert (set.subset a b))
21 (assert (set.member e c))
22 (assert (set.member e a))
23 (assert (set.member e (set.inter a b)))
24 (check-sat)
25 (pop 1)
26
27 ; UF can tell that this is UNSAT (set.union)
28 (push 1)
29 (declare-fun x () (Set Int))
30 (declare-fun y () (Set Int))
31 (declare-fun z () (Set Int))
32 (assert (= x y))
33 (assert (not (= (set.union x z) (set.union y z))))
34 (check-sat)
35 (pop 1)
36
37 ; UF can tell that this is UNSAT (containment)
38 (push 1)
39 (declare-fun x () (Set Int))
40 (declare-fun y () (Set Int))
41 (declare-fun e1 () Int)
42 (declare-fun e2 () Int)
43 (assert (= x y))
44 (assert (= e1 e2))
45 (assert (set.member e1 x))
46 (assert (not (set.member e2 y)))
47 (check-sat)
48 (pop 1)
49
50 ; UF can tell that this is UNSAT (merge set.union + containment examples)
51 (push 1)
52 (declare-fun x () (Set Int))
53 (declare-fun y () (Set Int))
54 (declare-fun z () (Set Int))
55 (declare-fun e1 () Int)
56 (declare-fun e2 () Int)
57 (assert (= x y))
58 (assert (= e1 e2))
59 (assert (set.member e1 (set.union x z)))
60 (assert (not (set.member e2 (set.union y z))))
61 (check-sat)
62 (pop 1)
63
64 ; test all the other kinds for completeness
65 (push 1)
66 (assert (set.member 5 (set.insert 1 2 3 4 (set.singleton 5))))
67 (assert (set.member 5 (set.insert 1 2 3 4 (as set.empty (Set Int)))))
68 (check-sat)
69
70 (exit)