• 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
          • Grammar
          • Parser
          • Tokenizer
            • Tokenize-pfcs
            • Filter-and-reduce-lexeme-tree-to-subtoken-trees
            • Check-and-deref-tree-token?
            • Check-and-deref-tree-lexeme?
            • Tokenize-pfcs-bytes
              • Is-tree-rulename?
          • 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
    • Tokenizer

    Tokenize-pfcs-bytes

    Lexes the bytes of a pfcs system into a list of tokens.

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

    This does the same thing as tokenize-pfcs, but does not need to convert the string to bytes first.

    Definitions and Theorems

    Function: tokenize-pfcs-bytes

    (defun tokenize-pfcs-bytes (pfcs-bytes)
      (declare (xargs :guard (nat-listp pfcs-bytes)))
      (let ((__function__ 'tokenize-pfcs-bytes))
        (declare (ignorable __function__))
        (b* ((lexeme-trees-result (lexemize-pfcs-from-bytes pfcs-bytes))
             ((when (reserrp lexeme-trees-result))
              (reserrf "problem lexing pfcs-bytes"))
             (subtoken-trees (filter-and-reduce-lexeme-tree-to-subtoken-trees
                                  lexeme-trees-result))
             ((when (reserrp subtoken-trees))
              (reserrf "problem with structure of lexeme tree")))
          subtoken-trees)))

    Theorem: tree-list-resultp-of-tokenize-pfcs-bytes

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