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