2.10.4.1 Control Flow Commands
Abort a Abort Prolog execution (see abort/0) Break b Enter a Prolog break environment (see break/0) Creep c Continue execution, stop at next port. (Also return
,space
)Exit e Terminate Prolog (see halt/0) Fail f Force failure of the current goal Find / Search for a port (see below for the description of this command (section 2.10.4.1)) Ignore i Ignore the current goal, pretending it succeeded Leap l Continue execution, stop at next spy point No debug n Continue execution in’no debug’mode Repeat find . Repeat the last find command (see’Find’(section 2.10.4.1)) Retry r Undo all actions (except for database and I/O actions) back to the call
port of the current goal and resume execution at thecall
portSkip s Continue execution, stop at the next port of this goal (thus skipping all calls to children of this goal) Spy + Set a spy point (see spy/1) on the current predicate. Spy points are described later in the overview (section 2.10.6). No spy - Remove the spy point (see nospy/1) from the current predicate. Spy points are described later in the overview (section 2.10.6). Up u Continue execution, stop at the next port of the parent goal (thus skipping this goal and all calls to children of this goal). This option is useful to stop tracing a failure driven loop.
Find (
) Description and Examples
/
The Find (/
) command continues execution until a port
matching a find pattern is found. After the /
, the user can
enter a line to specify the port to search for. This line consists of a
set of letters indicating the port type, followed by an optional term,
that should unify with the goal run by the port. If no term is specified
it is taken as a variable, searching for any port of the specified type.
If an atom is given, any goal whose functor has a name equal to that
atom matches. Examples:
/f Search for any fail
port/fe solve Search for a fail
orexit
port of any goal with namesolve
/c solve(a, _)
Search for a call to solve/2 whose first argument is a variable or the atom a
/a member(_, _)
Search for any port on member/2. This is equivalent to setting a spy point on member/2.