Fixing function for uchar-array structures.
(uchar-array-fix x) → new-x
Function:
(defun uchar-array-fix$inline (x) (declare (xargs :guard (uchar-arrayp x))) (let ((__function__ 'uchar-array-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((elemtype (type-fix (std::da-nth 0 (cdr x)))) (elements (uchar-list-fix (std::da-nth 1 (cdr x))))) (let ((elemtype (if (type-case elemtype :uchar) elemtype (type-uchar))) (elements (if (consp elements) elements (list (uchar-from-integer 0))))) (cons :array (list elemtype elements)))) :exec x)))
Theorem:
(defthm uchar-arrayp-of-uchar-array-fix (b* ((new-x (uchar-array-fix$inline x))) (uchar-arrayp new-x)) :rule-classes :rewrite)
Theorem:
(defthm uchar-array-fix-when-uchar-arrayp (implies (uchar-arrayp x) (equal (uchar-array-fix x) x)))
Function:
(defun uchar-array-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (uchar-arrayp acl2::x) (uchar-arrayp acl2::y)))) (equal (uchar-array-fix acl2::x) (uchar-array-fix acl2::y)))
Theorem:
(defthm uchar-array-equiv-is-an-equivalence (and (booleanp (uchar-array-equiv x y)) (uchar-array-equiv x x) (implies (uchar-array-equiv x y) (uchar-array-equiv y x)) (implies (and (uchar-array-equiv x y) (uchar-array-equiv y z)) (uchar-array-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm uchar-array-equiv-implies-equal-uchar-array-fix-1 (implies (uchar-array-equiv acl2::x x-equiv) (equal (uchar-array-fix acl2::x) (uchar-array-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm uchar-array-fix-under-uchar-array-equiv (uchar-array-equiv (uchar-array-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-uchar-array-fix-1-forward-to-uchar-array-equiv (implies (equal (uchar-array-fix acl2::x) acl2::y) (uchar-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-uchar-array-fix-2-forward-to-uchar-array-equiv (implies (equal acl2::x (uchar-array-fix acl2::y)) (uchar-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm uchar-array-equiv-of-uchar-array-fix-1-forward (implies (uchar-array-equiv (uchar-array-fix acl2::x) acl2::y) (uchar-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm uchar-array-equiv-of-uchar-array-fix-2-forward (implies (uchar-array-equiv acl2::x (uchar-array-fix acl2::y)) (uchar-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)