projog

3.13. var(X) - checks that a term is an uninstantiated variable.

var(X) succeeds if X is an uninstantiated variable.

Examples

?- var(abc).

no

?- var(1).

no

?- var(a(b,c)).

no

?- var([a,b,c]).

no

?- X=1, var(X).

no

?- var(X).
X = UNINSTANTIATED VARIABLE

yes

?- X=Y, var(X).
X = UNINSTANTIATED VARIABLE
Y = UNINSTANTIATED VARIABLE

yes

?- var(_).

yes