This introduces a simple network that is used for several examples in these
Modules. This part deals with how to represent the network as Prolog facts.
This builds on material from Module 1, where it was shown that queries could be made up of several goals, linked to each other by the comma. In this part, it is shown that the
routes can be found round the network by writing queries with one or more goals.
It is shown that it is possible to draw a diagram of all the possible routes through
the network in the form of a tree. Two methods of working through the tree to find
all the possible routes from a to b are given. These methods can be
thought of as algorithms, and are commonly known as "breadth-first" and
"depth-first".
Rules are introduced. They have a head followed by a body
which could be made up of several goals, linked to each other by the comma. Prolog
rules are gathered into procedures which are referred to by their
functor and their arity.