next up previous contents
Next: An Example using Up: The Box Model Previous: The Box Model

The Flow of Control

We illustrate the above with a textual representation of the simple program found in figure 5.1 using the Byrd box model. The flow of control is found in figure 5.2.

Figure 5.2: Illustrating Simple Flow of Control

The indentation is used here only to suggest an intermediate stage in the mapping from the visual representation of the boxes into their textual sequence.

Many Prolog trace packages that use this box model do no indenting at all and those that use indentation use it to represent the `depth' of processing. This depth is equivalent to the number of arcs needed to go from the root of the AND/OR execution tree to the current node.

Below, we have a snapshot of how the execution takes place ---``taken'' at the moment when Prolog backtracks to find another solution to the goal parent(X,Y). We show the backtracking for the same program using an AND/OR execution tree.

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