Fixer for hex-digit.
(hex-digit-fix x) → fixed-x
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)))