• 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-candidate-p

    Check if, in a list of Unicode characters, a Unicode escape may start at position pos.

    Signature
    (uniescape-candidate-p pos unicodes) → yes/no
    Arguments
    pos — Guard (natp pos).
    unicodes — Guard (unicode-listp unicodes).
    Returns
    yes/no — Type (booleanp yes/no).

    This notion is not explicitly defined in [JLS14:3.3], but it is useful for our formalization. A candidate position for (the start of) a Unicode escape is the position of an eligible backslash followed by a non-zero number of `u' letters.

    When there is such a candidate position in a list of Unicode characters, either the candidate is an actual Unicode escape, or the list of Unicode characters is invalid. This is defined subsequently.

    Definitions and Theorems

    Function: uniescape-candidate-p

    (defun uniescape-candidate-p (pos unicodes)
      (declare (xargs :guard (and (natp pos)
                                  (unicode-listp unicodes))))
      (declare (xargs :guard (< pos (len unicodes))))
      (and (eligible-backslash-p pos unicodes)
           (nonzero-uletters-after-p pos unicodes)))

    Theorem: booleanp-of-uniescape-candidate-p

    (defthm booleanp-of-uniescape-candidate-p
      (b* ((yes/no (uniescape-candidate-p pos unicodes)))
        (booleanp yes/no))
      :rule-classes :rewrite)