Numeric value of a Java decimal digit.
(dec-digit-value x) → val
Function:
(defun dec-digit-value (x) (declare (xargs :guard (dec-digitp x))) (let ((__function__ 'dec-digit-value)) (declare (ignorable __function__)) (b* ((x (mbe :logic (dec-digit-fix x) :exec x))) (- x (char-code #\0)))))
Theorem:
(defthm natp-of-dec-digit-value (b* ((val (dec-digit-value x))) (natp val)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm dec-digit-value-upper-bound (b* ((?val (dec-digit-value x))) (<= val 9)) :rule-classes :linear)
Theorem:
(defthm dec-digit-value-of-dec-digit-fix-x (equal (dec-digit-value (dec-digit-fix x)) (dec-digit-value x)))
Theorem:
(defthm dec-digit-value-dec-digit-equiv-congruence-on-x (implies (dec-digit-equiv x x-equiv) (equal (dec-digit-value x) (dec-digit-value x-equiv))) :rule-classes :congruence)