Procedure diagrams

Operation diagrams

Operations will be represented in procedure diagrams by structures of the following type:

This is apparently hardly more than a minor modification of the very first diagram we used,

but the differences have important consequences.

In an operation diagram, there will be as many boxes to the right of the procedure name as the procedure requires inputs. Each box holds one input. The box to which the arrow leads holds the one and only one output of the procedure. If we want to connect two (or more) procedures, we simply overlay the output box of any one procedure onto one of the input boxes of another. The diagram equivalent to first last [cat dog], with the the indirect input boxes waiting to be filled, is therefore:

You will notice that, thanks to the left pointing arrows, the words and lists of the diagram can be projected onto a line to derive the corresponding LOGO expression. If we now work out and insert the outputs as in the diagram below, we can see clearly that first eventually outputs the word "d. Another way to say this is to say that the expression as a whole evaluates to "d. In fact, first last [cat dog] may be used wherever we can use "d. In a sense it is just another way to write "d.

Command diagrams

Since commands, unlike operations, have effects rather than outputs - which means that they cannot provide inputs to other procedures - we need a different convention for them. As a reminder that there are no outputs, commands will be represented with a double line - like a moat - enclosing the procedure and its inputs, as follows:

Instruction diagrams

Combining these conventions, it is now easy to diagram a complete instruction such as print word last [horse bike car] first [pet farm wild]

Or with the resulting outputs provided:

Given these diagrams, you can probably figure out without too much difficulty that word is an operation which takes two inputs - which are themselves words - and outputs a new word formed by stringing the two inputs together.

Ron Brasington
Department of Linguistic Science
The University of Reading