Pretty-print a literal.
We pretty-print our limited form of floating-point literals
just by appending
Function:
(defun print-jliteral (lit) (declare (xargs :guard (jliteralp lit))) (let ((__function__ 'print-jliteral)) (declare (ignorable __function__)) (jliteral-case lit :integer (print-integer-literal lit.get) :floating (b* ((digits (nat-to-dec-string lit.value))) (str::cat digits ".0")) :boolean (if lit.value "true" "false") :character (msg "'~@0'" (print-jchar lit.value)) :string (msg "\"~@0\"" (print-jchars (explode lit.value))) :null "null")))
Theorem:
(defthm msgp-of-print-jliteral (b* ((part (print-jliteral lit))) (msgp part)) :rule-classes :rewrite)