• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
            • Grammar
            • Unicode-escapes
              • Uniescape-parse-constraints-p
              • Even-backslashes-tree-constraints-p
              • Len-of-string-of-prefix-of-unicode-input-character-trees
              • Uniescape-parse
                • Nonzero-uletters-after-p
                • Abs-unicode-escape
                • Even-backslashes-before-p
                • Uniescape-tree-constraints-p
                • Uniescape-process
                • Uniescape-candidate-valid-p
                • Uniescape-candidate-p
                • Abs-raw-input-character
                • Abs-hex-digit
                • Abs-unicode-input-character
                • Some-uniescape-candidate-invalid-p
                • Uniescapep
                • Abs-unicode-input-character-list
                • Uniescape-parse-p
                • Eligible-backslash-p
                • Unicode-input-character-tree-is-escape-p
              • Unicode-input-char
              • Escape-sequence
              • Identifiers
              • Primitive-types
              • Reference-types
              • Keywords
              • Unicode-characters
              • Integer-literals
              • String-literals
              • Octal-digits
              • Hexadecimal-digits
              • Decimal-digits
              • Binary-digits
              • Character-literals
              • Null-literal
              • Floating-point-literals
              • Boolean-literals
              • Package-names
              • Literals
            • Semantics
        • 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
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Unicode-escapes

    Uniescape-parse

    Parse the Unicode escapes in a list of Unicode characters.

    Signature
    (uniescape-parse unicodes) → (mv errorp trees)
    Arguments
    unicodes — Guard (unicode-listp unicodes).
    Returns
    errorp — Type (booleanp errorp).
    trees — Type (abnf-tree-list-with-root-p trees "unicode-input-character").

    This parser is declaratively defined in terms of the witness of uniescape-parse-p. If the list of Unicode characters has a corresponding list of parse trees (i.e. such that the input/output constraints are satisified), they are returned; otherwise the parser fails. This parser should never fail, but this remains to be proved formally.

    Generally a parser returns a single parse trees, but Java's first lexical translation step must take place before any further parsing. Therefore, it is appropriate for this parser to return a list of unicode-input-character trees.

    Definitions and Theorems

    Function: uniescape-parse

    (defun uniescape-parse (unicodes)
      (declare (xargs :guard (unicode-listp unicodes)))
      (let ((__function__ 'uniescape-parse))
        (declare (ignorable __function__))
        (if (uniescape-parse-p unicodes)
            (mv nil (uniescape-parse-witness unicodes))
          (mv t nil))))

    Theorem: booleanp-of-uniescape-parse.errorp

    (defthm booleanp-of-uniescape-parse.errorp
      (b* (((mv ?errorp ?trees)
            (uniescape-parse unicodes)))
        (booleanp errorp))
      :rule-classes :rewrite)

    Theorem: return-type-of-uniescape-parse.trees

    (defthm return-type-of-uniescape-parse.trees
      (b* (((mv ?errorp ?trees)
            (uniescape-parse unicodes)))
        (abnf-tree-list-with-root-p trees "unicode-input-character"))
      :rule-classes :rewrite)