gated_call/4¶
gated_call(0:Setup, 0:Goal, ?Port, 0:Handler)*
This predicate watches over execution of Goal:
-
First, it calls
once(Setup); -
Next, it executes
call(Goal); -
if
call(Goal)succeeds deterministically, it unifies Port withexitand if unification succeeds calls Handler; -
if
call(Goal)succeeds not-deterministically, it unifies Port withanswerand if unification succeeds calls Handler; -
if execution backtracks to Goal, it unifies Port with
redoand if unification succeeds calls Handler; -
if execution of Goal fails, it unifies Port with
failand if unification succeeds calls Handler; -
if execution of Goal is pruned by an external goal, it unifies Port with
!and if unification succeeds calls Handler; -
if execution of Goal raises an exception E, it unifies Port with
exception(E)and if unification succeeds calls Handler; -
if Goal has open alternatives that are discared by an exception E, it unifies Port with
external_exception(E)and if unification succeeds calls Handler.