• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
        • Proof-support
        • Abstract-syntax
        • R1cs-subset
        • Semantics
        • Abstract-syntax-operations
        • Indexed-names
        • Well-formedness
        • 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-integer
            • Lex-carriage-return
            • Lex-line-feed
            • Lex-space
            • Lex-optional-hyphen
            • 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
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Lexer

    Lexemize-pfcs

    Lexes the Unicode codepoints pfcs-codepoints into lexemes.

    Signature
    (lexemize-pfcs pfcs-codepoints) → pfcs-lexemes
    Arguments
    pfcs-codepoints — Guard (nat-listp pfcs-codepoints).
    Returns
    pfcs-lexemes — Type (abnf::tree-list-resultp pfcs-lexemes).

    A lexeme is a token or whitespace. lexemize-pfcs returns two values: an error flag and a list of these lexemes in abnf::tree form.

    If the input cannot be fully lexed, a reserrp is returned.

    Definitions and Theorems

    Function: lexemize-pfcs

    (defun lexemize-pfcs (pfcs-codepoints)
     (declare (xargs :guard (nat-listp pfcs-codepoints)))
     (let ((__function__ 'lexemize-pfcs))
      (declare (ignorable __function__))
      (b* (((mv trees rest-input)
            (lex-*-lexeme pfcs-codepoints))
           ((when (reserrp trees))
            (reserrf (cons :unexpected-reserrp trees)))
           ((unless (null rest-input))
            (reserrf (cons :cannot-fully-lex (cons trees rest-input)))))
        trees)))

    Theorem: tree-list-resultp-of-lexemize-pfcs

    (defthm tree-list-resultp-of-lexemize-pfcs
      (b* ((pfcs-lexemes (lexemize-pfcs pfcs-codepoints)))
        (abnf::tree-list-resultp pfcs-lexemes))
      :rule-classes :rewrite)