Fixtype of ASCII characters.
The ASCII characters are the first 128 Unicode characters.
Since we model Java Unicode characters as unsigned 16-bit integers, we model ASCII characters as unsigned 7-bit integers.
Function:
(defun ascii-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (asciip acl2::x) (asciip acl2::y)))) (equal (ascii-fix acl2::x) (ascii-fix acl2::y)))
Theorem:
(defthm ascii-equiv-is-an-equivalence (and (booleanp (ascii-equiv x y)) (ascii-equiv x x) (implies (ascii-equiv x y) (ascii-equiv y x)) (implies (and (ascii-equiv x y) (ascii-equiv y z)) (ascii-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm ascii-equiv-implies-equal-ascii-fix-1 (implies (ascii-equiv acl2::x x-equiv) (equal (ascii-fix acl2::x) (ascii-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm ascii-fix-under-ascii-equiv (ascii-equiv (ascii-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-ascii-fix-1-forward-to-ascii-equiv (implies (equal (ascii-fix acl2::x) acl2::y) (ascii-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-ascii-fix-2-forward-to-ascii-equiv (implies (equal acl2::x (ascii-fix acl2::y)) (ascii-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm ascii-equiv-of-ascii-fix-1-forward (implies (ascii-equiv (ascii-fix acl2::x) acl2::y) (ascii-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm ascii-equiv-of-ascii-fix-2-forward (implies (ascii-equiv acl2::x (ascii-fix acl2::y)) (ascii-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm unicodep-when-asciip (implies (asciip x) (unicodep x)))