Fixtype of Java numeric values [JLS14:4.2], including extended-exponent values [JLS14:4.2.3].
Function:
(defun numericx-valuep (x) (declare (xargs :guard t)) (let ((__function__ 'numericx-valuep)) (declare (ignorable __function__)) (or (numeric-valuep x) (floatx-valuep x) (doublex-valuep x))))
Theorem:
(defthm booleanp-of-numericx-valuep (b* ((yes/no (numericx-valuep x))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm numericx-valuep-when-numeric-valuep (implies (numeric-valuep x) (numericx-valuep x)))
Theorem:
(defthm numericx-valuep-when-floatx-valuep (implies (floatx-valuep x) (numericx-valuep x)))
Theorem:
(defthm numericx-valuep-when-doublex-valuep (implies (doublex-valuep x) (numericx-valuep x)))
Function:
(defun numericx-value-fix (x) (declare (xargs :guard (numericx-valuep x))) (mbe :logic (if (numericx-valuep x) x (char-value 0)) :exec x))
Theorem:
(defthm numericx-valuep-of-numericx-value-fix (b* ((fixed-x (numericx-value-fix x))) (numericx-valuep fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm numericx-value-fix-when-numericx-valuep (implies (numericx-valuep x) (equal (numericx-value-fix x) x)))
Function:
(defun numericx-value-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (numericx-valuep acl2::x) (numericx-valuep acl2::y)))) (equal (numericx-value-fix acl2::x) (numericx-value-fix acl2::y)))
Theorem:
(defthm numericx-value-equiv-is-an-equivalence (and (booleanp (numericx-value-equiv x y)) (numericx-value-equiv x x) (implies (numericx-value-equiv x y) (numericx-value-equiv y x)) (implies (and (numericx-value-equiv x y) (numericx-value-equiv y z)) (numericx-value-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm numericx-value-equiv-implies-equal-numericx-value-fix-1 (implies (numericx-value-equiv acl2::x x-equiv) (equal (numericx-value-fix acl2::x) (numericx-value-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm numericx-value-fix-under-numericx-value-equiv (numericx-value-equiv (numericx-value-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-numericx-value-fix-1-forward-to-numericx-value-equiv (implies (equal (numericx-value-fix acl2::x) acl2::y) (numericx-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-numericx-value-fix-2-forward-to-numericx-value-equiv (implies (equal acl2::x (numericx-value-fix acl2::y)) (numericx-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm numericx-value-equiv-of-numericx-value-fix-1-forward (implies (numericx-value-equiv (numericx-value-fix acl2::x) acl2::y) (numericx-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm numericx-value-equiv-of-numericx-value-fix-2-forward (implies (numericx-value-equiv acl2::x (numericx-value-fix acl2::y)) (numericx-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)