• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
          • Ps
          • Basic-printing
            • Vl-println?
            • Vl-printable-p
            • Vl-print
            • Vl-col-after-printing-chars
            • Vl-print-strings-with-commas
            • Vl-col-after-printing-string
            • 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
            • Verilog-printing
            • Printing-locally
            • Formatted-printing
            • Accessing-printed-output
            • Vl-printedlist
            • Json-printing
          • Esim-vl
          • Well-formedness
        • Sv
        • Vwsim
        • Fgl
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Basic-printing

    Vl-indent

    (vl-indent n &key (ps 'ps)) indents to column n.

    Signature
    (vl-indent n &key (ps 'ps)) → ps
    Arguments
    n — Guard (natp n).

    In text mode we indent by printing spaces; in HTML mode we instead print   characters. Note that this function has no effect if we are already past column n.

    Definitions and Theorems

    Function: vl-indent-fn

    (defun
     vl-indent-fn (n ps)
     (declare (xargs :stobjs (ps)))
     (declare (xargs :guard (natp n)))
     (declare (type unsigned-byte n))
     (let
      ((__function__ 'vl-indent))
      (declare (ignorable __function__))
      (b*
       ((rchars (vl-ps->rchars))
        ((the unsigned-byte col) (vl-ps->col))
        (htmlp (vl-ps->htmlp))
        ((the unsigned-byte n) (lnfix n)))
       (cond
        ((>= col n) ps)
        (htmlp
         (vl-ps-seq (vl-ps-update-rchars (make-list-ac (- n col)
                                                       " " rchars))
                    (vl-ps-update-col n)))
        (t
         (vl-ps-seq
           (vl-ps-update-rchars (make-list-ac (- n col) #\Space rchars))
           (vl-ps-update-col n)))))))

    Theorem: vl-indent-fn-of-nfix-n

    (defthm vl-indent-fn-of-nfix-n
            (equal (vl-indent-fn (nfix n) ps)
                   (vl-indent-fn n ps)))

    Theorem: vl-indent-fn-nat-equiv-congruence-on-n

    (defthm vl-indent-fn-nat-equiv-congruence-on-n
            (implies (acl2::nat-equiv n n-equiv)
                     (equal (vl-indent-fn n ps)
                            (vl-indent-fn n-equiv ps)))
            :rule-classes :congruence)