Print the HTML encoding of a character.
(vl-html-encode-push char1 col tabsize acc) → new-acc
Function:
(defun vl-html-encode-push (char1 col tabsize acc) (declare (xargs :guard (and (characterp char1) (natp col) (posp tabsize)))) (let ((__function__ 'vl-html-encode-push)) (declare (ignorable __function__)) (b* ((char1 (mbe :logic (char-fix char1) :exec char1)) (col (lnfix col))) (case char1 (#\Space (if (or (atom acc) (eql (car acc) #\Space) (eql (car acc) #\Newline)) (revappend *vl-html- * acc) (cons #\Space acc))) (#\Newline (revappend *vl-html-newline* acc)) (#\< (revappend *vl-html-<* acc)) (#\> (revappend *vl-html->* acc)) (#\& (revappend *vl-html-&* acc)) (#\" (revappend *vl-html-"* acc)) (#\Tab (repeated-revappend (vl-distance-to-tab col tabsize) *vl-html- * acc)) (otherwise (cons char1 acc))))))
Theorem:
(defthm character-listp-of-vl-html-encode-push (implies (character-listp acc) (b* ((new-acc (vl-html-encode-push char1 col tabsize acc))) (character-listp new-acc))) :rule-classes :rewrite)
Theorem:
(defthm vl-html-encode-push-of-char-fix-char1 (equal (vl-html-encode-push (char-fix char1) col tabsize acc) (vl-html-encode-push char1 col tabsize acc)))
Theorem:
(defthm vl-html-encode-push-chareqv-congruence-on-char1 (implies (chareqv char1 char1-equiv) (equal (vl-html-encode-push char1 col tabsize acc) (vl-html-encode-push char1-equiv col tabsize acc))) :rule-classes :congruence)
Theorem:
(defthm vl-html-encode-push-of-nfix-col (equal (vl-html-encode-push char1 (nfix col) tabsize acc) (vl-html-encode-push char1 col tabsize acc)))
Theorem:
(defthm vl-html-encode-push-nat-equiv-congruence-on-col (implies (acl2::nat-equiv col col-equiv) (equal (vl-html-encode-push char1 col tabsize acc) (vl-html-encode-push char1 col-equiv tabsize acc))) :rule-classes :congruence)
Theorem:
(defthm vl-html-encode-push-of-pos-fix-tabsize (equal (vl-html-encode-push char1 col (pos-fix tabsize) acc) (vl-html-encode-push char1 col tabsize acc)))
Theorem:
(defthm vl-html-encode-push-pos-equiv-congruence-on-tabsize (implies (acl2::pos-equiv tabsize tabsize-equiv) (equal (vl-html-encode-push char1 col tabsize acc) (vl-html-encode-push char1 col tabsize-equiv acc))) :rule-classes :congruence)