2
(begin-book t :ttags :all);$ACL2s-Preamble$|#
6
;; The following book contains the defintion of del.
7
;; We load this book, to prevent mutliple defintions,
8
;; of the same function.
9
(include-book "meta/term-defuns" :dir :system)
12
(defun permp (left right)
13
(or (and (endp left) (endp right))
15
(member-equal (car left) right)
16
(permp (cdr left) (del (car left) right)))))
21
(defthm permp-reflexive
23
(defthm del-different-element-preserves-member
24
(implies (not (equal a b))
25
(iff (member-equal a (del b x))
27
(defthm permp-implies-member-iff
29
(iff (member-equal a x)
32
(equal (del a (del b c)) (del b (del a c))))
33
(defthm del-same-member-preserves-permp
34
(implies (and (member-equal x a)
39
(defthm permp-transitive
40
(implies (and (permp x y)
43
(in-theory (disable permp-implies-member-iff))
44
(defthm cons-del-permutation-of-original
45
(implies (and (member-equal a y)
46
(permp (cons a (del a y)) x))
48
(defthm permp-symmetric
51
(defthm member-of-append-iff-member-of-operand
52
(iff (member-equal a (append x y))
53
(or (member-equal a x)
56
(defcong permp permp (append x y) 2)
57
(defcong permp permp (append x y) 1)
58
(defcong permp permp (del a x) 2)
59
(defcong permp permp (cons a x) 2)
60
(defcong permp iff (member-equal a x) 2)
62
(defthm permp-append-cons
63
(permp (append x (cons a y))
64
(cons a (append x y))))
65
(local (defthm member-remove-equal
66
(iff (member-equal a (remove-equal b x))
67
(and (member-equal a x)
69
(defcong permp permp (remove-equal a x) 2)
70
(defcong permp equal (subsetp x y) 1)
71
(defcong permp equal (subsetp x y) 2)
72
(defthm succesful-del-preserves-permp
73
(implies (and (member c ch1)
75
(equal (permp (del c ch1)
78
(defthm unsuccesful-del-preserves-set
79
(implies (not (member c ch1))
82
(defthm del-preserves-permp
83
(implies (equal (member c ch1)
85
(equal (permp (del c ch1)
89
:cases ((and (member c ch1) (member c ch2)) (and (not (member c ch1)) (not (member c ch2))))