Fixing function for numeric-value structures.
(numeric-value-fix acl2::x) → new-x
Function:
(defun numeric-value-fix$inline (acl2::x) (declare (xargs :guard (numeric-valuep acl2::x))) (let ((__function__ 'numeric-value-fix)) (declare (ignorable __function__)) (mbe :logic (case (numeric-value-kind acl2::x) (:char (b* ((get (char-value-fix acl2::x))) get)) (:byte (b* ((get (byte-value-fix acl2::x))) get)) (:short (b* ((get (short-value-fix acl2::x))) get)) (:int (b* ((get (int-value-fix acl2::x))) get)) (:long (b* ((get (long-value-fix acl2::x))) get)) (:float (b* ((get (float-value-fix acl2::x))) get)) (:double (b* ((get (double-value-fix acl2::x))) get))) :exec acl2::x)))
Theorem:
(defthm numeric-valuep-of-numeric-value-fix (b* ((new-x (numeric-value-fix$inline acl2::x))) (numeric-valuep new-x)) :rule-classes :rewrite)
Theorem:
(defthm numeric-value-fix-when-numeric-valuep (implies (numeric-valuep acl2::x) (equal (numeric-value-fix acl2::x) acl2::x)))
Function:
(defun numeric-value-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (numeric-valuep acl2::x) (numeric-valuep acl2::y)))) (equal (numeric-value-fix acl2::x) (numeric-value-fix acl2::y)))
Theorem:
(defthm numeric-value-equiv-is-an-equivalence (and (booleanp (numeric-value-equiv x y)) (numeric-value-equiv x x) (implies (numeric-value-equiv x y) (numeric-value-equiv y x)) (implies (and (numeric-value-equiv x y) (numeric-value-equiv y z)) (numeric-value-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm numeric-value-equiv-implies-equal-numeric-value-fix-1 (implies (numeric-value-equiv acl2::x x-equiv) (equal (numeric-value-fix acl2::x) (numeric-value-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm numeric-value-fix-under-numeric-value-equiv (numeric-value-equiv (numeric-value-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-numeric-value-fix-1-forward-to-numeric-value-equiv (implies (equal (numeric-value-fix acl2::x) acl2::y) (numeric-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-numeric-value-fix-2-forward-to-numeric-value-equiv (implies (equal acl2::x (numeric-value-fix acl2::y)) (numeric-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm numeric-value-equiv-of-numeric-value-fix-1-forward (implies (numeric-value-equiv (numeric-value-fix acl2::x) acl2::y) (numeric-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm numeric-value-equiv-of-numeric-value-fix-2-forward (implies (numeric-value-equiv acl2::x (numeric-value-fix acl2::y)) (numeric-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm numeric-value-kind$inline-of-numeric-value-fix-x (equal (numeric-value-kind$inline (numeric-value-fix acl2::x)) (numeric-value-kind$inline acl2::x)))
Theorem:
(defthm numeric-value-kind$inline-numeric-value-equiv-congruence-on-x (implies (numeric-value-equiv acl2::x x-equiv) (equal (numeric-value-kind$inline acl2::x) (numeric-value-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-numeric-value-fix (consp (numeric-value-fix acl2::x)) :rule-classes :type-prescription)