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