• 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
            • Raise
            • 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
    • Support
    • Define
    • Er

    Raise

    Shorthand for causing hard errors.

    (raise &rest args) is equivalent to (er hard? ...), but it automatically fills in the function name using __function__.

    This only works in contexts where __function__ is bound, e.g., the body of a define or within a defconsts form. In these contexts, rather than write something like:

    (er hard? __function__ "bad input value ~x0~%" x)

    You can just write:

    (raise "bad input value ~x0~%" x)

    Logically raise just returns nil.

    Macro: raise

    (defmacro raise (&rest args)
      (cons 'er
            (cons 'hard?
                  (cons '__function__ args))))