• 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

    Lexemize-pfcs-from-string

    Lexes the UTF-8 pfcs-string into a list of lexemes.

    Signature
    (lexemize-pfcs-from-string pfcs-string) → pfcs-lexemes
    Arguments
    pfcs-string — Guard (stringp pfcs-string).
    Returns
    pfcs-lexemes — Type (abnf::tree-list-resultp pfcs-lexemes).

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

    Since ACL2 strings are sequences of characters with codes from 0 to 255, pfcs-string, when converted to codes, is required to be valid UTF-8.

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

    Definitions and Theorems

    Function: lexemize-pfcs-from-string

    (defun lexemize-pfcs-from-string (pfcs-string)
      (declare (xargs :guard (stringp pfcs-string)))
      (let ((__function__ 'lexemize-pfcs-from-string))
        (declare (ignorable __function__))
        (b* (((unless (stringp pfcs-string))
              (reserrf (cons :not-a-string pfcs-string)))
             (octets (string=>nats pfcs-string)))
          (lexemize-pfcs-from-bytes octets))))

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

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