Convert a character into a lower-case one-element string.
(downcase-char-str c) → str
(downcase-char-str c) is logically equal to:
(implode (downcase-char c))
But we store these strings in a table so that they don't have to be recomputed. This is mainly useful to reduce the creation of temporary strings during downcase-first.
Function:
(defun make-downcase-first-strtbl (n) (declare (xargs :guard (and (natp n) (<= n 255)))) (cons (cons n (implode (list (downcase-char (code-char n))))) (if (zp n) nil (make-downcase-first-strtbl (- n 1)))))
Function:
(defun downcase-char-str$inline (c) (declare (type character c)) (let ((acl2::__function__ 'downcase-char-str)) (declare (ignorable acl2::__function__)) (mbe :logic (implode (list (downcase-char c))) :exec (aref1 '*downcase-first-strtbl* *downcase-first-strtbl* (char-code c)))))
Theorem:
(defthm stringp-of-downcase-char-str (b* ((str (downcase-char-str$inline c))) (stringp str)) :rule-classes :type-prescription)