• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • 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
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • 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)