• 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
        • 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
        • 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
          • 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$
          • 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

    Error1

    Print an error message and cause a ``soft error''

    (Error1 ctx summary str alist state) returns (mv t nil state). An error message is first printed using the ``context'' ctx, as well as the string str and alist alist that are of the same kind as expected by fmt — unless error output is inhibited (see set-inhibit-output-lst and with-output) or summary is non-nil, in which case it is a string, and error output of that type is inhibited (see set-inhibit-er). See fmt.

    Error1 can be interpreted as causing an ``error'' when programming with the ACL2 state, something most ACL2 users will probably not want to do; see ld-error-triples and see er-progn. In order to cause errors with :logic mode functions, see hard-error and see illegal. Better yet, see er for a macro that provides a unified way of signaling errors.

    As mentioned above, error1 always returns (mv t nil state). But if a call (error1 ctx summary str alist) is encountered during evaluation, then unless output is inhibited as described above, the string str is first printed using the association list alist (as in fmt). Here is a trivial, contrived example.

    ACL2 !>(error1 'my-context
                   "Printing 4: ~n0"
                   (list (cons #\0 4))
                   state)
    
    ACL2 Error in MY-CONTEXT:  Printing 4: four
    
    ACL2 !>