• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
          • Name-database
          • Vl-gc
          • Make-lookup-alist
          • Symbol-list-names
          • Html-encoding
            • Vl-html-encode-chars-aux
            • Vl-html-encode-push
            • Vl-html-encode-next-col
              • Vl-html-encode-string
              • Vl-distance-to-tab
              • Vl-html-encode-string-aux
              • Repeated-revappend
              • *vl-html-newline*
              • *vl-html-&quot*
              • *vl-html-&nbsp*
              • *vl-html-&lt*
              • *vl-html-&gt*
              • *vl-html-&amp*
            • Nats-from
            • Redundant-mergesort
            • Longest-common-prefix
            • Vl-edition-p
            • Nat-listp
            • Vl-plural-p
            • Vl-remove-keys
            • Sum-nats
            • Vl-maybe-nat-listp
            • Url-encoding
            • Fast-memberp
            • Vl-string-keys-p
            • Max-nats
            • Longest-common-prefix-list
            • Character-list-listp
            • Vl-string-list-values-p
            • Vl-character-list-list-values-p
            • Remove-from-alist
            • Prefix-of-eachp
            • Vl-maybe-string-listp
            • Pos-listp
            • Vl-string-values-p
            • String-list-listp
            • True-list-listp
            • Symbol-list-listp
            • Explode-list
            • All-have-len
            • Min-nats
            • Debuggable-and
            • Vl-starname
            • Remove-equal-without-guard
            • String-fix
            • Longer-than-p
            • Clean-alist
            • Anyp
            • Or*
            • Fast-alist-free-each-alist-val
            • And*
            • Not*
            • Free-list-of-fast-alists
            • *nls*
          • Loader
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Html-encoding

    Vl-html-encode-next-col

    Compute where we'll be after printing a character, accounting for tab sizes and newlines.

    Signature
    (vl-html-encode-next-col char1 col tabsize) → new-col
    Arguments
    char1 — Character to be printed.
        Guard (characterp char1).
    col — Current column number before printing char1.
        Guard (natp col).
    tabsize — Guard (posp tabsize).
    Returns
    new-col — New column number after printing char1.
        Type (natp new-col).

    Definitions and Theorems

    Function: vl-html-encode-next-col$inline

    (defun vl-html-encode-next-col$inline (char1 col tabsize)
      (declare (xargs :guard (and (characterp char1)
                                  (natp col)
                                  (posp tabsize))))
      (let ((__function__ 'vl-html-encode-next-col))
        (declare (ignorable __function__))
        (b* ((char1 (mbe :logic (char-fix char1)
                         :exec char1))
             (col (lnfix col)))
          (cond ((eql char1 #\Newline) 0)
                ((eql char1 #\Tab)
                 (+ col (vl-distance-to-tab col tabsize)))
                (t (+ 1 col))))))

    Theorem: natp-of-vl-html-encode-next-col

    (defthm natp-of-vl-html-encode-next-col
      (b* ((new-col (vl-html-encode-next-col$inline char1 col tabsize)))
        (natp new-col))
      :rule-classes :type-prescription)

    Theorem: vl-html-encode-next-col$inline-of-char-fix-char1

    (defthm vl-html-encode-next-col$inline-of-char-fix-char1
      (equal (vl-html-encode-next-col$inline (char-fix char1)
                                             col tabsize)
             (vl-html-encode-next-col$inline char1 col tabsize)))

    Theorem: vl-html-encode-next-col$inline-chareqv-congruence-on-char1

    (defthm vl-html-encode-next-col$inline-chareqv-congruence-on-char1
     (implies
       (chareqv char1 char1-equiv)
       (equal (vl-html-encode-next-col$inline char1 col tabsize)
              (vl-html-encode-next-col$inline char1-equiv col tabsize)))
     :rule-classes :congruence)

    Theorem: vl-html-encode-next-col$inline-of-nfix-col

    (defthm vl-html-encode-next-col$inline-of-nfix-col
      (equal (vl-html-encode-next-col$inline char1 (nfix col)
                                             tabsize)
             (vl-html-encode-next-col$inline char1 col tabsize)))

    Theorem: vl-html-encode-next-col$inline-nat-equiv-congruence-on-col

    (defthm vl-html-encode-next-col$inline-nat-equiv-congruence-on-col
     (implies
       (acl2::nat-equiv col col-equiv)
       (equal (vl-html-encode-next-col$inline char1 col tabsize)
              (vl-html-encode-next-col$inline char1 col-equiv tabsize)))
     :rule-classes :congruence)

    Theorem: vl-html-encode-next-col$inline-of-pos-fix-tabsize

    (defthm vl-html-encode-next-col$inline-of-pos-fix-tabsize
     (equal (vl-html-encode-next-col$inline char1 col (pos-fix tabsize))
            (vl-html-encode-next-col$inline char1 col tabsize)))

    Theorem: vl-html-encode-next-col$inline-pos-equiv-congruence-on-tabsize

    (defthm
         vl-html-encode-next-col$inline-pos-equiv-congruence-on-tabsize
     (implies
       (acl2::pos-equiv tabsize tabsize-equiv)
       (equal (vl-html-encode-next-col$inline char1 col tabsize)
              (vl-html-encode-next-col$inline char1 col tabsize-equiv)))
     :rule-classes :congruence)