• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
        • Proof-support
        • Semantics
        • Lifting
        • R1cs-subset
        • Indexed-names
        • Well-formedness
        • Abstract-syntax
        • Concrete-syntax
          • Lexer
            • Lex-separator
            • Lex-operator
            • Lex-group-letter/digit/_
            • Lex-token
            • Lex-whitespace
            • Lex-line-terminator
            • Lex-identifier
            • Lex-lexeme
            • Lex-letter
            • Lex-uppercase-letter
            • Lex-lowercase-letter
            • Lex-carriage-return
            • Lex-line-feed
            • Lex-space
            • Lex-optional-cr
            • Lex-numeral
            • Lex-digit
            • Lex-*-rest-of-identifier
            • Lex-1*-digit
            • Lexemize-pfcs-from-string
            • Lex-*-lexeme
              • Lex-*-digit
              • Lexemize-pfcs-from-bytes
              • Lexemize-pfcs
              • *defparse-pfcs-repetition-table*
              • *defparse-pfcs-option-table*
              • Lex-generation-macros
              • *defparse-pfcs-group-table*
              • Lex-generation-tables
            • Grammar
            • Parser
            • Tokenizer
          • R1cs-bridge
          • Parser-interface
        • Wp-gen
        • Dimacs-reader
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Riscv
        • Bitcoin
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Lexer

    Lex-*-lexeme

    Parse a *lexeme.

    Signature
    (lex-*-lexeme abnf::input) → (mv abnf::trees abnf::rest-input)
    Arguments
    abnf::input — Guard (nat-listp abnf::input).
    Returns
    abnf::trees — Type (abnf::tree-listp abnf::trees).
    abnf::rest-input — Type (nat-listp abnf::rest-input).

    Definitions and Theorems

    Function: lex-*-lexeme

    (defun lex-*-lexeme (abnf::input)
      (declare (xargs :guard (nat-listp abnf::input)))
      (let ((__function__ 'lex-*-lexeme))
        (declare (ignorable __function__))
        (b* (((mv abnf::tree abnf::input)
              (lex-lexeme abnf::input))
             ((when (reserrp abnf::tree))
              (mv nil abnf::input))
             ((mv abnf::trees abnf::input)
              (lex-*-lexeme abnf::input)))
          (mv (cons abnf::tree abnf::trees)
              abnf::input))))

    Theorem: tree-listp-of-lex-*-lexeme.trees

    (defthm tree-listp-of-lex-*-lexeme.trees
      (b* (((mv abnf::?trees abnf::?rest-input)
            (lex-*-lexeme abnf::input)))
        (abnf::tree-listp abnf::trees))
      :rule-classes :rewrite)

    Theorem: nat-listp-of-lex-*-lexeme.rest-input

    (defthm nat-listp-of-lex-*-lexeme.rest-input
      (b* (((mv abnf::?trees abnf::?rest-input)
            (lex-*-lexeme abnf::input)))
        (nat-listp abnf::rest-input))
      :rule-classes :rewrite)

    Theorem: len-of-lex-*-lexeme

    (defthm len-of-lex-*-lexeme
      (b* (((mv abnf::?trees abnf::?rest-input)
            (lex-*-lexeme abnf::input)))
        (<= (len abnf::rest-input)
            (len abnf::input)))
      :rule-classes :linear)

    Theorem: lex-*-lexeme-of-nat-list-fix-input

    (defthm lex-*-lexeme-of-nat-list-fix-input
      (equal (lex-*-lexeme (nat-list-fix abnf::input))
             (lex-*-lexeme abnf::input)))

    Theorem: lex-*-lexeme-nat-list-equiv-congruence-on-input

    (defthm lex-*-lexeme-nat-list-equiv-congruence-on-input
      (implies (acl2::nat-list-equiv abnf::input input-equiv)
               (equal (lex-*-lexeme abnf::input)
                      (lex-*-lexeme input-equiv)))
      :rule-classes :congruence)