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