• 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-process

    Perform Java's first lexical translation step.

    Signature
    (uniescape-process unicodes) → (mv errorp new-unicodes)
    Arguments
    unicodes — Guard (unicode-listp unicodes).
    Returns
    errorp — Type (booleanp errorp).
    new-unicodes — Type (unicode-listp new-unicodes).

    We parse the Unicode characters into trees, and then we abstract the trees into Unicode characters. We also check that there no invalid Unicode escape candidates, returning an error if there are any.

    We propagate any errors from the parser, even though there should never be any. See comments in uniescape-parse about this.

    Definitions and Theorems

    Function: uniescape-process

    (defun uniescape-process (unicodes)
      (declare (xargs :guard (unicode-listp unicodes)))
      (let ((__function__ 'uniescape-process))
        (declare (ignorable __function__))
        (b* (((when (some-uniescape-candidate-invalid-p unicodes))
              (mv t nil))
             ((mv errorp trees)
              (uniescape-parse unicodes))
             ((when errorp) (mv t nil)))
          (mv nil
              (abs-unicode-input-character-list trees)))))

    Theorem: booleanp-of-uniescape-process.errorp

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

    Theorem: unicode-listp-of-uniescape-process.new-unicodes

    (defthm unicode-listp-of-uniescape-process.new-unicodes
      (b* (((mv ?errorp ?new-unicodes)
            (uniescape-process unicodes)))
        (unicode-listp new-unicodes))
      :rule-classes :rewrite)