Check if a preprocessing lexeme is a token.
This is according to the grammar rule for preprocessing-token [C17:6.4] [C17:A.1.1].
Function:
(defun plexeme-tokenp (lexeme) (declare (xargs :guard (plexemep lexeme))) (and (member-eq (plexeme-kind lexeme) '(:header :ident :number :char :string :punctuator :other)) t))
Theorem:
(defthm booleanp-of-plexeme-tokenp (b* ((yes/no (plexeme-tokenp lexeme))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm plexeme-tokenp-alt-def (equal (plexeme-tokenp lexeme) (not (member-eq (plexeme-kind lexeme) '(:block-comment :line-comment :newline :spaces :horizontal-tab :vertical-tab :form-feed)))))
Theorem:
(defthm plexeme-tokenp-of-plexeme-fix-lexeme (equal (plexeme-tokenp (plexeme-fix lexeme)) (plexeme-tokenp lexeme)))
Theorem:
(defthm plexeme-tokenp-plexeme-equiv-congruence-on-lexeme (implies (plexeme-equiv lexeme lexeme-equiv) (equal (plexeme-tokenp lexeme) (plexeme-tokenp lexeme-equiv))) :rule-classes :congruence)