• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
          • Ps
          • Verilog-printing
          • Basic-printing
            • Vl-println?
            • Vl-print
            • Vl-printable-p
            • Vl-col-after-printing-string
            • Vl-col-after-printing-chars
            • Vl-print-strings-with-commas
            • Vl-string-needs-html-encoding-p
            • Vl-println-markup
            • Vl-print-strings-as-lines
            • Vl-print-url
              • Vl-print-nat
              • Vl-indent
              • Vl-println
              • Vl-print-markup
              • Vl-ps-seq
              • Vl-cw-ps-seq
              • Vl-when-html
              • Vl-ps-span
            • Printing-locally
            • Formatted-printing
            • Accessing-printed-output
            • Json-printing
            • Vl-printedlist
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Basic-printing

    Vl-print-url

    (vl-print-url x &key (ps 'ps)) prints text with automatic URL encoding.

    Signature
    (vl-print-url x &key (ps 'ps)) → ps
    Arguments
    x — Guard (vl-printable-p x).

    This function simply prints the URL-encoding of x to ps, regardless of the output mode. It is useful for printing parts of URLs with the proper encoding.

    Definitions and Theorems

    Function: vl-print-url-fn

    (defun vl-print-url-fn (x ps)
     (declare (xargs :stobjs (ps)))
     (declare (xargs :guard (vl-printable-p x)))
     (let ((__function__ 'vl-print-url))
      (declare (ignorable __function__))
      (let* ((rchars (vl-ps->rchars))
             (x (vl-printable-fix x)))
       (cond
        ((stringp x)
         (vl-ps-update-rchars (str::url-encode-string-aux x 0 (length x)
                                                          rchars)))
        ((and (atom x) x)
         (vl-ps-update-rchars
              (str::url-encode-chars-aux (explode-atom x 10)
                                         rchars)))
        (t
         (vl-ps-update-rchars (str::url-encode-chars-aux x rchars)))))))

    Theorem: vl-print-url-fn-of-vl-printable-fix-x

    (defthm vl-print-url-fn-of-vl-printable-fix-x
      (equal (vl-print-url-fn (vl-printable-fix x)
                              ps)
             (vl-print-url-fn x ps)))

    Theorem: vl-print-url-fn-vl-printable-equiv-congruence-on-x

    (defthm vl-print-url-fn-vl-printable-equiv-congruence-on-x
      (implies (vl-printable-equiv x x-equiv)
               (equal (vl-print-url-fn x ps)
                      (vl-print-url-fn x-equiv ps)))
      :rule-classes :congruence)