Fixtype of Java type identifiers.
The grammar rule for
Accordingly, we model Java type identifiers as regular identifiers
(the kinds used in most contexts, not in module-related contexts)
that differ from the Unicode sequences for
Function:
(defun tidentifierp (x) (declare (xargs :guard t)) (let ((__function__ 'tidentifierp)) (declare (ignorable __function__)) (and (identifierp x) (not (equal x (string=>unicode "var"))) (not (equal x (string=>unicode "yield"))))))
Theorem:
(defthm booleanp-of-tidentifierp (b* ((yes/no (tidentifierp x))) (booleanp yes/no)) :rule-classes :rewrite)
Function:
(defun tidentifier-fix (x) (declare (xargs :guard (tidentifierp x))) (mbe :logic (if (tidentifierp x) x (list (char-code #\$))) :exec x))
Theorem:
(defthm tidentifierp-of-tidentifier-fix (b* ((fixed-x (tidentifier-fix x))) (tidentifierp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm tidentifier-fix-when-tidentifierp (implies (tidentifierp x) (equal (tidentifier-fix x) x)))
Function:
(defun tidentifier-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (tidentifierp acl2::x) (tidentifierp acl2::y)))) (equal (tidentifier-fix acl2::x) (tidentifier-fix acl2::y)))
Theorem:
(defthm tidentifier-equiv-is-an-equivalence (and (booleanp (tidentifier-equiv x y)) (tidentifier-equiv x x) (implies (tidentifier-equiv x y) (tidentifier-equiv y x)) (implies (and (tidentifier-equiv x y) (tidentifier-equiv y z)) (tidentifier-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm tidentifier-equiv-implies-equal-tidentifier-fix-1 (implies (tidentifier-equiv acl2::x x-equiv) (equal (tidentifier-fix acl2::x) (tidentifier-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm tidentifier-fix-under-tidentifier-equiv (tidentifier-equiv (tidentifier-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-tidentifier-fix-1-forward-to-tidentifier-equiv (implies (equal (tidentifier-fix acl2::x) acl2::y) (tidentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-tidentifier-fix-2-forward-to-tidentifier-equiv (implies (equal acl2::x (tidentifier-fix acl2::y)) (tidentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tidentifier-equiv-of-tidentifier-fix-1-forward (implies (tidentifier-equiv (tidentifier-fix acl2::x) acl2::y) (tidentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tidentifier-equiv-of-tidentifier-fix-2-forward (implies (tidentifier-equiv acl2::x (tidentifier-fix acl2::y)) (tidentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)