• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
          • World
          • Io
          • Wormhole
          • Programming-with-state
            • Cbd
            • Error-triple
            • Last-prover-steps
            • @
            • State-global-let*
            • Assign
            • Read-run-time
            • F-put-global
            • Canonical-pathname
            • Unsound-eval
            • Er-progn
            • Setenv$
            • With-live-state
            • Read-ACL2-oracle
            • Getenv$
            • F-get-global
            • Pprogn
              • Get-real-time
              • Get-cpu-time
              • Makunbound-global
              • F-boundp-global
            • W
            • Set-state-ok
            • Random$
          • Memoize
          • Mbe
          • Io
          • Apply$
          • Defpkg
          • Mutual-recursion
          • Loop$
          • Programming-with-state
            • Cbd
            • Error-triple
            • Last-prover-steps
            • @
            • State-global-let*
            • Assign
            • Read-run-time
            • F-put-global
            • Canonical-pathname
            • Unsound-eval
            • Er-progn
            • Setenv$
            • With-live-state
            • Read-ACL2-oracle
            • Getenv$
            • F-get-global
            • Pprogn
              • Get-real-time
              • Get-cpu-time
              • Makunbound-global
              • F-boundp-global
            • Arrays
            • Characters
            • Time$
            • Loop$-primer
            • Fast-alists
            • Defmacro
            • Defconst
            • Evaluation
            • Guard
            • Equality-variants
            • Compilation
            • Hons
            • ACL2-built-ins
            • Developers-guide
            • System-attachments
            • Advanced-features
            • Set-check-invariant-risk
            • Numbers
            • Irrelevant-formals
            • Efficiency
            • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
            • Redefining-programs
            • Lists
            • Invariant-risk
            • Errors
            • Defabbrev
            • Conses
            • Alists
            • Set-register-invariant-risk
            • Strings
            • Program-wrapper
            • Get-internal-time
            • Basics
            • Packages
            • Defmacro-untouchable
            • Primitive
            • <<
            • Revert-world
            • Set-duplicate-keys-action
            • Unmemoize
            • Symbols
            • Def-list-constructor
            • Easy-simplify-term
            • Defiteration
            • Defopen
            • Sleep
          • Start-here
          • Real
          • Debugging
          • Miscellaneous
          • Output-controls
          • Macros
          • Interfacing-tools
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Testing-utilities
        • Math
      • Programming-with-state
      • ACL2-built-ins

      Pprogn

      Evaluate a sequence of forms that return state

      Example Form:
      (pprogn
       (cond ((or (equal (car l) #\) (equal (car l) slash-char))
              (princ$ #\ channel state))
             (t state))
       (princ$ (car l) channel state)
       (mv (cdr l) state))

      The convention for pprogn usage is to give it a non-empty sequence of forms, each of which (except possibly for the last) returns state (see state) as its only value. The state returned by each but the last is passed on to the next. The value or values of the last form are returned as the value of the pprogn.

      If you are using single-threaded objects you may wish to define an analogue of this function for your own stobj.

      General Form:

      (PPROGN form1
              form2
              ...
              formk
              result-form)

      This general form is equivalent, via macro expansion, to:

      (LET ((STATE form1))
           (LET ((STATE form2))
                ...
                (LET ((STATE formk))
                     result-form)))