• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
          • Saving-event-data
          • Trans-eval
          • System-utilities-non-built-in
            • Pseudo-event-formp
            • Pseudo-event-form-listp
            • Directed-untranslate
            • Irrelevant-formals-info
            • Numbered-names
            • Context-message-pair
            • Prove$
            • Minimize-ruler-extenders
            • Paired-names
            • Orelse
            • Fresh-name-in-world-with-$s
            • Encapsulate-report-errors
              • On-failure
              • Chk-irrelevant-formals-ok
              • Named-formulas
              • Pseudo-event-landmarkp
              • All-program-fns
              • All-logic-fns
              • Trans-eval-error-triple
              • Trans-eval-state
              • Pseudo-tests-and-callsp
              • User-interface
              • Pseudo-command-landmarkp
              • Pseudo-tests-and-calls-listp
              • Pseudo-command-formp
              • Orelse*
              • Identity-macro
            • Get-event-data
            • Untranslate
            • Constraint-info
          • Stobj
          • State
          • Mutual-recursion
          • Memoize
          • Mbe
          • Io
          • Defpkg
          • Apply$
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Defconst
          • Fast-alists
          • Defmacro
          • Loop$-primer
          • Evaluation
          • Guard
          • Equality-variants
          • Compilation
          • Hons
          • ACL2-built-ins
          • Developers-guide
          • System-attachments
          • Advanced-features
          • Set-check-invariant-risk
          • Numbers
          • Efficiency
          • Irrelevant-formals
          • 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
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • System-utilities-non-built-in

    Encapsulate-report-errors

    Run encapsulate, but with a helpful error at the first failure of one of its top-level events (if any).

    This macro is equivalent to encapsulate except that it takes an extra argument, which is a context, that goes in the first position. Unlike encapsulate, it provides a helpful error if any of its given events fails. It uses that extra `context' argument in reporting that error. (But the error itself is reported by the event, with the usual context constructed for that event.)

    General Form:
    
    (encapsulate-report-errors ctx signature-list event1 event2 ... eventk)

    where ctx is a context, signature-list is a list of signatures, and each eventi is an embedded-event-form. Note that none of these arguments is evaluated. Thus, a typical call might be laid down as follows.

    `(encapsulate-report-errors ,ctx () ,@events)

    Normally, if if any of the given events (shown above as ``event1 event2 ... eventk'') fails, then the output will conclude as follows, where here we write <CTX> to denote the formatted context and <EV> to denote the failed event printed in abbreviated form.

    ACL2 Error in <CTX>:  The following event has caused an
    unexpected error:
    
    <EV>
    
    Please contact the implementor of the tool that you are using.

    However, if the event is of the form (on-failure ...), then the specified failure message is printed instead of this generic one. See on-failure.