A variant of common-lisp::string-downcase applicable to any string.
The built-in common-lisp::string-downcase has a guard requiring
all the characters in the string to be
This facilitates guard verification of code involving this function. The hard error seems appropriate for the envisioned usage of this function within the XDOC constructors, meant to be called to produce XDOC strings during book certification.
Function:
(defun string-downcase$ (string) (declare (xargs :guard (stringp string))) (if (standard-char-listp (coerce string 'list)) (common-lisp::string-downcase string) (prog2$ (er hard? 'string-downcase$ "Attempt to downcase non-standard string ~x0." string) "")))
Theorem:
(defthm stringp-of-string-downcase$ (stringp (string-downcase$ string)))