Make a possibly nondet goal semidet, i.e., succeed at
most once. Defined as:

once(Goal) :-
call(Goal), !.

once/1
can in many cases be replaced with ->/2.
The only difference is how the cut behaves (see !/0). The following two
clauses below are identical. Be careful about the interaction with
;/2. The library(apply_macros)
library defines an inline expansion of once/1,
mapping it to (Goal\send{true};fail). Using the full
if-then-else constructs prevents its semantics from being changed when
embedded in a ;/2
disjunction.

1) a :- once((b, c)), d.
2) a :- b, c -> d.

Tag confusing pages with doc-needs-help|Tags are associated to your profile if you are logged in