(nat-list-fix x) is a usual fty list fixing function.
In the logic, we apply nfix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.
Function:
(defun nat-list-fix$inline (x) (declare (xargs :guard (nat-listp x))) (let ((__function__ 'nat-list-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (cons (nfix (car x)) (nat-list-fix (cdr x)))) :exec x)))
Theorem:
(defthm nat-listp-of-nat-list-fix (b* ((fty::newx (nat-list-fix$inline x))) (nat-listp fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm nat-list-fix-when-nat-listp (implies (nat-listp x) (equal (nat-list-fix x) x)))
Function:
(defun nat-list-equiv$inline (x y) (declare (xargs :guard (and (nat-listp x) (nat-listp y)))) (equal (nat-list-fix x) (nat-list-fix y)))
Theorem:
(defthm nat-list-equiv-is-an-equivalence (and (booleanp (nat-list-equiv x y)) (nat-list-equiv x x) (implies (nat-list-equiv x y) (nat-list-equiv y x)) (implies (and (nat-list-equiv x y) (nat-list-equiv y z)) (nat-list-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm nat-list-equiv-implies-equal-nat-list-fix-1 (implies (nat-list-equiv x x-equiv) (equal (nat-list-fix x) (nat-list-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm nat-list-fix-under-nat-list-equiv (nat-list-equiv (nat-list-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-nat-list-fix-1-forward-to-nat-list-equiv (implies (equal (nat-list-fix x) y) (nat-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-nat-list-fix-2-forward-to-nat-list-equiv (implies (equal x (nat-list-fix y)) (nat-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm nat-list-equiv-of-nat-list-fix-1-forward (implies (nat-list-equiv (nat-list-fix x) y) (nat-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm nat-list-equiv-of-nat-list-fix-2-forward (implies (nat-list-equiv x (nat-list-fix y)) (nat-list-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm car-of-nat-list-fix-x-under-nat-equiv (nat-equiv (car (nat-list-fix x)) (car x)))
Theorem:
(defthm car-nat-list-equiv-congruence-on-x-under-nat-equiv (implies (nat-list-equiv x x-equiv) (nat-equiv (car x) (car x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cdr-of-nat-list-fix-x-under-nat-list-equiv (nat-list-equiv (cdr (nat-list-fix x)) (cdr x)))
Theorem:
(defthm cdr-nat-list-equiv-congruence-on-x-under-nat-list-equiv (implies (nat-list-equiv x x-equiv) (nat-list-equiv (cdr x) (cdr x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cons-of-nfix-x-under-nat-list-equiv (nat-list-equiv (cons (nfix x) y) (cons x y)))
Theorem:
(defthm cons-nat-equiv-congruence-on-x-under-nat-list-equiv (implies (nat-equiv x x-equiv) (nat-list-equiv (cons x y) (cons x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm cons-of-nat-list-fix-y-under-nat-list-equiv (nat-list-equiv (cons x (nat-list-fix y)) (cons x y)))
Theorem:
(defthm cons-nat-list-equiv-congruence-on-y-under-nat-list-equiv (implies (nat-list-equiv y y-equiv) (nat-list-equiv (cons x y) (cons x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-nat-list-fix (equal (consp (nat-list-fix x)) (consp x)))
Theorem:
(defthm nat-list-fix-under-iff (iff (nat-list-fix x) (consp x)))
Theorem:
(defthm nat-list-fix-of-cons (equal (nat-list-fix (cons a x)) (cons (nfix a) (nat-list-fix x))))
Theorem:
(defthm len-of-nat-list-fix (equal (len (nat-list-fix x)) (len x)))
Theorem:
(defthm nat-list-fix-of-append (equal (nat-list-fix (append std::a std::b)) (append (nat-list-fix std::a) (nat-list-fix std::b))))
Theorem:
(defthm nat-list-fix-of-repeat (equal (nat-list-fix (repeat n x)) (repeat n (nfix x))))
Theorem:
(defthm list-equiv-refines-nat-list-equiv (implies (list-equiv x y) (nat-list-equiv x y)) :rule-classes :refinement)
Theorem:
(defthm nth-of-nat-list-fix (equal (nth n (nat-list-fix x)) (if (< (nfix n) (len x)) (nfix (nth n x)) nil)))
Theorem:
(defthm nat-list-equiv-implies-nat-list-equiv-append-1 (implies (nat-list-equiv x fty::x-equiv) (nat-list-equiv (append x y) (append fty::x-equiv y))) :rule-classes (:congruence))
Theorem:
(defthm nat-list-equiv-implies-nat-list-equiv-append-2 (implies (nat-list-equiv y fty::y-equiv) (nat-list-equiv (append x y) (append x fty::y-equiv))) :rule-classes (:congruence))
Theorem:
(defthm nat-list-equiv-implies-nat-list-equiv-nthcdr-2 (implies (nat-list-equiv l l-equiv) (nat-list-equiv (nthcdr n l) (nthcdr n l-equiv))) :rule-classes (:congruence))
Theorem:
(defthm nat-list-equiv-implies-nat-list-equiv-take-2 (implies (nat-list-equiv l l-equiv) (nat-list-equiv (take n l) (take n l-equiv))) :rule-classes (:congruence))