Convert a string into HTML (simple version, no tab support).
Function:
(defun html-encode-string-basic-aux (x n xl acc) (declare (xargs :guard (and (stringp x) (natp n) (eql xl (length x))))) (declare (type unsigned-byte n xl)) (declare (xargs :split-types t :guard (<= n xl))) (let ((acl2::__function__ 'html-encode-string-basic-aux)) (declare (ignorable acl2::__function__)) (mbe :logic (html-encode-chars-basic-aux (nthcdr n (explode x)) acc) :exec (b* (((when (mbe :logic (zp (- (nfix xl) (nfix n))) :exec (eql n xl))) acc) (acc (html-encode-char-basic (char x n) acc)) ((the unsigned-byte n) (mbe :logic (+ 1 (lnfix n)) :exec (+ 1 n)))) (html-encode-string-basic-aux x n xl acc)))))
Theorem:
(defthm html-encode-string-basic-aux-of-str-fix-x (equal (html-encode-string-basic-aux (str-fix x) n xl acc) (html-encode-string-basic-aux x n xl acc)))
Theorem:
(defthm html-encode-string-basic-aux-streqv-congruence-on-x (implies (streqv x x-equiv) (equal (html-encode-string-basic-aux x n xl acc) (html-encode-string-basic-aux x-equiv n xl acc))) :rule-classes :congruence)
Theorem:
(defthm html-encode-string-basic-aux-of-nfix-n (equal (html-encode-string-basic-aux x (nfix n) xl acc) (html-encode-string-basic-aux x n xl acc)))
Theorem:
(defthm html-encode-string-basic-aux-nat-equiv-congruence-on-n (implies (acl2::nat-equiv n n-equiv) (equal (html-encode-string-basic-aux x n xl acc) (html-encode-string-basic-aux x n-equiv xl acc))) :rule-classes :congruence)