next up previous contents
Next: Rules Up: Knowledge Representation Previous: Goals and Clauses

Multiple Clauses

A predicate may be defined by a set of clauses with the same predicate name and the same number of arguments.

We will therefore informally describe the way in which this is handled through an example. The logical statement (in first order form)

 
squared(1,1)squared(2,4)squared(3,9)

is to be represented as three distinct Prolog clauses.

 
squared(1,1).

squared(2,4).

squared(3,9).

Note that this way of turning a conjunctive statement into Prolog is one of the fundamental restrictions previously mentioned. There are more to follow.

All the above clauses are unit clauses ---this is not a necessary requirement. See section 2.12 for an example with both unit and non-unit clauses.

We now introduce a graphical representation which will be used in a number of different ways. The idea we use here is to represent a program (in this case, consisting of a set of unit clauses) as a tree.

This tree is an example of an OR tree.

It might have been expected that we would call this an AND tree but, when we are trying to determine whether a statement such as squared(1,1) is true then we might use either the first clause or the second or the third and so on.

 



Paul Brna
Mon May 24 20:14:48 BST 1999