^/2

Synopsis

+X ^ +*P

Equivalent to "there exists an X such that P is true", thus X is normally an unbound variable. The use of the explicit existential quantifier outside setof/3 and bagof/3 is superfluous.

Arguments


X term

P callable [MOD]

Description

Equivalent to simply calling P

Exceptions

As for call/1:


type_error

context_error

instantiation_error

Examples

Using bagof/3 without and with the existential quantifier:

     | ?- bagof(X, foo(X,Y), L).
     
     X = _3342,
     Y = 2,
     L = [1,1] ;
     
     X = _3342,
     Y = 3,
     L = [2] ;
     
     no
     
     | ?- bagof(X, Y^foo(X,Y), L).
     
     X = _3342,
     Y = _3361,
     L = [1,1,2] ;
     
     no
     
ref-all-cse-equ

See Also

setof/3, bagof/3