• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
            • Validation
            • Gcc-builtins
            • Preprocessing
              • Preprocessor
                • Preprocessor-states
                  • Plexeme
                    • Plexeme-fix
                    • Plexemep
                      • Plexeme-case
                      • Plexeme-equiv
                      • Plexeme-kind
                      • Plexeme-string
                      • Plexeme-spaces
                      • Plexeme-punctuator
                      • Plexeme-other
                      • Plexeme-number
                      • Plexeme-newline
                      • Plexeme-line-comment
                      • Plexeme-ident
                      • Plexeme-header
                      • Plexeme-char
                      • Plexeme-block-comment
                      • Plexeme-vertical-tab
                      • Plexeme-horizontal-tab
                      • Plexeme-form-feed
                    • Ppstate
                    • Pnumber
                    • Macro-info
                    • Macro-add
                    • Init-ppstate
                    • Plexeme-token/newline-p
                    • Newline
                    • Plexeme-option
                    • Macro-info-option
                    • Macro-table
                    • Plexeme+span
                    • Update-ppstate->lexemes-unread
                    • Update-ppstate->lexemes-read
                    • Update-ppstate->lexemes-length
                    • Update-ppstate->chars-unread
                    • Update-ppstate->chars-read
                    • Update-ppstate->version
                    • Update-ppstate->position
                    • Update-ppstate->macros
                    • Update-ppstate->chars-length
                    • Macro-lookup
                    • Update-ppstate->bytes
                    • Update-ppstate->size
                    • Plexeme-token/space-p
                    • Plexeme-tokenp
                    • Ppstate->gcc
                    • Plexeme-list-token/space-p
                    • Ppstate->size
                    • Ppstate->lexemes-unread
                    • Ppstate->lexemes-read
                    • Ppstate->lexemes-length
                    • Ppstate->chars-unread
                    • Ppstate->bytes
                    • Plexeme-list-token/newline-p
                    • Plexeme-list-not-token/newline-p
                    • Ident-macroinfo-alist
                    • Update-ppstate->lexeme
                    • Update-ppstate->char
                    • Ppstate->version
                    • Ppstate->macros
                    • Ppstate->chars-read
                    • Ppstate->chars-length
                    • Plexeme-list-tokenp
                    • Plexeme-list-not-tokenp
                    • Macro-table-init
                    • Ppstate->lexeme
                    • Ppstate->char
                    • Ppstate-fix
                    • Plexeme+span-list
                    • Plexeme-list
                    • Irr-pnumber
                    • Irr-plexeme
                    • Irr-macro-table
                    • Ppstate->position
                  • Preprocessor-printer
                  • Pread-token/newline
                  • Pread-token
                  • Preprocessor-lexer
                  • Pproc-files
                  • Pproc-file
                  • Filepath-plexeme-list-alist-to-filepath-filedata-map
                  • Filepath-plexeme-list-alist
                  • Preprocessor-reader
                  • Preprocessor-messages
                • External-preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Plexeme

    Plexemep

    Recognizer for plexeme structures.

    Signature
    (plexemep x) → *

    Definitions and Theorems

    Function: plexemep

    (defun plexemep (x)
      (declare (xargs :guard t))
      (and (consp x)
           (cond ((or (atom x) (eq (car x) :header))
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((name (std::da-nth 0 (cdr x))))
                         (header-namep name))))
                 ((eq (car x) :ident)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((ident (std::da-nth 0 (cdr x))))
                         (identp ident))))
                 ((eq (car x) :number)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((number (std::da-nth 0 (cdr x))))
                         (pnumberp number))))
                 ((eq (car x) :char)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((const (std::da-nth 0 (cdr x))))
                         (cconstp const))))
                 ((eq (car x) :string)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((literal (std::da-nth 0 (cdr x))))
                         (stringlitp literal))))
                 ((eq (car x) :punctuator)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((punctuator (std::da-nth 0 (cdr x))))
                         (stringp punctuator))))
                 ((eq (car x) :other)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((char (std::da-nth 0 (cdr x))))
                         (natp char))))
                 ((eq (car x) :block-comment)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((content (std::da-nth 0 (cdr x))))
                         (nat-listp content))))
                 ((eq (car x) :line-comment)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((content (std::da-nth 0 (cdr x))))
                         (nat-listp content))))
                 ((eq (car x) :newline)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((chars (std::da-nth 0 (cdr x))))
                         (newlinep chars))))
                 ((eq (car x) :spaces)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 1)
                       (b* ((count (std::da-nth 0 (cdr x))))
                         (posp count))))
                 ((eq (car x) :horizontal-tab)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 ((eq (car x) :vertical-tab)
                  (and (true-listp (cdr x))
                       (eql (len (cdr x)) 0)
                       (b* nil t)))
                 (t (and (eq (car x) :form-feed)
                         (and (true-listp (cdr x))
                              (eql (len (cdr x)) 0))
                         (b* nil t))))))

    Theorem: consp-when-plexemep

    (defthm consp-when-plexemep
      (implies (plexemep x) (consp x))
      :rule-classes :compound-recognizer)