Implementing the system (1)

A first stab at the problem

If we follow the analogy with Consequences closely, a very simple Lonely Hearts microworld would require no more than

  1. a set of subprocedures each one (like the individual players of Consequences) generating one constituent of the total message, using pickrandom to guarantee variety


  2. a superprocedure (replicating the unfolding of the paper) which would join all their outputs together in one correctly ordered sentence.

The subprocedures

The subprocedures are easy enough to handle. For example, the procedure someone might be defined like this:

to someone
op pickrandom [[high court judge][double glazing salesman][ex convict] . . . ]

Other subprocedures would directly follow suit differing merely in the list pickrandom selects from.

The superprocedure

The only apparent difficulty is with the superprocedure. You have already met the primitive sentence (se for short) and discovered that it takes two inputs the contents of which it outputs concatenated in a list. Se is clearly doing the right kind of thing, but for our purposes we need to combine more than just two objects. We need to built a list containing the outputs of someone (twice), seeks why and how. All is not lost, however. if you remember that the output of one procedure can provide the input to another. If se combines two objects to output a list, then that output list can be combined with something else by another se to output a yet larger list, and why stop there! What this means in our case is that it is possible to define the superprocedure (let's call it lonely) by using se as follows:

to lonely
op se someone se seeks se someone se why  how
True, this looks rather messy, but really it is much less complicated than it might at first seem. You simply have to keep in mind that every se in the line has two inputs - despite appearances. The rightmost se is supplied with inputs by the subprocedures why and how; in all the other cases the second input to the se is provided by another subordinate se. An instruction diagram shows clearly what is going on:

If you still feel unhappy with this type of construction, then breathe a sigh of relief because the same effect can be obtained in a different fashion. In the case of certain procedures LOGO allows flexibility in the number of inputs which are accepted on condition that it is warned in advance. Sentence, by default takes two objects, but it may, if you wish, take three or four or more. To signal your intention to use the procedure in this way you merely write a left parenthesis before the procedure name and then - after as many inputs as are necessary - you close the expression with a right parenthesis. If we use this convention, our definition of lonely can be shortened (and simplified?) to:

to lonely
op (se someone seeks someone why how)

Ron Brasington
Department of Linguistic Science
The University of Reading