| 1 |
; COMMAND-LINE: --finite-model-find |
| 2 |
; EXPECT: sat |
| 3 |
(set-logic ALL) |
| 4 |
(set-info :smt-lib-version 2.6) |
| 5 |
(set-info :category "unknown") |
| 6 |
(set-info :status sat) |
| 7 |
(declare-datatype UNIT ((Unit))) |
| 8 |
(declare-datatype BOOL ((Truth) (Falsity))) |
| 9 |
(declare-sort resource$type 0) |
| 10 |
(declare-sort process$type 0) |
| 11 |
(declare-fun null () resource$type) |
| 12 |
(declare-sort S$t$type 0) |
| 13 |
(declare-fun S$empty () S$t$type) |
| 14 |
(declare-fun S$mem (process$type S$t$type) BOOL) |
| 15 |
(declare-fun S$add (process$type S$t$type) S$t$type) |
| 16 |
(declare-fun S$remove (process$type S$t$type) S$t$type) |
| 17 |
(declare-fun S$cardinality (S$t$type) Int) |
| 18 |
(assert (forall ((e process$type)) (not (= (S$mem e S$empty) Truth)))) |
| 19 |
(assert (forall ((x process$type) (y process$type) (s S$t$type)) (= (S$mem x (S$add y s)) (ite (or (= x y) (= (S$mem x s) Truth)) Truth Falsity)))) |
| 20 |
(assert (forall ((x process$type) (y process$type) (s S$t$type)) (= (S$mem x (S$remove y s)) (ite (and (not (= x y)) (= (S$mem x s) Truth)) Truth Falsity)))) |
| 21 |
(assert (= (S$cardinality S$empty) 0)) |
| 22 |
(assert (forall ((s S$t$type)) (=> (= (S$cardinality s) 0) (= s S$empty)))) |
| 23 |
(assert (forall ((s S$t$type)) (>= (S$cardinality s) 0))) |
| 24 |
(assert (forall ((x process$type) (s S$t$type)) (let ((?v_0 (S$cardinality s))) (= (S$cardinality (S$add x s)) (ite (= (S$mem x s) Truth) ?v_0 (+ ?v_0 1)))))) |
| 25 |
(assert (forall ((x process$type) (s S$t$type)) (let ((?v_0 (S$cardinality s))) (= (S$cardinality (S$remove x s)) (ite (= (S$mem x s) Truth) (- ?v_0 1) ?v_0))))) |
| 26 |
(declare-fun count () (Array resource$type Int)) |
| 27 |
(declare-fun ref () (Array process$type resource$type)) |
| 28 |
(declare-fun valid () (Array resource$type BOOL)) |
| 29 |
(declare-fun destroy$r () resource$type) |
| 30 |
(declare-fun valid$1 () (Array resource$type BOOL)) |
| 31 |
(assert (not (=> (forall ((p process$type)) (let ((?v_0 (select ref p))) (=> (not (= ?v_0 null)) (= (select valid ?v_0) Truth)))) (=> (not (= destroy$r null)) (=> (= (select valid destroy$r) Truth) (=> (= (select count destroy$r) 0) (=> (= valid$1 (store valid destroy$r Falsity)) (forall ((p process$type)) (let ((?v_1 (select ref p))) (=> (not (= ?v_1 null)) (= (select valid$1 ?v_1) Truth))))))))))) |
| 32 |
(check-sat) |
| 33 |
(exit) |