Check if an ACL2 string is a portable ASCII identifier.
For now we only check distinctness with the C17 keywords, but we plan to generalize that to other C versions.
Function:
(defun paident-stringp (str) (declare (xargs :guard (stringp str))) (and (paident-char-listp (acl2::explode str)) (not (member-equal (str-fix str) *keywords-c17*))))
Theorem:
(defthm booleanp-of-paident-stringp (b* ((yes/no (paident-stringp str))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm paident-stringp-of-str-fix-str (equal (paident-stringp (str-fix str)) (paident-stringp str)))
Theorem:
(defthm paident-stringp-streqv-congruence-on-str (implies (acl2::streqv str str-equiv) (equal (paident-stringp str) (paident-stringp str-equiv))) :rule-classes :congruence)