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