summaryrefslogtreecommitdiff
path: root/test/regress/regress0/rewriterules/length_trick2.smt2
blob: af9e7f07d164c7bb736c5f62e334ab969c9fba25 (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
;; Same than length.smt2 but the nil case is not a rewrite rule
;; So here the rewrite rules have no guards length

(set-logic AUFLIA)
(set-info :status unsat)

;; don't use a datatypes for currently focusing in uf
(declare-sort list 0)

(declare-fun cons (Int list) list)
(declare-fun nil  ()         list)


;;define length
(declare-fun length (list) Int)

(assert (= (length nil) 0))




(assert (forall ((?e Int) (?l list)) (! (= (length (cons ?e ?l)) (+ (length ?l) 1)) :rewrite-rule)))

;;(assert (forall ((?l list)) (=> (= ?l nil) (= (length ?l) 0))))

;;(assert (forall ((?e Int) (?l list) (?l2 list)) (=> (= ?l2 (cons ?e ?l)) (= (length ?l2) (+ (length ?l) 1)))))

(assert (forall ((?a Int) (?b Int) (?l list))
        (not (> (length (cons ?a (cons  ?b ?l))) (length ?l)))))
(check-sat)

(exit)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback