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