Figure out where we'll be after printing some characters.
(vl-col-after-printing-chars col chars) → new-col
Function:
(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:
(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:
(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:
(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:
(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:
(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)