Documentation Prolog Predicate Reference builtin forall/2

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

Example #1 Example of forall/2

equal(3, 1+2). equal(24, 6*4). equal(1, 5 mod 2). ?- forall(equal(Left, Right), Left =:= Right). % true

Implementation