true [ISO]

This predicate always succeeds, it forces to exit the current goal and continue with the next goal.

see also: always/2 call/1 catch/2 catch/3 fail/0 halt/0 halt/1 if-then/2 if-then-else/2 once/1repeat/0 throw/1

Suppose the current compiled module contains the following predicates:

test1(_) :-
    fail.
test1(_) :-
    true.

 

Examples
test1(O). A single solution is found because the second alternative is exited after the first one fails. The goal variable will be empty.
(fail ; true). Succeeds because after fail/0 has failed the ;/2 operator selects the true/0 predicate and that succeeds.

 

 

info@trinc-prolog.com