Clauses


next up previous contents
Next: Program components
Up: Introduction to Prolog for Mathematicians
Previous: An example of Prolog

Clauses

Prolog programs are written as a sequence of clauses. Each has the form

predicate( argument, argument, ... ).
or
predicate( argument, argument, ... ) :-
    predicate( argument, argument, ... ),
    predicate( argument, argument, ... ),
    ... .

, means ``and''.

:- means ``if''.

All clauses are Horn clauses: one goal, implied by a conjunction of other goals (possibly none).



Jocelyn Ireson-Ireson-Paine
Mon Jul 17 22:27:41 BST 1995