Fixtype of Java hexadecimal digits [JLS14:3.10.1].
A Java hexadecimal digit is a Java ASCII character that is
either a decimal digit (i.e. between `0' and `9')
or an (uppercase or lowercase) letter
between `A' and `F' or between `a' and `f'.
See the grammar rule
This is a type introduced by fty::deffixtype.
Function:
(defun hex-digitp (x) (declare (xargs :guard t)) (let ((__function__ 'hex-digitp)) (declare (ignorable __function__)) (and (integerp x) (or (and (<= (char-code #\0) x) (<= x (char-code #\9))) (and (<= (char-code #\A) x) (<= x (char-code #\F))) (and (<= (char-code #\a) x) (<= x (char-code #\f)))))))
Theorem:
(defthm booleanp-of-hex-digitp (b* ((yes/no (hex-digitp x))) (booleanp yes/no)) :rule-classes :rewrite)
Function:
(defun hex-digit-fix (x) (declare (xargs :guard (hex-digitp x))) (mbe :logic (if (hex-digitp x) x (char-code #\0)) :exec x))
Theorem:
(defthm hex-digitp-of-hex-digit-fix (b* ((fixed-x (hex-digit-fix x))) (hex-digitp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm hex-digit-fix-when-hex-digitp (implies (hex-digitp x) (equal (hex-digit-fix x) x)))
Function:
(defun hex-digit-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (hex-digitp acl2::x) (hex-digitp acl2::y)))) (equal (hex-digit-fix acl2::x) (hex-digit-fix acl2::y)))
Theorem:
(defthm hex-digit-equiv-is-an-equivalence (and (booleanp (hex-digit-equiv x y)) (hex-digit-equiv x x) (implies (hex-digit-equiv x y) (hex-digit-equiv y x)) (implies (and (hex-digit-equiv x y) (hex-digit-equiv y z)) (hex-digit-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm hex-digit-equiv-implies-equal-hex-digit-fix-1 (implies (hex-digit-equiv acl2::x x-equiv) (equal (hex-digit-fix acl2::x) (hex-digit-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm hex-digit-fix-under-hex-digit-equiv (hex-digit-equiv (hex-digit-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-hex-digit-fix-1-forward-to-hex-digit-equiv (implies (equal (hex-digit-fix acl2::x) acl2::y) (hex-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-hex-digit-fix-2-forward-to-hex-digit-equiv (implies (equal acl2::x (hex-digit-fix acl2::y)) (hex-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm hex-digit-equiv-of-hex-digit-fix-1-forward (implies (hex-digit-equiv (hex-digit-fix acl2::x) acl2::y) (hex-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm hex-digit-equiv-of-hex-digit-fix-2-forward (implies (hex-digit-equiv acl2::x (hex-digit-fix acl2::y)) (hex-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)