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