¨

10.2.12.1 Clauses

Clauses are the building blocks of Prolog programs. There are two types of clause: facts and rules.
A fact is of the form:

head.
where head is the head of the clause. head may be an atom or a compound term whose functor is any atom except :-. The fact is terminated by a ’.’ followed by a white space character (e.g. a space, or a carriage return).

A rule is of the form:

head :- t 1 , t 2 ,..., t k . (1 £ 1)

where head is the head of the clause and the terms to the right of “:-” are the body of the clause. Each t k is known as a call term or goal. A call term must be an atom (a 0- argument call), a compound term, or a variable name. The rule is terminated by a '.' followed by a white space character.

The functor of the head of a clause is the predicate that the clause describes. All the clauses describing a given predicate comprise its definition. The arity of a clause is the number of arguments in its head.

All clauses describing a predicate must be in a single source file unless the predicate is declared as multifile).blockquote>