Type Checking

The following predicates take a term as their argument. They are provided to check the type of that term.


Predicate
Succeeds if term is:
var/1
a variable; the term is currently uninstantiated.
nonvar/1
a non-variable; the term is currently instantiated.
integer/1
an integer
atom/1
an atom
float/1
a float
number/1
an integer or float.
atomic/1
an atom, number or database reference.
simple/1
an atom, number, variable or database reference.
compound/1
a compound term (arity > 0).
callable/1
a term that call/1 would take as an argument; atom or compound term.
ground/1
ground; the term contains no uninstantiated variables.
db_reference/1
a Prolog database reference

Please note: Although database references are read and written as compound terms, and formerly were, they now are a distinct atomic term type (see ref-mdb-dre).

The reference pages for these predicates include examples of their use.