Fixtype of Java octal digits [JLS14:3.10.1].
A Java octal digit is a Java ASCII character between `0' and `7'.
See the grammar rule
This is a type introduced by fty::deffixtype.
Function:
(defun oct-digitp (x) (declare (xargs :guard t)) (let ((__function__ 'oct-digitp)) (declare (ignorable __function__)) (and (integerp x) (<= (char-code #\0) x) (<= x (char-code #\7)))))
Theorem:
(defthm booleanp-of-oct-digitp (b* ((yes/no (oct-digitp x))) (booleanp yes/no)) :rule-classes :rewrite)
Function:
(defun oct-digit-fix (x) (declare (xargs :guard (oct-digitp x))) (mbe :logic (if (oct-digitp x) x (char-code #\0)) :exec x))
Theorem:
(defthm oct-digitp-of-oct-digit-fix (b* ((fixed-x (oct-digit-fix x))) (oct-digitp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm oct-digit-fix-when-oct-digitp (implies (oct-digitp x) (equal (oct-digit-fix x) x)))
Function:
(defun oct-digit-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (oct-digitp acl2::x) (oct-digitp acl2::y)))) (equal (oct-digit-fix acl2::x) (oct-digit-fix acl2::y)))
Theorem:
(defthm oct-digit-equiv-is-an-equivalence (and (booleanp (oct-digit-equiv x y)) (oct-digit-equiv x x) (implies (oct-digit-equiv x y) (oct-digit-equiv y x)) (implies (and (oct-digit-equiv x y) (oct-digit-equiv y z)) (oct-digit-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm oct-digit-equiv-implies-equal-oct-digit-fix-1 (implies (oct-digit-equiv acl2::x x-equiv) (equal (oct-digit-fix acl2::x) (oct-digit-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm oct-digit-fix-under-oct-digit-equiv (oct-digit-equiv (oct-digit-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-oct-digit-fix-1-forward-to-oct-digit-equiv (implies (equal (oct-digit-fix acl2::x) acl2::y) (oct-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-oct-digit-fix-2-forward-to-oct-digit-equiv (implies (equal acl2::x (oct-digit-fix acl2::y)) (oct-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm oct-digit-equiv-of-oct-digit-fix-1-forward (implies (oct-digit-equiv (oct-digit-fix acl2::x) acl2::y) (oct-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm oct-digit-equiv-of-oct-digit-fix-2-forward (implies (oct-digit-equiv acl2::x (oct-digit-fix acl2::y)) (oct-digit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)