• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
            • Lex-strings
            • Lex-identifiers
            • Vl-typo-uppercase-p
            • Vl-typo-number-p
            • Vl-typo-lowercase-p
            • Lex-numbers
            • Chartypes
            • Vl-lex
            • Defchar
            • Tokens
              • Vl-inttoken-p
              • Vl-plaintoken-p
              • Vl-token->etext
              • Vl-token->type
              • Vl-token-p
                • Vl-idtoken-p
                • Vl-timetoken-p
                • Vl-stringtoken-p
                • Vl-kill-whitespace-and-comments
                • Vl-tokenlist->etext
                • Vl-extinttoken-p
                • Vl-sysidtoken-p
                • Vl-realtoken-p
                • Vl-tokenlist-p
                • Vl-tokenlist->string-with-spaces
                • Vl-idtoken-list-p
                • Vl-token->loc
                • Vl-plaintokentypelist-p
                • Vl-tokenlistlist-p
                • Vl-token->string
              • Lex-keywords
              • Lexstate
              • Make-test-tokens
              • Lexer-utils
              • Lex-comments
              • Vl-typo-uppercase-list-p
              • Vl-typo-lowercase-list-p
              • Vl-typo-number-list-p
            • Vl-loadstate
            • Parser
            • Vl-load-merge-descriptions
            • Scope-of-defines
            • Vl-load-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-loadresult
            • Vl-read-file
            • Vl-find-basename/extension
            • Vl-find-file
            • Vl-read-files
            • Extended-characters
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Tokens

    Vl-token-p

    Token structure produced by our lexer.

    Signature
    (vl-token-p x) → *

    vl-token-p is a sum-of-products style recognizer. Every token is one of the following:

    • vl-plaintoken-p
    • vl-inttoken-p
    • vl-idtoken-p
    • vl-sysidtoken-p
    • vl-stringtoken-p
    • vl-realtoken-p
    • vl-timetoken-p
    • vl-extinttoken-p

    Our lexer produces a token list for our parser to consume. Any token can be inspected with the following operations:

    • vl-token->type, get the token's type
    • vl-token->etext, get the token's actual text
    • vl-token->loc, get the location of the token's first character

    Definitions and Theorems

    Function: vl-token-p

    (defun vl-token-p (x)
      (declare (xargs :guard t))
      (let ((__function__ 'vl-token-p))
        (declare (ignorable __function__))
        (mbe :logic (or (vl-idtoken-p x)
                        (vl-inttoken-p x)
                        (vl-sysidtoken-p x)
                        (vl-stringtoken-p x)
                        (vl-realtoken-p x)
                        (vl-timetoken-p x)
                        (vl-extinttoken-p x)
                        (vl-plaintoken-p x))
             :exec (case (tag x)
                         (:vl-idtoken (vl-idtoken-p x))
                         (:vl-inttoken (vl-inttoken-p x))
                         (:vl-sysidtoken (vl-sysidtoken-p x))
                         (:vl-stringtoken (vl-stringtoken-p x))
                         (:vl-realtoken (vl-realtoken-p x))
                         (:vl-timetoken (vl-timetoken-p x))
                         (:vl-extinttoken (vl-extinttoken-p x))
                         (otherwise (vl-plaintoken-p x))))))

    Theorem: vl-token-p-when-vl-plaintoken-p

    (defthm vl-token-p-when-vl-plaintoken-p
      (implies (vl-plaintoken-p x)
               (vl-token-p x)))

    Theorem: vl-token-p-when-vl-stringtoken-p

    (defthm vl-token-p-when-vl-stringtoken-p
      (implies (vl-stringtoken-p x)
               (vl-token-p x)))

    Theorem: vl-token-p-when-vl-idtoken-p

    (defthm vl-token-p-when-vl-idtoken-p
      (implies (vl-idtoken-p x)
               (vl-token-p x)))

    Theorem: vl-token-p-when-vl-sysidtoken-p

    (defthm vl-token-p-when-vl-sysidtoken-p
      (implies (vl-sysidtoken-p x)
               (vl-token-p x)))

    Theorem: vl-token-p-when-vl-inttoken-p

    (defthm vl-token-p-when-vl-inttoken-p
      (implies (vl-inttoken-p x)
               (vl-token-p x)))

    Theorem: vl-token-p-when-vl-realtoken-p

    (defthm vl-token-p-when-vl-realtoken-p
      (implies (vl-realtoken-p x)
               (vl-token-p x)))

    Theorem: vl-token-p-when-vl-timetoken-p

    (defthm vl-token-p-when-vl-timetoken-p
      (implies (vl-timetoken-p x)
               (vl-token-p x)))

    Theorem: vl-token-p-when-vl-extinttoken-p

    (defthm vl-token-p-when-vl-extinttoken-p
      (implies (vl-extinttoken-p x)
               (vl-token-p x)))