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