• 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
        • Url-encoding
          • *url-encode-array*
          • Url-encode-chars-aux
          • Url-encode-char
          • Url-encode-chars
          • Url-encode-string
            • Url-encode-string-aux
            • Fast-url-encode-char
          • 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
    • Url-encoding

    Url-encode-string

    Simple way to URL encode a string.

    Signature
    (url-encode-string x) → encoded
    Arguments
    x — Guard (stringp x).
    Returns
    encoded — Type (stringp encoded).

    Definitions and Theorems

    Function: url-encode-string$inline

    (defun url-encode-string$inline (x)
      (declare (type string x))
      (declare (xargs :guard (stringp x)))
      (declare (xargs :split-types t))
      (let ((acl2::__function__ 'url-encode-string))
        (declare (ignorable acl2::__function__))
        (let ((x (mbe :logic (str-fix x) :exec x)))
          (rchars-to-string (url-encode-string-aux x 0 (length x)
                                                   nil)))))

    Theorem: stringp-of-url-encode-string

    (defthm stringp-of-url-encode-string
      (b* ((encoded (url-encode-string$inline x)))
        (stringp encoded))
      :rule-classes :type-prescription)

    Theorem: url-encode-string$inline-of-str-fix-x

    (defthm url-encode-string$inline-of-str-fix-x
      (equal (url-encode-string$inline (str-fix x))
             (url-encode-string$inline x)))

    Theorem: url-encode-string$inline-streqv-congruence-on-x

    (defthm url-encode-string$inline-streqv-congruence-on-x
      (implies (streqv x x-equiv)
               (equal (url-encode-string$inline x)
                      (url-encode-string$inline x-equiv)))
      :rule-classes :congruence)