A
* Compound Term*
is a
* functor*
with a (fixed) number of
* arguments*
each of which
may be a ** Prolog**
* term*.

This means that we can arbitrarily nest compound terms. For some examples:

happy(fred)principal functor = happy

1st argument = a constant (atom)

sum(5,X)

principal functor = sum

1st argument = constant (integer)

2nd argument = variable

not(happy(woman))

principal functor = not

1st argument = compound term

Nesting compound terms may be of use to the programmer. For example, the clause

is not as informative asfact(fred,10000).

which can be thought of as defining a PASCAL-type record structure.fact(name(fred),salary(10000)).

Mon May 24 20:14:48 BST 1999