Check if an optional token is a type specifier that consists of a single keyword.
(token-type-specifier-keyword-p token?) → yes/no
There are a number of type specifiers that consist of single keywords.
Function:
(defun token-type-specifier-keyword-p (token?) (declare (xargs :guard (token-optionp token?))) (let ((__function__ 'token-type-specifier-keyword-p)) (declare (ignorable __function__)) (or (token-keywordp token? "void") (token-keywordp token? "char") (token-keywordp token? "short") (token-keywordp token? "int") (token-keywordp token? "long") (token-keywordp token? "float") (token-keywordp token? "double") (token-keywordp token? "signed") (token-keywordp token? "unsigned") (token-keywordp token? "_Bool") (token-keywordp token? "_Complex"))))
Theorem:
(defthm booleanp-of-token-type-specifier-keyword-p (b* ((yes/no (token-type-specifier-keyword-p token?))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm non-nil-when-token-type-specifier-keyword-p (implies (token-type-specifier-keyword-p token?) token?) :rule-classes :compound-recognizer)