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