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