Check if an ASCII character can be non-starting part of identifiers.
[JLS14:3.8] introduces the notion of `Java letter or digit'
as a character that can be used in an identifier, not at the start.
[JLS14:3.8] defines this notion in terms of
the API method
Running OpenJDK 14's
implementation of
Function:
(defun ascii-identifier-part-p (char) (declare (xargs :guard (asciip char))) (let ((__function__ 'ascii-identifier-part-p)) (declare (ignorable __function__)) (b* ((char (mbe :logic (ascii-fix char) :exec char))) (or (and (<= 0 char) (<= char 8)) (and (<= 14 char) (<= char 27)) (= char (char-code #\$)) (and (<= (char-code #\A) char) (<= char (char-code #\Z))) (= char (char-code #\_)) (and (<= (char-code #\a) char) (<= char (char-code #\z))) (and (<= (char-code #\0) char) (<= char (char-code #\9))) (= char 127)))))
Theorem:
(defthm booleanp-of-ascii-identifier-part-p (b* ((yes/no (ascii-identifier-part-p char))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm ascii-identifier-part-p-of-ascii-fix-char (equal (ascii-identifier-part-p (ascii-fix char)) (ascii-identifier-part-p char)))
Theorem:
(defthm ascii-identifier-part-p-ascii-equiv-congruence-on-char (implies (ascii-equiv char char-equiv) (equal (ascii-identifier-part-p char) (ascii-identifier-part-p char-equiv))) :rule-classes :congruence)