• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • Interfacing-tools
        • Io
          • Fmt
          • Msg
          • Cw
          • Set-evisc-tuple
          • Set-iprint
          • Print-control
            • Plev
          • Read-file-into-string
          • Std/io
          • Msgp
          • Printing-to-strings
          • Evisc-tuple
          • Output-controls
          • Observation
          • *standard-co*
          • Ppr-special-syms
          • Standard-oi
          • Standard-co
          • Without-evisc
          • Serialize
          • Output-to-file
          • Fmt-to-comment-window
          • Princ$
          • Character-encoding
          • Open-output-channel!
          • Cw-print-base-radix
          • Set-print-case
          • Set-print-base
          • Print-object$
          • Extend-pathname
          • Print-object$+
          • Fmx-cw
          • Set-print-radix
          • Set-fmt-hard-right-margin
          • File-write-date$
          • Proofs-co
          • Set-print-base-radix
          • Print-base-p
          • *standard-oi*
          • Wof
          • File-length$
          • Fms!-lst
          • Delete-file$
          • *standard-ci*
          • Write-list
          • Trace-co
          • Fmt!
          • Fms
          • Cw!
          • Fmt-to-comment-window!
          • Fms!
          • Eviscerate-hide-terms
          • Fmt1!
          • Fmt-to-comment-window!+
          • Read-file-into-byte-array-stobj
          • Fmt1
          • Fmt-to-comment-window+
          • Cw-print-base-radix!
          • Read-file-into-character-array-stobj
          • Fmx
          • Cw!+
          • Read-objects-from-book
          • Newline
          • Cw+
          • Probe-file
          • Write-objects-to-file!
          • Write-objects-to-file
          • Read-objects-from-file
          • Read-object-from-file
          • Read-file-into-byte-list
          • Set-fmt-soft-right-margin
          • Read-file-into-character-list
          • Io-utilities
        • Defttag
        • Sys-call
        • Save-exec
        • Quicklisp
        • Std/io
        • Oslib
        • Bridge
        • Clex
        • Tshell
        • Unsound-eval
        • Hacker
        • ACL2s-interface
        • Startup-banner
        • Command-line
    • Interfacing-tools
      • Io
        • Fmt
        • Msg
        • Cw
        • Set-evisc-tuple
        • Set-iprint
        • Print-control
          • Plev
        • Read-file-into-string
        • Std/io
        • Msgp
        • Printing-to-strings
        • Evisc-tuple
        • Output-controls
        • Observation
        • *standard-co*
        • Ppr-special-syms
        • Standard-oi
        • Standard-co
        • Without-evisc
        • Serialize
        • Output-to-file
        • Fmt-to-comment-window
        • Princ$
        • Character-encoding
        • Open-output-channel!
        • Cw-print-base-radix
        • Set-print-case
        • Set-print-base
        • Print-object$
        • Extend-pathname
        • Print-object$+
        • Fmx-cw
        • Set-print-radix
        • Set-fmt-hard-right-margin
        • File-write-date$
        • Proofs-co
        • Set-print-base-radix
        • Print-base-p
        • *standard-oi*
        • Wof
        • File-length$
        • Fms!-lst
        • Delete-file$
        • *standard-ci*
        • Write-list
        • Trace-co
        • Fmt!
        • Fms
        • Cw!
        • Fmt-to-comment-window!
        • Fms!
        • Eviscerate-hide-terms
        • Fmt1!
        • Fmt-to-comment-window!+
        • Read-file-into-byte-array-stobj
        • Fmt1
        • Fmt-to-comment-window+
        • Cw-print-base-radix!
        • Read-file-into-character-array-stobj
        • Fmx
        • Cw!+
        • Read-objects-from-book
        • Newline
        • Cw+
        • Probe-file
        • Write-objects-to-file!
        • Write-objects-to-file
        • Read-objects-from-file
        • Read-object-from-file
        • Read-file-into-byte-list
        • Set-fmt-soft-right-margin
        • Read-file-into-character-list
        • Io-utilities
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Std/io
      • Oslib
      • Bridge
      • Clex
      • Tshell
      • Unsound-eval
      • Hacker
      • ACL2s-interface
      • Startup-banner
      • Command-line
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Io

