• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • 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
              • Unicode-characters
              • Keywords
              • 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
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Unicode-escapes

    Nonzero-uletters-after-p

    Check if, in a list of Unicode characters, the character at position pos is followed by a non-zero number of `u' letters.

    In this definition, we want n to be not merely a non-zero number of `u' letters at positions (+ pos 1) etc., but the maximum such number, i.e. such that (+ pos n 1) either is past the end of the list or is not a `u' letter; this is expressed by the last conjunct inside the quantification. The witness function returns this number, which is used in subsequent definitions.

    Note that (take n (nthcdr (1+ pos) unicodes)) consists of the characters from position (+ pos 1) to (+ pos n), both extremes inclusive (positions in lists are zero-based).

    Definitions and Theorems

    Theorem: nonzero-uletters-after-p-suff

    (defthm nonzero-uletters-after-p-suff
      (implies (and (posp n)
                    (< (+ pos n) (len unicodes))
                    (equal (take n (nthcdr (1+ pos) unicodes))
                           (repeat n (char-code #\u)))
                    (or (equal (1+ (+ pos n)) (len unicodes))
                        (not (equal (nth (1+ (+ pos n)) unicodes)
                                    (char-code #\u)))))
               (nonzero-uletters-after-p pos unicodes)))

    Theorem: booleanp-of-nonzero-uletters-after-p

    (defthm booleanp-of-nonzero-uletters-after-p
      (b* ((yes/no (nonzero-uletters-after-p pos unicodes)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: posp-of-nonzero-uletters-number

    (defthm posp-of-nonzero-uletters-number
      (implies (nonzero-uletters-after-p pos unicodes)
               (posp (number-of-nonzero-uletters-after pos unicodes)))
      :rule-classes :type-prescription)