Fixtype of Java identifiers, for module-related contexts.
These are Java identifiers that exclude all the keywords
(non-restricted and restricted, with one exception discussed below),
as discussed in the topic on identifiers. Since these are used in module-related contexts,
we prepend the name of this recognizer with
We model these Java identifiers as regular Java identifiers (the kinds used in most contexts) that differ from all non-restricted and restricted keywords, with one exception discussed below. Note that this notion of identifiers for module-related contexts is not explicit in the grammar in [JLS14].
The exception mentioned above is that
we allow
Function:
(defun midentifierp (x) (declare (xargs :guard t)) (let ((__function__ 'midentifierp)) (declare (ignorable __function__)) (and (identifierp x) (or (not (restricted-jkeywordp x)) (equal x (string=>unicode "transitive"))))))
Theorem:
(defthm booleanp-of-midentifierp (b* ((yes/no (midentifierp x))) (booleanp yes/no)) :rule-classes :rewrite)
Function:
(defun midentifier-fix (x) (declare (xargs :guard (midentifierp x))) (mbe :logic (if (midentifierp x) x (list (char-code #\$))) :exec x))
Theorem:
(defthm midentifierp-of-midentifier-fix (b* ((fixed-x (midentifier-fix x))) (midentifierp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm midentifier-fix-when-midentifierp (implies (midentifierp x) (equal (midentifier-fix x) x)))
Function:
(defun midentifier-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (midentifierp acl2::x) (midentifierp acl2::y)))) (equal (midentifier-fix acl2::x) (midentifier-fix acl2::y)))
Theorem:
(defthm midentifier-equiv-is-an-equivalence (and (booleanp (midentifier-equiv x y)) (midentifier-equiv x x) (implies (midentifier-equiv x y) (midentifier-equiv y x)) (implies (and (midentifier-equiv x y) (midentifier-equiv y z)) (midentifier-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm midentifier-equiv-implies-equal-midentifier-fix-1 (implies (midentifier-equiv acl2::x x-equiv) (equal (midentifier-fix acl2::x) (midentifier-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm midentifier-fix-under-midentifier-equiv (midentifier-equiv (midentifier-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-midentifier-fix-1-forward-to-midentifier-equiv (implies (equal (midentifier-fix acl2::x) acl2::y) (midentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-midentifier-fix-2-forward-to-midentifier-equiv (implies (equal acl2::x (midentifier-fix acl2::y)) (midentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm midentifier-equiv-of-midentifier-fix-1-forward (implies (midentifier-equiv (midentifier-fix acl2::x) acl2::y) (midentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm midentifier-equiv-of-midentifier-fix-2-forward (implies (midentifier-equiv acl2::x (midentifier-fix acl2::y)) (midentifier-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)