Print-control

Advanced controls of ACL2 printing

See io for a summary of printing in ACL2. Here we document some advanced ways to control what is printed by ACL2's primary printing routines.

See set-print-base-radix, set-print-base, set-print-radix, and set-print-case for discussions of the most common ways to control what is printed. Indeed, these are the only ways to control the behavior of princ$ and prin1$.

See set-fmt-hard-right-margin for how to set the right margin for prover output and, more generally, output from formatted printing functions (see fmt). Note that set-print-right-margin, mentioned below, does not affect such printing.

The rest of this topic is for advanced users of ACL2. We refer to Common Lisp behavior, as described in any good Common Lisp documentation.

Print-control variables. Set-print-base, set-print-radix, and set-print-case assign to corresponding so-called ``state global variables'' 'print-base, 'print-radix, and 'print-case, which can be accessed using the expressions (@ print-base), (@ print-radix), and (@ print-case), respectively; see assign. Here is a table showing all print-control variables, their setters, and their defaults. Also see set-print-base-radix.

print-base          set-print-base          10
print-case          set-print-case          :upcase
print-circle        set-print-circle        nil
  [but see remark on print-circle-files, below]
print-escape        set-print-escape        t
print-length        set-print-length        nil
print-level         set-print-level         nil
print-lines         set-print-lines         nil
print-pretty        set-print-pretty        nil
print-radix         set-print-radix         nil
print-readably      set-print-readably      nil
print-right-margin  set-print-right-margin  nil

Each ACL2 print-control variable print-xxx can correspond in function to Common Lisp variable *PRINT-XXX*. Specifically, the evaluation of forms (set-print-base t), (set-print-radix t), and (set-print-case t) affects ACL2 printing functions in much the same way that setting to t Common Lisp variables *PRINT-BASE*, *PRINT-RADIX*, and *PRINT-CASE*, respectively, affects Common Lisp printing. The same is true for print-escape, except that this does not affect princ$ or prin1$, which correspond to Common Lisp functions princ and prin1: princ treats *PRINT-ESCAPE* as nil while prin1 treats *PRINT-ESCAPE* as t. Moreover, all print-control variables not mentioned in this paragraph are set to their defaults in princ$ and prin1$, as indicated by ACL2 constant *print-control-defaults*, except that print-readably is set to nil in princ$.

Fmt and its related functions are sensitive to state globals 'print-base, 'print-radix, 'print-case, 'print-escape, and 'print-readably, in analogy with Common Lisp functions that don't fix *PRINT-ESCAPE* or *PRINT-READABLY*. But the fmt functions do not respect settings of other print-control variables; for example, they act as though 'print-circle is nil. Since ACL2 output is produced using the same underlying print routines as the fmt functions, it also is insensitive to all print-control variables except for the five above. To control the print-level and print-length used for producing ACL2 output, see set-evisc-tuple.

Print-object$ and print-object$-preserving-case are sensitive to the values of all of the print-control variables except for 'print-escape.

Evaluate (reset-print-control) to restore all print-control variables to their original settings, as stored in constant *print-control-defaults*.

(Remark on print-circle-files: ACL2 typically binds 'print-circle to t before writing certificate files, or auxiliary files that are compiled when make-event forms are present in a book, or files in support of :comp commands. This binding allows for structure sharing that can keep these files from growing large. End of Remark.)

(Remark for those using ACL2 built on CLtL1 (non-ANSI) Gnu Common Lisp (GCL): Note that Common Lisp variables *PRINT-LINES*, *PRINT-MISER-WIDTH*, *PRINT-READABLY*, *PRINT-PPRINT-DISPATCH*, and *PRINT-RIGHT-MARGIN* do not have any effect for such GCL versions.)

Subtopics

Plev
Easy-to-use functions for controlling the printer.