Recognizer for tree-set.
(tree-setp x) → *
Function:
(defun tree-setp (x) (declare (xargs :guard t)) (if (atom x) (null x) (and (treep (car x)) (or (null (cdr x)) (and (consp (cdr x)) (acl2::fast-<< (car x) (cadr x)) (tree-setp (cdr x)))))))
Theorem:
(defthm booleanp-oftree-setp (booleanp (tree-setp x)))
Theorem:
(defthm setp-when-tree-setp (implies (tree-setp x) (setp x)) :rule-classes (:rewrite))
Theorem:
(defthm treep-of-head-when-tree-setp (implies (tree-setp x) (equal (treep (head x)) (not (emptyp x)))))
Theorem:
(defthm tree-setp-of-tail-when-tree-setp (implies (tree-setp x) (tree-setp (tail x))))
Theorem:
(defthm tree-setp-of-insert (equal (tree-setp (insert a x)) (and (treep a) (tree-setp (sfix x)))))
Theorem:
(defthm treep-when-in-tree-setp-binds-free-x (implies (and (in a x) (tree-setp x)) (treep a)))
Theorem:
(defthm not-in-tree-setp-when-not-treep (implies (and (tree-setp x) (not (treep a))) (not (in a x))))
Theorem:
(defthm tree-setp-of-union (equal (tree-setp (union x y)) (and (tree-setp (sfix x)) (tree-setp (sfix y)))))
Theorem:
(defthm tree-setp-of-intersect (implies (and (tree-setp x) (tree-setp y)) (tree-setp (intersect x y))))
Theorem:
(defthm tree-setp-of-difference (implies (tree-setp x) (tree-setp (difference x y))))
Theorem:
(defthm tree-setp-of-delete (implies (tree-setp x) (tree-setp (delete a x))))