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