• 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
        • Strtok
        • Equivalences
          • Charlisteqv
          • Icharlisteqv
          • Istreqv
          • Ichareqv
          • Streqv
          • Chareqv
          • Char-fix
          • Str-fix
          • 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
    • Std/basic
    • Equivalences

    Str-fix

    Coerce to a string.

    (str-fix x) is the identity on stringps, or returns the empty string, "", for any non-string.

    This is similar to other fixing functions like fix and nfix. See also streqv.

    Definitions and Theorems

    Function: str-fix$inline

    (defun str-fix$inline (x)
      (declare (xargs :guard t))
      (if (stringp x) x ""))

    Theorem: stringp-of-str-fix

    (defthm stringp-of-str-fix
      (stringp (str-fix x))
      :rule-classes :type-prescription)

    Theorem: str-fix-default

    (defthm str-fix-default
      (implies (not (stringp x))
               (equal (str-fix x) "")))

    Theorem: str-fix-when-stringp

    (defthm str-fix-when-stringp
      (implies (stringp x)
               (equal (str-fix x) x)))