Section "control"

The Dogelog player provides already correct handling of a conjunction and disjunction of goals in a Prolog clause body or in a Prolog query. This also extends to the cut. The conjunction and disjunction do not have a direct built-in since they are translated into internals. In particular the cut is mapped to '$CUT'/1 with an additional argument.

Example:
?- (X=1;X=2), !.
X = 1.

The built-in call/1 permits to perform meta-calls that are allowed to contain conjunction, disjunction and the cut. There are further predefined predicates that are bootstrapped in Prolog itself with or without the help of meta-calls. These predefined predicates mainly define conveniences related to control flow required by the ISO core standard.

The following control built-ins are provided:

true: [ISO 7.8.1]
The predicate succeeds.
A; B: [ISO 7.8.6]
The predicate succeeds whenever A or B succeed.
A -> B: [ISO 7.8.7]
The predicate succeeds when A succeeds and then whenever B succeed.
A, B: [ISO 7.8.5]
The predicate succeeds whenever A and B succeed.
!: [ISO 7.8.4]
The predicate removes choice points created in the current clause.
fail: [ISO 7.8.2]
The built-in fails.
repeat: [ISO 8.15.3]
The predicate succeeds repeatedly indefinitely.
call(G): [ÍSO 7.8.3]
The predicate succeeds whenever the goal G succeeds.
once(A): [ISO 8.15.2]
The predicate succeeds once if A succeeds.
\+ A: [ISO 8.15.1]
The predicate succeeds when A fails.
findall(T, G, L): [ISO 8.10.1]
The predicate succeeds in L with all T such that G succeeds.

Use Privacy (c) 2005-2026 XLOG Technologies AG