Fixtype of lists of positive integers.
Theorem:
(defthm pos-listp-of-cons (equal (pos-listp (cons a x)) (and (posp a) (pos-listp x))) :rule-classes ((:rewrite)))
Theorem:
(defthm pos-listp-of-cdr-when-pos-listp (implies (pos-listp (double-rewrite x)) (pos-listp (cdr x))) :rule-classes ((:rewrite)))
Theorem:
(defthm pos-listp-when-not-consp (implies (not (consp x)) (equal (pos-listp x) (not x))) :rule-classes ((:rewrite)))
Theorem:
(defthm posp-of-car-when-pos-listp (implies (pos-listp x) (iff (posp (car x)) (consp x))) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-when-pos-listp-compound-recognizer (implies (pos-listp x) (true-listp x)) :rule-classes :compound-recognizer)
Theorem:
(defthm pos-listp-of-list-fix (implies (pos-listp x) (pos-listp (list-fix x))) :rule-classes ((:rewrite)))
Theorem:
(defthm pos-listp-of-rev (equal (pos-listp (rev x)) (pos-listp (list-fix x))) :rule-classes ((:rewrite)))
Function:
(defun pos-list-fix$inline (x) (declare (xargs :guard (pos-listp x))) (let ((__function__ 'pos-list-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (cons (pos-fix (car x)) (pos-list-fix (cdr x)))) :exec x)))
Theorem:
(defthm pos-listp-of-pos-list-fix (b* ((fty::newx (pos-list-fix$inline x))) (pos-listp fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm pos-list-fix-when-pos-listp (implies (pos-listp x) (equal (pos-list-fix x) x)))
Function:
(defun pos-list-equiv$inline (x y) (declare (xargs :guard (and (pos-listp x) (pos-listp y)))) (equal (pos-list-fix x) (pos-list-fix y)))
Theorem:
(defthm pos-list-equiv-is-an-equivalence (and (booleanp (pos-list-equiv x y)) (pos-list-equiv x x) (implies (pos-list-equiv x y) (pos-list-equiv y x)) (implies (and (pos-list-equiv x y) (pos-list-equiv y z)) (pos-list-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm pos-list-equiv-implies-equal-pos-list-fix-1 (implies (pos-list-equiv x x-equiv) (equal (pos-list-fix x) (pos-list-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm pos-list-fix-under-pos-list-equiv (pos-list-equiv (pos-list-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-pos-list-fix-1-forward-to-pos-list-equiv (implies (equal (pos-list-fix x) y) (pos-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-pos-list-fix-2-forward-to-pos-list-equiv (implies (equal x (pos-list-fix y)) (pos-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm pos-list-equiv-of-pos-list-fix-1-forward (implies (pos-list-equiv (pos-list-fix x) y) (pos-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm pos-list-equiv-of-pos-list-fix-2-forward (implies (pos-list-equiv x (pos-list-fix y)) (pos-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm car-of-pos-list-fix-x-under-pos-equiv (pos-equiv (car (pos-list-fix x)) (car x)))
Theorem:
(defthm car-pos-list-equiv-congruence-on-x-under-pos-equiv (implies (pos-list-equiv x x-equiv) (pos-equiv (car x) (car x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cdr-of-pos-list-fix-x-under-pos-list-equiv (pos-list-equiv (cdr (pos-list-fix x)) (cdr x)))
Theorem:
(defthm cdr-pos-list-equiv-congruence-on-x-under-pos-list-equiv (implies (pos-list-equiv x x-equiv) (pos-list-equiv (cdr x) (cdr x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cons-of-pos-fix-x-under-pos-list-equiv (pos-list-equiv (cons (pos-fix x) y) (cons x y)))
Theorem:
(defthm cons-pos-equiv-congruence-on-x-under-pos-list-equiv (implies (pos-equiv x x-equiv) (pos-list-equiv (cons x y) (cons x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm cons-of-pos-list-fix-y-under-pos-list-equiv (pos-list-equiv (cons x (pos-list-fix y)) (cons x y)))
Theorem:
(defthm cons-pos-list-equiv-congruence-on-y-under-pos-list-equiv (implies (pos-list-equiv y y-equiv) (pos-list-equiv (cons x y) (cons x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-pos-list-fix (equal (consp (pos-list-fix x)) (consp x)))
Theorem:
(defthm pos-list-fix-under-iff (iff (pos-list-fix x) (consp x)))
Theorem:
(defthm pos-list-fix-of-cons (equal (pos-list-fix (cons a x)) (cons (pos-fix a) (pos-list-fix x))))
Theorem:
(defthm len-of-pos-list-fix (equal (len (pos-list-fix x)) (len x)))
Theorem:
(defthm pos-list-fix-of-append (equal (pos-list-fix (append std::a std::b)) (append (pos-list-fix std::a) (pos-list-fix std::b))))
Theorem:
(defthm pos-list-fix-of-repeat (equal (pos-list-fix (repeat n x)) (repeat n (pos-fix x))))
Theorem:
(defthm list-equiv-refines-pos-list-equiv (implies (list-equiv x y) (pos-list-equiv x y)) :rule-classes :refinement)
Theorem:
(defthm nth-of-pos-list-fix (equal (nth n (pos-list-fix x)) (if (< (nfix n) (len x)) (pos-fix (nth n x)) nil)))
Theorem:
(defthm pos-list-equiv-implies-pos-list-equiv-append-1 (implies (pos-list-equiv x fty::x-equiv) (pos-list-equiv (append x y) (append fty::x-equiv y))) :rule-classes (:congruence))
Theorem:
(defthm pos-list-equiv-implies-pos-list-equiv-append-2 (implies (pos-list-equiv y fty::y-equiv) (pos-list-equiv (append x y) (append x fty::y-equiv))) :rule-classes (:congruence))
Theorem:
(defthm pos-list-equiv-implies-pos-list-equiv-nthcdr-2 (implies (pos-list-equiv l l-equiv) (pos-list-equiv (nthcdr n l) (nthcdr n l-equiv))) :rule-classes (:congruence))
Theorem:
(defthm pos-list-equiv-implies-pos-list-equiv-take-2 (implies (pos-list-equiv l l-equiv) (pos-list-equiv (take n l) (take n l-equiv))) :rule-classes (:congruence))