• 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
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • 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
          • Er
          • Value-triple
          • Error-checking
          • Error-triple
          • Assert-event
          • Set-warnings-as-errors
          • Hard-error
          • Set-inhibit-er
          • Must-fail
          • Assert!-stobj
            • Breaks
            • Must-eval-to
            • Ctx
            • Assert!
            • Must-succeed
            • Assert$
            • Ctxp
            • Illegal
            • Er-progn
            • Error1
            • Er-hard
            • Must-succeed*
            • Toggle-inhibit-er
            • Break$
            • Assert*
            • Assert?
            • Er-soft+
            • Er-hard?
            • Must-fail-with-soft-error
            • Must-fail-with-hard-error
            • Must-fail-with-error
            • Must-eval-to-t
            • Er-soft-logic
            • Er-soft
            • Convert-soft-error
            • Toggle-inhibit-er!
            • Set-inhibit-er!
            • Must-prove
            • Must-not-prove
            • Must-fail!
            • Must-be-redundant
            • Must-succeed!
            • Must-fail-local
            • Assert-equal
          • 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
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Std/testing
    • Assert-event
    • Errors

    Assert!-stobj

    Variant of assert! and assert-event allowing stobjs

    The assert!-stobj macro is a variant of assert! that expects its first argument to evaluate to multiple values, specifically, two values where the first is not a stobj and the second is a specified stobj. Assert!-stobj is an event macro: its calls may appear as top-level events in books as well as encapsulate and progn forms. As with assert!, calls of assert!-stobj directly abbreviate corresponding calls of the built-in event macro, assert-event. You may find it more convenient to use assert-event, which has more options. In particular, with assert-event the assertion may evaluate to a single value or to any number of multiple values, with no limit on the number of stobjs retured, and a keyword option :STOBJS-OUT :auto that makes it unnessary to to specify the shape of the return.

    See assert$ and assert* for assertion-checking utilities to use in programs.

    Example Forms:

    (assert!-stobj (mv-let (erp val state)
                     (set-inhibit-output-lst nil)
                     (declare (ignore val))
                     (mv (null erp) state))
                   state)
    
    (defstobj st fld)
    (assert!-stobj (let ((st (update-fld 3 st)))
                     (mv (eql (fld st) 3)
                         st))
                   st)

    General Forms:

    (assert!-stobj assertion st)
    (assert!-stobj assertion st event)

    where: assertion evaluates to multiple values (mv val st), where val is an ordinary value and st — which is the second argument above — is a stobj (either user-defined or state); and event, if supplied and non-nil, is an event to be evaluated if the first return value is not nil. It is an error if the first return value is nil. As noted above, a call of assert!-stobj is an event: it can go into a book or an encapsulate or progn event.

    Calls of assert!-stobj skip evaluation of the given assertion when proofs are being skipped: during include-book, during the second pass of an encapsulate event, and after evaluating (set-ld-skip-proofsp t state).

    The two General Forms above may be expressed, respectively, in terms of the more flexible built-in event macro, assert-event, as follows. See assert-event for more detailed documentation.

    (assert-event assertion
                  :stobjs-out '(nil st)
                  :ctx ''assert!-stobj)
    (assert-event assertion
                  :stobjs-out '(nil st)
                  :event event
                  :ctx ''assert!-stobj)