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