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