• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Oslib
      • Std/io
      • Bridge
      • Clex
        • Example-lexer
          • Token-p
          • Lex-punctuation
          • Lex-id/keyword
          • Lex-string
          • Lex-comment
          • Lex-whitespace
          • Lex1
          • Lex-main
          • Lex*
          • Tokenlist-p
          • Idtail-char-p
          • Letter-char-p
          • Whitespace-char-p
          • Number-char-p
          • Tokentype-p
            • Lex*-exec
            • Newline-string
          • Sin
          • Matching-functions
          • Def-sin-progress
        • Tshell
        • Unsound-eval
        • Hacker
        • Startup-banner
        • Command-line
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Example-lexer

    Tokentype-p

    Valid types for tokens.

    This is an ordinary defenum.

    Function: tokentype-p

    (defun tokentype-p (x)
           (declare (xargs :guard t))
           (or (eq x ':keyword)
               (eq x ':whitespace)
               (eq x ':id)
               (eq x ':punctuation)
               (eq x ':comment)))

    Theorem: type-when-tokentype-p

    (defthm type-when-tokentype-p
            (implies (tokentype-p x)
                     (if (symbolp x)
                         (if (not (equal x 't))
                             (not (equal x 'nil))
                             'nil)
                         'nil))
            :rule-classes :compound-recognizer)