[top] [up] [next]

Type testing of terms


It is possible to test the type of terms, there are eight predefined clauses that can be used for this. These are:  

Name / arity Explanation
atom/1 tests whether the argument is an atom (ISO)
atomic/1 succeeds if the argument is an atom or a floating point value or an integer (ISO)
compound/1 tests whether the argument is a compound term (ISO)
float/1 tests whether the argument is a floating point value (ISO)
integer/1 tests if the argument is an integer number (ISO)
nonvar/1 succeeds always except if the argument is an uninstantiated variable (ISO)
number/1 succeeds if the argument is a floating point value or an integer (ISO)
var/1 tests if the argument is an uninstantiated variable (ISO)

[top] [up] [next]

 

info@trinc-prolog.com