Pretty-print any ACL2 object into a string.
(pretty x &key (config '*default-printconfig*) (col '0) (eviscp 'nil)) → pretty-x
This is our simplest pretty-printing function.
ACL2 !>(str::pretty '(1 2 3)) "(1 2 3)" ACL2 !>(str::pretty (make-list 30 :initial-element 'str::hello)) "(STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO STR::HELLO)" ACL2 !>(str::pretty (make-list 30 :initial-element 'str::hello) :config (make-printconfig :home-package (pkg-witness "STR") :print-lowercase t)) "(hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello)"
Function:
(defun pretty-fn (x config col eviscp) (declare (xargs :guard (and (printconfig-p config) (natp col) (booleanp eviscp)))) (let ((acl2::__function__ 'pretty)) (declare (ignorable acl2::__function__)) (rchars-to-string (ppr x col config eviscp nil))))
Theorem:
(defthm stringp-of-pretty (b* ((pretty-x (pretty-fn x config col eviscp))) (stringp pretty-x)) :rule-classes :type-prescription)