- Reference manual
- Built-in Predicates
- Notation of Predicate Descriptions
- Character representation
- Loading Prolog source files
- Editor Interface
- List the program, predicates or clauses
- Verify Type of a Term
- Comparison and Unification of Terms
- Control Predicates
- Meta-Call Predicates
- Delimited continuations
- Exception handling
- Handling signals
- DCG Grammar rules
- Declaring predicate properties
- Examining the program
- Input and output
- Status of streams
- Primitive character I/O
- Term reading and writing
- Analysing and Constructing Terms
- Analysing and Constructing Atoms
- Localization (locale) support
- Character properties
- Character Conversion
- Misc arithmetic support predicates
- Built-in list operations
- Finding all Solutions to a Goal
- Formatted Write
- Global variables
- Terminal Control
- Operating System Interaction
- File System Interaction
- User Top-level Manipulation
- Creating a Protocol of the User Interaction
- Debugging and Tracing Programs
- Obtaining Runtime Statistics
- Execution profiling
- Memory Management
- Windows DDE interface
- Built-in Predicates
- Reference manual
Type tests are semi-deterministic predicates that succeed if the
argument satisfies the requested type. Type-test predicates have no
error condition and do not instantiate their argument. See also library
- True if Term currently is a free variable.
- True if Term currently is not a free variable.
- True if Term is bound to an integer.
- True if Term is bound to a floating point number.
- True if Term is bound to a rational number. Rational numbers include integers.
- rational(@Term, -Numerator, -Denominator)
- True if Term is a rational number with given Numerator and Denominator. The Numerator and Denominator are in canonical form, which means Denominator is a positive integer and there are no common divisors between Numerator and Denominator.
- True if Term is bound to an integer or floating point number.60As rational numbers are not atomic in the current implementation and we do not want to break the rule that number/1 implies atomic/1, number/1 fails on rational numbers. This will change if rational numbers become atomic.
- True if Term is bound to an atom.
- blob(@Term, ?Type)
- True if Term is a blob of type Type. See section 12.4.8.
- True if Term is bound to a string. Note that string here
refers to the built-in atomic type string as described in section
5.2. Starting with version 7, the syntax for a string object is
text between double quotes, such as
"hello".61In traditional Prolog systems, double quoted text is often mapped to a list of character codes. See also the Prolog flag double_quotes.
- True if Term is bound (i.e., not a variable) and is not
compound. Thus, atomic acts as if defined by:
atomic(Term) :- nonvar(Term), \+ compound(Term).
SWI-Prolog defines the following atomic datatypes: atom (atom/1), string (string/1), integer (integer/1), floating point number (float/1) and blob (blob/2). In addition, the symbol
(empty list) is atomic, but not an atom. See section 5.1.
- True if Term is bound to a compound term. See also functor/3 =../2, compound_name_arity/3 and compound_name_arguments/3.
- True if Term is bound to an atom or a compound term. This was
intended as a type-test for arguments to call/1
Note that callable only tests the surface term. Terms such as
(22,true) are considered callable, but cause call/1
to raise a type error. Module-qualification of meta-argument (see meta_predicate/1)
causes callable to succeed on any meta-argument.62We think that callable/1 should be deprecated and there should be two new predicates, one performing a test for callable that is minimally module aware and possibly consistent with type-checking in call/1 and a second predicate that tests for atom or compound. Consider the program and query below:
:- meta_predicate p(0). p(G) :- callable(G), call(G). ?- p(22). ERROR: Type error: `callable' expected, found `22' ERROR: In: ERROR:  p(user:22)
- True if Term holds no free variables. See also nonground/2 and term_variables/2.
- True if Term contains cycles, i.e. is an infinite term. See also acyclic_term/1 and section 2.17.63The predicates cyclic_term/1 and acyclic_term/1 are compatible with SICStus Prolog. Some Prolog systems supporting cyclic terms use is_cyclic/1 .
- True if Term does not contain cycles, i.e. can be processed recursively in finite time. See also cyclic_term/1 and section 2.17.