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