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