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