CHAPTER 3
Reference to Objects Undergoing Transformation
3.1 Movement
The graphics language would be greatly improved if it had the facilities for representing the movement of an object about the screen. Normally this is done by redrawing the object in background colour to delete it and then redrawing it yet again in a new position. It can be done with the fmal coordinate positions to produce the effect of instantaneous displacement, or it can be done for successive intermediate positions to produce the effect of gradual translation to its new position. Let us assume that the latter is preferred.
One complication involved in implementing this as a single move command is that the segment of code (for example a group of three line-drawing expressions) will vary, and must be supplied as a parameter to the move command. That is, move will refer to and must be matched with a segment of internal text which has already been defined, and will call and re-call that segment several times while varying the parameter values (P,Q,R). There would also need to be a default value for step size.
Let the required statement in the internal representation take the form:
Form 1
For example:
To make the system more flexible it would also be desirable to allow the move statement to use a relative displacement vector rather than starting and fmal parameter values. Such a statement might have the form:
Form 2
Even this is not entirely convenient for users, who cannot be expected to remember the exact parameter values at all times. A more convenient form for the natural language interface would be
Form 3
e.g.: 'move the triangle upwards by 10 units quickly.'
In Form 3 the is some statement or set of statements
which will identify the appropriate segment of code with the existing (or starting) parameter values. In Form 2 the first parameter was an exact representation (or copy) of the statements to be found. In Form 3, however, the first parameter should be some simple identifier for the set of statements as a single unit. The flfSt parameter of Form 3 therefore provides the information for the fIrst two parameters of Form 2, the direction and distance parameters of Form 3 correspond to the vector parameter of Form 2, and the speed parameter of Form 3 corresponds to the step parameter of Form 2. Either Form 2 or Form 3 will therefore be adequate for our purposes. Form 2 is closer to the facilities often provided in programming languages, while Form 3 is closer to the structure of the natural language statements we might expect from our users.
Once we know what is required of the graphics language implementation we can assume it has been provided by some assiduous systems programmer and concentrate our attention on the implications for the natural language interpretation.
3.2 Reference Associated with 'Move'
The fact that move must refer to a segment of internal text which has already been defined means that we require some method of collecting a group oflines of code in the internal text into a single unit and giving it a single name or identity. This in turn means that while a concept such as 'triangle' can be translated into the equivalent set of three line drawing statements, it must not be allowed to lose its identity as a triangle. There must at least be the means of redefining the group of isolated lines as a group. This requirement was identified in section 2.6 where we used the example:
To this we can now add the statement 'Move it upwards 10 units.'.
The 'it' in this case is the group of three line drawing statements which were identified as corresponding to the concept 'triangle'. It is not sufficient simply to identify the three lines as we did in section 2.6. We must, in effect, place a 'box' round them and give them a collective identifier. This identifier becomes the value of the first parameter of move (Form 3). Remember that the set oflines may not actually occur sequentially in the internal text. They could be distributed throughout a much larger segment of code with many other lines of code occurring between them.
To allow for ease of reference every entity (line or point or triangle) could be given an identifying number (id). It would then be possible to construct a kind of symbol table for these entities showing their sub-entities. A value table showing the coordinate positions of points would also be helpful. e.g.:
The move statement will call and re-call the appropriate group of statements (e.g. 'move if in our example, would refer to entity 7) and the subordinate parts (lines 3,5 and 6) would be called several times while varying the coordinate values of p, q and r (points 1,2 and 4). The behaviour ofthe move statement is rather like that of the for statement which is provided by most programming languages, but in the case of the move statement, the values of all parameters are modified together as a group at each iteration and not as a series of nested loops in which one parameter is modified at a time.
The hard question, and one which we do not intend to answer at this point, is what happens to the value table? Do we modify the value of the coordinates in the table, or do we merely use the table to find the starting values and leave it unmodified during the move operation?
An ATN for processing the move statement is shown in Figure 3.1. We have introduced in this ATN the notion of a 'noun phrase'. A noun phrase has the general pattern:
Here we have prefixed by a question mark (?) to show that it is optional, and is prefixed by both a question mark and an asterisk (?*) to show that it is optional and may occur several times. In this ATN and the associated notation we are anticipating the notation we will use in Chapter 9.
Note that the ATN contains arcs which are themselves full ATNs ('nounphrase' (NP) and 'parameters') and also an arc labelled 'reference c'. The latter corresponds to a condition of the noun phrase which is set 'true' when the noun phrase contains 'the' or consists simply of the word 'it'. Tracing that arc consists of searching backwards to find a match for the referent, (see Chapter 8) and the result is a pointer to that referent. Failure to find a referent results in failure to trace the arc.
3.3 The Multiplicity of a Reference Object
Suppose that we have processed the following statements:
What are we to make of the statement 'now make it blue'? We remarked in section 3.1 that the segment of code corresponding to the reference object would be called and recalled to produce the effect of movement on the screen. If, however, we change the colour parameter of the appropriate line drawing statements we will change the colour for the whole of the process. The statement above, however, makes it clear that what is required is for the triangle to be moved (while retaining its original colour) and then changed to blue. 'It' in the last statement refers only to the triangle as it exists at the end of the moving process.
The problem is related to the one noted in the previous section: what happens to the coordinates in the value table when an entity is moved? Briefly we have a requirement to distinguish between the various 'incarnations' of the triangleat the beginning of the move process, at the end, and at all of the intermediate stages. It would appear, however, that the 'calling and recalling' idea will make this impossible. A more appropriate method would therefore be to convert the various calls of the reference drawing code, into macro-expansions so that eachseparate incarnation of the triangle will correspond to a separate set of segments of code laid down in the internal text, which can then be separately referenced. The symbol table must also go through several incarnations, each corresponding to a different incarnation of the object in question. We have therefore not one, but many objects which are all separate manifestations or incarnations of a single object at different moments in time.
We shall refer to this phenomenon as 'the multiplicity of a reference object'.
3.4 The Persistence of a Reference Object
Providing a separate segment of code to represent each incarnation of a reference object solves the problem of multiplicity, but introduces a new problem. There are times when we want to refer to the entire set of incarnations and not just to one of them. If we had said 'make it blue' instead of 'now make it blue', then although the statement is ambiguous it might have been interpreted (reasonably) as meaning 'make it blue throughout the moving process'. There is a sense, therefore, in which the entity 'triangle' in this example can be said to transcend all its incarnations. That is, the identity of the triangle persists in spite of a change to the values of the coordinates of its vertices. The identity of 'it' can be (ambiguously) one of the incarnations or all the incarnations (collectively). This phenomenon - the notion that the identity of an object remains (or persists) even when the values of its parameters change - we shall call 'the persistence of a reference object'.
The difficulty in knowing whether a reference is to the general entity or merely to one of its instances (or incarnations) is a difficulty shared by humans and not peculiar to computerised natural language systems. It is one aspect of a problem
called referential opacity (or the lack of clarity of a reference). A classic example of referential opacity, much discussed by philosophers, concerns the way we should interpret the two phrases 'the evening star' and 'the morning star' It is an astronomical fact that both of these objects are the planet Venus, but can it be said that both statements refer 'to the same,thing'? One approach to the problem is to regard the two statements as referring to different incarnations of the same object.
To change the example, if I refer to 'the British Prime Minister', do I refer to the person who at the moment is the British Prime Minister (Margaret Thatcher at the time of writing), or do I refer to the collective idea or office of 'British Prime Minister' which has been in existence for centuries? If I say 'The British Prime Minister lives at 10 Downing Street' then I probably refer to the general notion, the office of Prime Minister and therefore by implication also to the present incumbent.
When the reference matching routine does its work, it must be able to return as its result a segment of internal code which it has found to be a match, and also a reference to the collection of occurrences of which this is one. Such a reference could be a list of identifiers to all occurrences. This list is then the general referent
itself.
We shall return to the topic of referential opacity later. One thing is clear, however. If an NL-system is to capture the subtleties of natural language it must be capable of identifying a reference both ways.
3.5 Transformation of Shape
The persistence of a reference object occurs even in cases where the shape of the object is changed so that it is no longer in the same shape classification. Consider, for example, the following statements.
In this sequence of commands, the entity to which 'it' refers undergoes extensive changes. By the sixth statement 'it' could refer to the line r-p, or it could refer to an instance of the general object which started as a square and has been transformed into a right-angled triangle as a result of the fourth and fIfth statements. The seventh statement suggests that the latter interpretation is correct, because the line r-p had no previous position whereas the general object (a previous instance) did have. The last statement seems to refer to the final instance of this general object.
These considerations suggest that the identity of reference-objects should not be dependent upon their properties at any given instant, although these may be used as an aid to identification in the pattern-matching process. An alternative view, which has often found expression in many 'knowledge representation languages' equates the identity of an entity with the possession of a set of properties which in turn confers set membership on the entity. This form of representation seems to overlook the possibilities of properties changing with time to the extent that the object has, for at least a period of time, none of the properties it had in its first incarnation. As an example, and one not too divorced from our micro-graphic world example, consider the modifications of shape, size and other properties which that object we refer to as 'Tom' undergoes during a Tom and Jerry animated cartoon - and all without losing the identity 'Tom'.
The classification of an object does depend to a degree upon its properties. It is important to bear in mind, however, that it is not necessary for an object to possess all of the anticipated (or default value) properties, or even to possess some of them all of the time. It is sufficient for an object to have possessed a characteristic sub-set of 'standard' properties at some time in its career for it to be given a particular classification.
We will return to these ideas many times.