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