assert()
macro. It has no effect if Goal
succeeds. If Goal fails or throws an exception, the following
steps are taken:
- call prolog:assertion_failed/2.
If prolog:assertion_failed/2
fails, then:
- If this is an interactive toplevel thread, print a message, the stack-trace, and finally trap the debugger.
- Otherwise, throw
error(assertion_error(Reason, G),_)
where Reason is one offail
or the exception raised.