• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
        • Charset-p
        • Strtok!
        • Cases
        • Concatenation
        • Html-encoding
        • Character-kinds
        • Substrings
          • Istrpos
          • Strrpos
          • Strpos
          • Collect-syms-with-isubstr
          • Istrprefixp
          • Collect-strs-with-isubstr
          • Iprefixp
          • Strsuffixp
          • Firstn-chars
          • Strprefixp
          • Isubstrp
            • Substrp
          • Strtok
          • Equivalences
          • Url-encoding
          • Lines
          • Explode-implode-equalities
          • Ordering
          • Numbers
          • Pad-trim
          • Coercion
          • Std/strings/digit-to-char
          • Substitution
          • Symbols
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Substrings

    Isubstrp

    Case-insensitively test for the existence of a substring.

    (isubstrp x y) determines if x ever occurs as a case-insensitive substring of y.

    See also substrp for a case-sensitive version.

    See also istrpos for an alternative that reports the position of the matched substring.

    Definitions and Theorems

    Function: isubstrp$inline

    (defun isubstrp$inline (x y)
      (declare (type string x y))
      (if (istrpos x y) t nil))

    Theorem: iprefixp-when-isubstrp

    (defthm iprefixp-when-isubstrp
      (implies (isubstrp x y)
               (iprefixp (explode x)
                         (nthcdr (istrpos x y) (explode y)))))

    Theorem: completeness-of-isubstrp

    (defthm completeness-of-isubstrp
      (implies (and (iprefixp (explode x)
                              (nthcdr m (explode y)))
                    (force (natp m)))
               (isubstrp x y)))

    Theorem: istreqv-implies-equal-isubstrp-1

    (defthm istreqv-implies-equal-isubstrp-1
      (implies (istreqv x x-equiv)
               (equal (isubstrp x y)
                      (isubstrp x-equiv y)))
      :rule-classes (:congruence))

    Theorem: istreqv-implies-equal-isubstrp-2

    (defthm istreqv-implies-equal-isubstrp-2
      (implies (istreqv y y-equiv)
               (equal (isubstrp x y)
                      (isubstrp x y-equiv)))
      :rule-classes (:congruence))