Documentation forall/2
Related predicates
available from version beta

forall/2

Check an action for all alternative bindings.

Description

forall( +callable_term, +callable_term )

forall(Condition, Action) checks that for all alternative bindings of Condition, Action can be proven.

The semantics is the same as:

forall(Condition, Action) :- \+ (Condition, \+ Action).

Examples

published on 2019-09-13
equal(3, 1+2).
equal(24, 6*4).
equal(1, 5 mod 2).

?- forall(equal(Left, Right), Left =:= Right). % true

Implementation