Next: ref-ere-sum, Previous: ref-ere-leg, Up: ref-ere [Contents][Index]
There exist more drastic means of interrupting the normal control flow. To invoke a recursive top level, use:
?- break.
See mpg-ref-break.
To exit from Prolog, use:
?- halt.
To exit from Prolog with return code Code, use:
?- halt(Code).
See mpg-ref-halt.
To abort the execution of the current query and return to the top level, use:
?- abort.
See mpg-ref-abort.
Please note:
halt/[0,1]
andabort/0
are implemented by throwing a reserved exception, which has a handler at the top level of development systems and executables built with thespld
tool. Thus they give the opportunity for cleanup goals (seecall_cleanup/2
) to run.