• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
          • Ps
          • Verilog-printing
          • 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
            • Printing-locally
            • Formatted-printing
            • Accessing-printed-output
            • Json-printing
            • Vl-printedlist
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Basic-printing

    Vl-col-after-printing-chars

    Figure out where we'll be after printing some characters.

    Signature
    (vl-col-after-printing-chars col chars) → new-col
    Arguments
    col — Current column we're at.
        Guard (natp col).
    chars — Characters we're about to print, not yet reversed.
        Guard (character-listp chars).
    Returns
    new-col — Column we'll be at after printing chars.
        Type (natp new-col).

    Definitions and Theorems

    Function: vl-col-after-printing-chars

    (defun vl-col-after-printing-chars (col chars)
           (declare (xargs :guard (and (natp col)
                                       (character-listp chars))))
           (declare (type unsigned-byte col))
           (declare (xargs :split-types t))
           (let ((__function__ 'vl-col-after-printing-chars))
                (declare (ignorable __function__))
                (cond ((atom chars) (lnfix col))
                      ((eql #\Newline
                            (mbe :logic (char-fix (car chars))
                                 :exec (car chars)))
                       (vl-col-after-printing-chars 0 (cdr chars)))
                      (t (vl-col-after-printing-chars (+ 1 (lnfix col))
                                                      (cdr chars))))))

    Theorem: natp-of-vl-col-after-printing-chars

    (defthm natp-of-vl-col-after-printing-chars
            (b* ((new-col (vl-col-after-printing-chars col chars)))
                (natp new-col))
            :rule-classes :type-prescription)

    Theorem: vl-col-after-printing-chars-of-nfix-col

    (defthm vl-col-after-printing-chars-of-nfix-col
            (equal (vl-col-after-printing-chars (nfix col)
                                                chars)
                   (vl-col-after-printing-chars col chars)))

    Theorem: vl-col-after-printing-chars-nat-equiv-congruence-on-col

    (defthm
         vl-col-after-printing-chars-nat-equiv-congruence-on-col
         (implies (acl2::nat-equiv col col-equiv)
                  (equal (vl-col-after-printing-chars col chars)
                         (vl-col-after-printing-chars col-equiv chars)))
         :rule-classes :congruence)

    Theorem: vl-col-after-printing-chars-of-make-character-list-chars

    (defthm
      vl-col-after-printing-chars-of-make-character-list-chars
      (equal
           (vl-col-after-printing-chars col (make-character-list chars))
           (vl-col-after-printing-chars col chars)))

    Theorem: vl-col-after-printing-chars-charlisteqv-congruence-on-chars

    (defthm
         vl-col-after-printing-chars-charlisteqv-congruence-on-chars
         (implies (str::charlisteqv chars chars-equiv)
                  (equal (vl-col-after-printing-chars col chars)
                         (vl-col-after-printing-chars col chars-equiv)))
         :rule-classes :congruence)