Compute where we'll be after printing a character, accounting for tab sizes and newlines.
(vl-html-encode-next-col char1 col tabsize) → new-col
Function:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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)