• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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-tree-constraints-p

    Sufficient condition for parsed trees to be Unicode escapes.

    See the discussion in even-backslashes-tree-constraints-p regarding the declarative definition of the Unicode escape parser. This predicate captures another constraint, besides the grammar constraint: namely, that if there is a Unicode escape at some position in the Unicode character list (the string at the leaves of the tree), then the corresponding tree must be of a Unicode escape, i.e. its (only) subtree must be a unicode-escape tree.

    Note that the position in question is expressed not directly, but indirectly via an index in the list of trees. There is no ``loss'' in doing that, because the string has to be decomposed into trees according to the grammar anyhow.

    Definitions and Theorems

    Theorem: uniescape-tree-constraints-p-necc

    (defthm uniescape-tree-constraints-p-necc
     (implies
      (uniescape-tree-constraints-p trees)
      (implies
         (and (integer-range-p 0 (len trees) i)
              (uniescapep (len (abnf::tree-list->string (take i trees)))
                          (abnf::tree-list->string trees)))
         (unicode-input-character-tree-is-escape-p (nth i trees)))))

    Theorem: booleanp-of-uniescape-tree-constraints-p

    (defthm booleanp-of-uniescape-tree-constraints-p
      (b* ((yes/no (uniescape-tree-constraints-p trees)))
        (booleanp yes/no))
      :rule-classes :rewrite)