Recognizer for non-zero hexadecimal digit characters: 1-9, A-F, a-f.
(nonzero-hex-digit-char-p x) → bool
Function:
(defun nonzero-hex-digit-char-p$inline (x) (declare (xargs :guard t)) (let ((acl2::__function__ 'nonzero-hex-digit-char-p)) (declare (ignorable acl2::__function__)) (mbe :logic (let ((code (char-code (char-fix x)))) (or (and (<= (char-code #\1) code) (<= code (char-code #\9))) (and (<= (char-code #\a) code) (<= code (char-code #\f))) (and (<= (char-code #\A) code) (<= code (char-code #\F))))) :exec (and (characterp x) (b* (((the (unsigned-byte 8) code) (char-code (the character x)))) (if (<= code 70) (if (<= code 57) (<= 49 code) (<= 65 code)) (and (<= code 102) (<= 97 code))))))))
Theorem:
(defthm ichareqv-implies-equal-nonzero-hex-digit-char-p-1 (implies (ichareqv x x-equiv) (equal (nonzero-hex-digit-char-p x) (nonzero-hex-digit-char-p x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm hex-digit-char-p-when-nonzero-hex-digit-char-p (implies (nonzero-hex-digit-char-p x) (hex-digit-char-p x)))