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