Coerces a dec-digit-char-p character into a number.
(dec-digit-char-value x) → val
For instance,
Function:
(defun dec-digit-char-value$inline (x) (declare (type character x)) (declare (xargs :guard (dec-digit-char-p x))) (declare (xargs :split-types t)) (let ((acl2::__function__ 'dec-digit-char-value)) (declare (ignorable acl2::__function__)) (mbe :logic (if (dec-digit-char-p x) (- (char-code (char-fix x)) (char-code #\0)) 0) :exec (the (unsigned-byte 8) (- (the (unsigned-byte 8) (char-code (the character x))) (the (unsigned-byte 8) 48))))))
Theorem:
(defthm natp-of-dec-digit-char-value (b* ((val (dec-digit-char-value$inline x))) (natp val)) :rule-classes :type-prescription)
Theorem:
(defthm ichareqv-implies-equal-dec-digit-char-value-1 (implies (ichareqv x x-equiv) (equal (dec-digit-char-value x) (dec-digit-char-value x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm dec-digit-char-value-upper-bound (< (dec-digit-char-value x) 10) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm equal-of-dec-digit-char-value-and-dec-digit-char-value (implies (and (dec-digit-char-p x) (dec-digit-char-p y)) (equal (equal (dec-digit-char-value x) (dec-digit-char-value y)) (equal x y))))
Theorem:
(defthm dec-digit-char-value-of-digit-to-char (implies (and (natp n) (< n 10)) (equal (dec-digit-char-value (digit-to-char n)) n)))