• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/io
      • Std/osets
      • Std/system
      • Std/basic
        • Maybe-stringp
        • Maybe-natp
        • Two-nats-measure
        • Impossible
        • Nat-list-measure
        • Bytep
        • Maybe-posp
        • Nibblep
        • Mbt$
        • Organize-symbols-by-pkg
        • Organize-symbols-by-name
        • Good-valuep
        • Lnfix
        • Streqv
          • Chareqv
          • Symbol-package-name-non-cl
          • Std/basic-extensions
          • Arith-equivs
          • Induction-schemes
          • Maybe-integerp
          • Char-fix
          • Symbol-package-name-lst
          • Pos-fix
          • Maybe-bitp
          • Good-pseudo-termp
          • Str-fix
          • Maybe-string-fix
          • Lifix
          • Bfix
          • Std/basic/if*
          • Impliez
          • Tuplep
          • Std/basic/symbol-name-lst
          • Std/basic/intern-in-package-of-symbol
          • Lbfix
          • True
          • Std/basic/member-symbol-name
          • False
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Std/basic
    • Equivalences

    Streqv

    Case-sensitive string equivalence test.

    (streqv x y) determines if x and y are equivalent when interpreted as strings. That is, non-strings are first coerced to be the empty string (via str-fix), then we see if these coerced arguments are equal.

    See also str::istreqv for a case-insensitive alternative.

    Definitions and Theorems

    Function: streqv$inline

    (defun streqv$inline (x y)
           (declare (xargs :guard t))
           (equal (str-fix x) (str-fix y)))

    Theorem: streqv-is-an-equivalence

    (defthm streqv-is-an-equivalence
            (and (booleanp (streqv x y))
                 (streqv x x)
                 (implies (streqv x y) (streqv y x))
                 (implies (and (streqv x y) (streqv y z))
                          (streqv x z)))
            :rule-classes (:equivalence))

    Theorem: streqv-of-str-fix

    (defthm streqv-of-str-fix
            (streqv (str-fix x) x))

    Theorem: streqv-implies-equal-str-fix-1

    (defthm streqv-implies-equal-str-fix-1
            (implies (streqv x x-equiv)
                     (equal (str-fix x) (str-fix x-equiv)))
            :rule-classes (:congruence))

    Theorem: streqv-implies-equal-char-1

    (defthm streqv-implies-equal-char-1
            (implies (streqv x x-equiv)
                     (equal (char x n) (char x-equiv n)))
            :rule-classes (:congruence))

    Theorem: streqv-implies-equal-string-append-1

    (defthm streqv-implies-equal-string-append-1
            (implies (streqv x x-equiv)
                     (equal (string-append x y)
                            (string-append x-equiv y)))
            :rule-classes (:congruence))

    Theorem: streqv-implies-equal-string-append-2

    (defthm streqv-implies-equal-string-append-2
            (implies (streqv y y-equiv)
                     (equal (string-append x y)
                            (string-append x y-equiv)))
            :rule-classes (:congruence))