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