• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
          • Pretty-printing-implementation
            • Missing-functionality
            • Printconfig
            • Cons-ppr1
            • Print-escaped-charlist
            • Atom-size
            • Print-escaped-str
            • Obj-size
            • Maybe-merge-flat
            • Ppr
              • Printer-instructions
              • Keyword-param-valuep
              • Print-flat-objs
              • Radix-print-int
              • Print-escaped-atom
              • Print-atom
              • Print-escaped-symbol
              • Radix-print-complex
              • Basic-print-complex
              • Radix-print-rat
              • Spaces1
              • Basic-print-rat
              • Basic-print-nat
              • Basic-print-int
              • Spaces
              • My-needs-slashes
              • Pinstlist->max-width
              • Nat-size
              • Special-term-num
              • Print-column
              • Print-base-fix
              • Int-size
              • Keyword-fix
              • Print-instruction
              • Pinst->width
              • In-home-package-p
              • Eviscerated->guts
              • Evisceratedp
              • Pprdot
            • Eviscerate
            • Pretty
            • Revappend-pretty
            • Pretty-list
          • Printtree
          • Base64
          • Charset-p
          • Strtok!
          • Cases
          • Concatenation
          • Html-encoding
          • Character-kinds
          • Substrings
          • Strtok
          • Equivalences
          • Url-encoding
          • Lines
          • Explode-implode-equalities
          • Ordering
          • Numbers
          • Pad-trim
          • Coercion
          • Std/strings/digit-to-char
          • Substitution
          • Symbols
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Pretty-printing-implementation

    Ppr

    Low-level routine to do both passes of pretty-printing.

    Signature
    (ppr x col config eviscp acc) → new-acc
    Arguments
    x — Any ACL2 object to be printed.
    col — Current column number.
        Guard (natp col).
    config — Guard (printconfig-p config).
    eviscp — Guard (booleanp eviscp).
    Returns
    new-acc — Type (character-listp new-acc), given (character-listp acc).

    If eviscp is nil, then we pretty print x as given. Otherwise, x has been eviscerated and we give special importance to the *evisceration-mark*. NOTE WELL: This function does not eviscerate -- it assumes the evisceration has been done if needed.

    Definitions and Theorems

    Function: ppr

    (defun ppr (x col config eviscp acc)
      (declare (xargs :guard (and (natp col)
                                  (printconfig-p config)
                                  (booleanp eviscp))))
      (let ((acl2::__function__ 'ppr))
        (declare (ignorable acl2::__function__))
        (b* (((printconfig config) config)
             (col (if (>= col
                          (the unsigned-byte config.hard-right-margin))
                      0
                    col))
             (inst (ppr1 x 0 (- config.hard-right-margin col)
                         config eviscp)))
          (print-instruction inst col config eviscp acc))))

    Theorem: character-listp-of-ppr

    (defthm character-listp-of-ppr
      (implies (character-listp acc)
               (b* ((new-acc (ppr x col config eviscp acc)))
                 (character-listp new-acc)))
      :rule-classes :rewrite)