term type testing, atom, atomic, compound, float, integer, nonvar, number, var

It may be useful to be able to test if a term is an number or a variable or something else. Prolog provides several such tests:

Goalsucceeds if X is …
var(X)an uninstantiated variable
nonvar(X)not a variable, or is an instantiated variable
compound(X)a compound term - not an unbound variable, and not atomic (see below)
atom(X)an atom, or bound to an atom
integer(X)an integer, or bound to an integer
float(X) a floating point (fractional) number such as 3.5 or 1.0, or bound to one - but, if float(X) is evaluated using is, then you get this float
number(X)a number, or bound to a number (integer or float)
atomic(X)a number, string, or atom, or bound to one