Print a character constant.
We ensure that there is at least one character or escape sequence.
Function:
(defun print-cconst (cconst pstate) (declare (xargs :guard (and (cconstp cconst) (pristatep pstate)))) (let ((__function__ 'print-cconst)) (declare (ignorable __function__)) (b* (((cconst cconst) cconst) (pstate (print-cprefix-option cconst.prefix? pstate)) (pstate (print-astring "'" pstate)) ((unless cconst.cchars) (raise "Misusage error: ~ the character constant has no characters or escape sequences.") pstate) (pstate (print-c-char-list cconst.cchars pstate)) (pstate (print-astring "'" pstate))) pstate)))
Theorem:
(defthm pristatep-of-print-cconst (b* ((new-pstate (print-cconst cconst pstate))) (pristatep new-pstate)) :rule-classes :rewrite)
Theorem:
(defthm print-cconst-of-cconst-fix-cconst (equal (print-cconst (cconst-fix cconst) pstate) (print-cconst cconst pstate)))
Theorem:
(defthm print-cconst-cconst-equiv-congruence-on-cconst (implies (cconst-equiv cconst cconst-equiv) (equal (print-cconst cconst pstate) (print-cconst cconst-equiv pstate))) :rule-classes :congruence)
Theorem:
(defthm print-cconst-of-pristate-fix-pstate (equal (print-cconst cconst (pristate-fix pstate)) (print-cconst cconst pstate)))
Theorem:
(defthm print-cconst-pristate-equiv-congruence-on-pstate (implies (pristate-equiv pstate pstate-equiv) (equal (print-cconst cconst pstate) (print-cconst cconst pstate-equiv))) :rule-classes :congruence)