• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Mutual-recursion
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Loop$-primer
        • Fast-alists
        • Defmacro
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • System-attachments
        • Developers-guide
        • 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
          • Value-triple
          • Error-checking
          • Er
          • Assert-event
          • Error-triple
          • Set-warnings-as-errors
          • Hard-error
          • Set-inhibit-er
          • Must-fail
          • Breaks
          • Assert!-stobj
          • Ctx
          • Must-eval-to
          • Assert!
          • Must-succeed
          • Assert$
            • Assert?
          • Illegal
          • Er-progn
          • Error1
          • Ctxp
          • Er-hard
          • Must-succeed*
          • Toggle-inhibit-er
          • Assert*
          • Assert?
          • Er-soft+
          • Er-hard?
          • Must-fail-with-soft-error
          • Must-fail-with-hard-error
          • Must-fail-with-error
          • Break$
          • Must-eval-to-t
          • Er-soft-logic
          • Er-soft
          • Convert-soft-error
          • Toggle-inhibit-er!
          • Set-inhibit-er!
          • Must-not-prove
          • Must-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
        • 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
  • Errors
  • ACL2-built-ins

Assert$

Cause a hard error if the given test is false

General Form:
(assert$ test form)

where test returns a single value and form is arbitrary. Semantically, this call of assert$ is equivalent to form. However, it causes a hard error if the value of test is nil. That hard error invokes the function illegal, which has a guard that is equal to nil; so if you use assert$ in code for which you verify guards, then a proof obligation will be that the occurrence of test is never nil.

See also assert*. Both assert$ and assert* create a guard proof obligation (when used in a definition made in logic-mode). However, assert$ checks the assertion at runtime, while assert* does not.

Also see assert-event for an assertion-checking utility that is an event.

Subtopics

Assert?
A variation of assert$ with customizable context and message.