File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/80/j80-2001_metho.xml
Size: 48,077 bytes
Last Modified: 2025-10-06 14:11:16
<?xml version="1.0" standalone="yes"?> <Paper uid="J80-2001"> <Title>Toward Natural Language Computation 1</Title> <Section position="5" start_page="0" end_page="0" type="metho"> <SectionTitle> 4. Syntax </SectionTitle> <Paragraph position="0"> Most of the sentences processed by the system can be thought of as imperative verbs with their associated operands. For example, the sentence &quot;Add the first and last positive entries in row 1 and the second to smallest entry in the matrix to each entry in the last row.&quot; exhibits the overall form (add x to y) where x is the noun group &quot;the first and last ... in the matrix&quot; and y is &quot;each entry in the last row&quot;. The system separately processes constructions related to the imperative verbs and those related to noun groups. The following two sections discuss these types of constructions. Then, Section 4.3 describes a method for rejecting certain kinds of syntactically correct but semantically unacceptable parses, Section 4.4 describes our approach to hand.ling syntactic ambiguity, and Section 4.5 gives the form of the output for the parser.</Paragraph> <Section position="1" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 4.1 Imperatives And Their Operands </SectionTitle> <Paragraph position="0"> A transition net for processing the above imperative form for &quot;add&quot; is shown in Figure 5. The word PARSE means to call routines appropriate for parsing the indicated construct. IMPERATIVE refers to the imperative verb, and NG refers to the noun group.</Paragraph> <Paragraph position="1"> VERBICLE refers to a particular type of preposition which is often associated with an imperative verb to distinguish its operands. Thus in the sentences &quot;Multiply x by y.&quot; &quot;Store x in y.&quot; the words &quot;by&quot; and &quot;in&quot; are verbicles. Of course, any given imperative will have only a few acceptable verbicles, so the parser checks that a suitable one is found. &quot;add X to Y&quot;.</Paragraph> <Paragraph position="2"> American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 75 Alan W. Biermann and Bruce W. Ballsrd Toward Natural Language Computation Although the routine of Figure 5 might be adequate for a large fraction of the sentences received by NLC, we decided to formulate a facility for handling a wide variety of conjunctions \[33\]. Toward this goal, a routine called MIX was designed as shown in Figure 6.</Paragraph> <Paragraph position="3"> Suppose A is a given construct and suppose xl, x2, and x3 are instances of that construct. Then MIX A will process forms such as xl xl and x2 xl, x2, and x3 xl and x2 and x3 and others. If, for example, A represents the imperative clause construct, then MIX A will process &quot;Add yl to y2, add y3 to y4, and add y5 to y6.&quot; If A is the unconjoined noun group, then MIX A will process &quot;row 1, row 2, and row 3.&quot; ings of conjunctions. For example, these routines will parse the sentence &quot;Add yl to y2, to y3, and to y4 and y5 to y6 and add y7 to y8.&quot; Of course, not all verbs take two operands and a verbicle as in the examples above. Indeed, verbs such as &quot;call&quot; have two operands without a verbicle: &quot;Call the matrix x.&quot; (Call yl y2.) There are also one-operand verbs which take a particle, such as &quot;add up&quot;. Particles present a special problem since they can appear in various positions in the sentence; NLC handles most of the common placements. Many one-operand verbs appear without particles as in &quot;Double row 1.&quot; (Double yl.) and there are verbs that take no operand: either with a particle, as in &quot;Back up.&quot; or without a particle, as in &quot;Quit.&quot; Most of the imperatives handled by NLC fall into one or more of the six categories listed above: zero, one, or two operands, with or without a verbicle/particle. The conjunction handling described above extends to all of these types of imperatives in a natural way. Although NLC has facilities for accepting imperatives with more than two operands or with formats other than those given here, a large proportion of all imperatives in our domain do fit into the simple scheme given here.</Paragraph> </Section> <Section position="2" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 4.2 Noun Group Syntax </SectionTitle> <Paragraph position="0"> Four types of noun groups appear in the sentences processed by NLC. The most common type refers to the entities on the NLC display screen: numbers, entries, rows, matrices and so forth. These are the noun groups that appear as operands for the imperative verbs. Many examples appear in previous sections. The second type of noun group is the noun</Paragraph> </Section> <Section position="3" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 76 American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 </SectionTitle> <Paragraph position="0"> Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation result group, which refers to the result of a computation. Some examples are &quot;the sum of rows 1 and 2&quot; and &quot;the absolute value of x&quot; where in each case the object being referred to appears not on the screen but is found by manipulating displayed objects. The third type of noun group is the noun place group, as illustrated by &quot;bottom&quot; in &quot;Add the second from bottom row to row 3.&quot; &quot;Bottom&quot; in this example is the place from which the ordinal processor begins counting. Some other words that can fit into this slot are &quot;right&quot;, &quot;left&quot;, &quot;top&quot;, and &quot;last&quot;. The fourth type of noun group is the noun procedure group, which refers to a procedure, a command, or a set of commands in the NLC input. This type is illustrated in &quot;Repeat the last three commands ten times.&quot; &quot;Double the entries the third command incremented.&quot; Only the operand noun groups will be discussed in detail here.</Paragraph> <Paragraph position="1"> Operand level noun groups follow a format similar to the one given by Winograd\[37\]. Let OPT be a routine which optionally calls a set of routines. As an illustration, OPT DETERMINER calls routines to parse a determiner. If those routines fail, however, OPT succeeds anyway, assuming that the noun group exists without a determiner. The basic format for the operand level noun group parser, given in Figure 8, is completely exercised by the noun group &quot;the first three positive matrix 1 entries QUALIFIER: which are odd Since OPT is used to look for most of the constituents, the parser analyzes noun groups with those elements missing. (Examples: &quot;the positive entries&quot;, &quot;seven numbers greater than 10&quot;, &quot;the smallest entry&quot;, etc.) Constructs of the form &quot;row 1&quot;, &quot;columns 2 and 3&quot;, or &quot;the constant 4.5&quot; require separate recognition. The DETERMINER routine parses not only the simple determiners &quot;the&quot; and &quot;a/an&quot; but also a variety of quantifiers such as &quot;all&quot;, &quot;all of the&quot;, &quot;both&quot;, &quot;no more than six of the&quot;, &quot;exactly two of the&quot;, and many others. The ORDINAL routine processes the common ordinals &quot;first&quot;, &quot;second&quot;, &quot;next&quot;, and &quot;last&quot;, which can also appear with superlatives (&quot;second greatest&quot;) or with modifiers (&quot;second from right&quot;, &quot;second from last&quot;).</Paragraph> </Section> </Section> <Section position="6" start_page="0" end_page="0" type="metho"> <SectionTitle> 6. Rank-shifted clauses: </SectionTitle> <Paragraph position="0"> &quot;the entries COLUMN 2 CONTAINS&quot; Many types of conjoined phrases are processed using the MIX routine as in &quot;the first and last entries&quot;, &quot;the first two and last three entries&quot;, &quot;the first two and the last three entries&quot;, and others. Noun groups may be nested within other noun groups as illustrated in American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 77 Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation &quot;the largest entry in the first row of the matrix containing the column that was doubled by the second to last command&quot;</Paragraph> <Section position="1" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 4.3 Semantic Checking During Syntactic Processing </SectionTitle> <Paragraph position="0"> If the parser is provided with some information about the types of nouns and the relationships they may have with each other, it can reject inappropriate parses. As an illustration, in the following phrase a possible parse of the qualifiers is as indicated by the parentheses.</Paragraph> <Paragraph position="1"> the entry (in row 2 (in column 3) ) That is, row 2 is &quot;in&quot; column 3 and the entry being referred to is in that row 2. However, in an ordinary matrix it is not possible for a row to be contained in a column and so it is desirable that this parse be rejected. The correct parse will be found if it is known that row-in-column is a disallowed pattern, forcing &quot;row 2&quot; to stand alone as a noun group: the entry (in row 2) (in column 3) Thus both the qualifiers &quot;in row 2&quot; and &quot;in column 3&quot; modify the noun &quot;entry&quot;. Since entry-in-row and entry-in-column are semantically acceptable patterns, this parse can be passed to the semantics processor.</Paragraph> <Paragraph position="2"> Observations of this type lead to the concept of semantically acceptable patterns and a mechanism for checking for them. A hash-coded table was added to NLC which contains the set of all semantically acceptable patterns for certain constructions. At various times during the processing, checks are made to see that a sensible parse is being assembled. Besides checking for compatibility in prepositional modifiers as indicated above, the system tests relationships given by relative clauses and adjective groups. It also checks that the operands of imperative verbs are legitimate. null</Paragraph> </Section> <Section position="2" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 4.4 Syntactic Ambiguity </SectionTitle> <Paragraph position="0"> The strategy for dealing with syntactic ambiguity is to attempt to anticipate the situations in which it is most likely to arise and to decide, whenever possible, which alternative is most reasonable. Having made such decisions, it is usually possible to order the grammar rules in such a way that the preferred parse is the one arrived at first, thus combining the efficiency of a blind search with the accuracy of a more extensive one. Perhaps surprisingly, the method has proven quite successful in meeting the stated objectives. (See \[5\].) This is due in part to the formulation of several general principles stemming from our observations of how natural language is employed in the NLC domain.</Paragraph> <Paragraph position="1"> The most important of these are: 1. Deep parses are generally preferred. Thus, &quot;x in y in z&quot; more often attaches the qualifier &quot;in z&quot; with y than with x when both readings are meaningful.</Paragraph> <Paragraph position="2"> 2. When ambiguity arises because of a conjunction, the intended conjuncts are likely to have similar type. This contrasts sharply with conventional programming languages, where operators rather than operands determine the &quot;binding&quot; in arithmetic expressions such as &quot;a + b * c&quot;. The preference for conjoining similar units is automatically supplied by using the MIX routine described earlier.</Paragraph> <Paragraph position="3"> 3. Compatibility checks based on semantic relation null ships should be checked during the parse as described in Section 4.3. This offers the benefit of suspending parsing to obtain semantic information without incurring the inefficiency of such action.</Paragraph> <Paragraph position="4"> 4. Special cases exist and should be introduced as such, rather than erroneously generalized to the point of introducing the possibility for parses which users would find ungrammatical.</Paragraph> </Section> <Section position="3" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 4.5 Syntactic Processor Output </SectionTitle> <Paragraph position="0"> The output of the syntax processor is a template for each clause giving the imperative verb and pointers to structures which represent the operands. Figure 9 gives an example of such an output.</Paragraph> <Paragraph position="1"> entries in row 1 greater than 6.0 to X.&quot;. 78 American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation</Paragraph> </Section> </Section> <Section position="7" start_page="0" end_page="0" type="metho"> <SectionTitle> 5. Sentence Semantics </SectionTitle> <Paragraph position="0"> The primary responsibility of the semantics module of NLC is the processing of noun groups to determine their referents. Input to semantics consists of the parse trees constructed by the syntactic processor.</Paragraph> <Paragraph position="1"> The imperative, along with its verbicle/particle, is saved for later context references, but not operated upon at this time. The principal role of semantics is to produce a precise internal representation that can be used by the matrix computer in carrying out the requested command.</Paragraph> <Paragraph position="2"> A secondary role of semantics is toupdate context as a consequence of resolving noun phrases. In this way, one may refer to previous actions of the system.</Paragraph> <Paragraph position="3"> Thus: &quot;Clear the column that was added to column 2.&quot; &quot;Increment by 5 the row which the last command squared.&quot; Context is also utilized in the location of referents for pronouns and other words requiring pronominal processing. Some examples are: &quot;Multiply the smallest entry by IT.&quot; &quot;Replace THAT ENTRY by ITS reciprocal.&quot; &quot;Subtract the NEXT 2 entries from each member of row 2.&quot; &quot;Sum up the OTHER entries in those rows.&quot; The following sections describe briefly the representations used in the system, noun group resolution, and the processing of pronominal structures.</Paragraph> <Section position="1" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 5.1 Internal Data Structures </SectionTitle> <Paragraph position="0"> For the matrix computer to carry out users' commands, physical addresses of the operands must be available. The resolved nouns must also be stored at a conceptual level so that later sentences may refer to the objects operated upon. For these reasons, the basic internal representation of the domain entities consists of a collection of intermediate structures from which hardware addresses are computed. Since the syntax parse trees are available, this intermediate notation does not refer to the natural language input.</Paragraph> <Paragraph position="1"> Most of the internal structures, denoted &quot;datareps&quot;, refer to a singular domain entity and have a fixed number of parameters. These &quot;primitives&quot; are: entry, row, column, matrix, domain, float constant, int constant, name, noun result, result, and command. As an example, the datarep for the noun group &quot;row 2&quot; is (ROW 1 2) which fills 5 bytes in memory and gives the name of the entity, the matrix number, and the item designation.</Paragraph> <Paragraph position="2"> Plurals may arise in a variety of ways, some of which are presented here. In the simplest case, a plural datarep is the direct result of the resolution of a plural noun, as in &quot;rows 3, 4 and 5&quot; &quot;the entries in rows 1 and 2&quot; Word-meaning routines such as adjective, ordinal, and superlative may produce a plural output, as in &quot;the positive entries in row 2&quot; &quot;the last 3 entries that were doubled&quot; &quot;the smallest 3 numbers in the last column&quot; In addition, plurals may result from the conjoining of singular datareps &quot;row 4 and column 5&quot; &quot;row 2 and the last row&quot; or from conjunctions in which one or more of the conjuncts is itself plural &quot;row 3 and the rows containing positive entries&quot; &quot;the first 3 and the last 2 rows in matrix 1&quot; An important feature common to all the types of conjunctions mentioned above is that the members of the &quot;set&quot; which represents the resulting plural datarep are themselves singular. Thus, for the noun phrase &quot;row 6 and the first 2 rows&quot; the resolution will be SET of size 3:</Paragraph> <Paragraph position="4"> Because of the manner of manipulating the internal structures and passing them between modules of the NLC system, an array-like data structure was chosen for sets instead of a LISP-like representation. A detailed description of the precise mechanism for representing sets, beyond the scope of the present paper, may be found in Ballard\[1\].</Paragraph> </Section> <Section position="2" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 5.2 Noun Group Resolution </SectionTitle> <Paragraph position="0"> The discovery of the meaning of a particular noun group begins with the head noun and any &quot;in&quot; qualifier which may be found. Thus in the phrase &quot;the smallest entry in row 2 greater than 10,&quot; the meaning of the words &quot;entry in row 2&quot; is initially represented as the set {(ENTRY 2 1), (ENTRY 2 2), .... (ENTRY 2 N)}. Then processing of other qualifiers and lastly prenominal modifiers has the effect of removing entries from the initial set. In this case, processing of &quot;greater than 10&quot; causes the system to reference the values of the listed entries and remove from the set those entries not meeting the specified criterion, &quot;greater than 10&quot;. Processing of &quot;smallest&quot; results in all but the appropriate smallest entry being removed, and processing of &quot;the&quot; involves checking that the resulting set has only one member since the head noun is singular. The final meaning of the noun group is thus the set {(ENTRY 2 i)} for American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 79 Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation some i and this representation is passed to the matrix computer as an operand for some computation.</Paragraph> </Section> <Section position="3" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 5.3 Pronominalization </SectionTitle> <Paragraph position="0"> The basic syntactic types of the pronouns within the matrix domain are the following: The fourth category is included among the listing of pronouns because the semantics involve most of the same principles. For instance, &quot;the other entries&quot; demands the semantics that would occur for &quot;the entries other than ?&quot;, where &quot;?&quot; represents the most general possible pronoun, having no type or number constraints.</Paragraph> <Paragraph position="1"> Pronoun reference is done by considering previous * datareps rather than by traversing trees as described by Hobbs \[22\]. Specific guidelines for posing the eligible referents to pronouns in a reasonable order include, in order of importance: 1. In all cases, require type, number, and semantic constraints of the pronoun to agree with the datarep being examined.</Paragraph> <Paragraph position="2"> 2. Prefer more recently created datareps.</Paragraph> <Paragraph position="3"> 3. For case-level (operand) pronouns, try to match source with an old datarep source, destination with an old destination.</Paragraph> <Paragraph position="4"> 4. &quot;Fuse&quot;, or conjoin, singular data/eps to produce a plural referent if necessary. Thus &quot;Add row 1 to row 2.&quot; &quot;Double those rows.&quot; entails creating the set consisting of rows 1 and 2 at the time pronoun referent location occurs. 5. Consult more distant sentences only after trying all possibilities on an intervening sentence.</Paragraph> <Paragraph position="5"> will prefer the complicated but recent fusion in the immediately preceding command over the exact but less immediate plural three sentences earlier.</Paragraph> </Section> </Section> <Section position="8" start_page="0" end_page="0" type="metho"> <SectionTitle> 6. The Matrix Computer </SectionTitle> <Paragraph position="0"> The &quot;matrix computer&quot; of NLC is assigned two major tasks: (1) carrying out the computations which the user has requested and (2) displaying on the terminal the resulting data world. Since the latter function is conceptually simple (although tedious to code effectively) and since sample system outputs are provided in Figure 1, this section will concentrate only upon the techniques which the matrix computer uses to perform the desired computations.</Paragraph> <Paragraph position="1"> As discussed in the previous section, essentially all processing of noun phrases is completed by the semantics module. What is made available then to the matrix computer is a collection of templates, similar to the ones generated as the parser output, as shown earlier in Figure 9, but with the noun arguments fully &quot;resolved&quot; into datareps as already described. As an example of the templates received by the matrix computer, consider the English input &quot;Add up the first row, double row 2, and subtract row 4 from row 5.&quot; The semantics output for this input is The task of the matrix computer is to decide upon the appropriate operations and to apply them to the operands. null It was mentioned earlier that the imperatives, particles, and verbicles recognized at parse time pass through semantics without alteration. When the output from semantics becomes available to the matrix computer, the imperative verb and the associated verbicle/particle (if there is one) are looked up in a table to determine the appropriate action. In most cases, it has not been necessary to write a separate procedure for each imperative. Specifically, &quot;double&quot; is treated as a special case of &quot;multiply&quot;. Thus the user input &quot;Double the first 2 entries in column 1.&quot; entails the matrix computer operations Arith-op(*, 2.0, (ENTRY 1 1)) Arith-op(*, 2.0, (ENTRY 2 1)) 80 American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation where &quot;Arith:op&quot; is the general coding capable of performing the basic arithmetic operations. In this way, the matrix computer has accommodated a large number of arithmetic commands by the mere addition of one table entry (8 bytes). Further instances of arithmetic verbs which make use of the arithmetie-op code are clear, copy, decrease, decrement, divide, halve, and many others.</Paragraph> <Paragraph position="2"> In general, operating with a scalar (element, variable, or constant) upon an aggregate (row, column or matrix) means to operate independently on each member. The knowledge of how to perform the intended operations for all meaningful source-destination pairs must be coded into the system. This means specifying for each X-Y pair exactly what is required by Arith-op(op, X, Y) for datareps 'X' and 'Y' and 'op' a member of { +, * .... } The remaining type of matrix computer operation deals with the noun result such as in &quot;Add the PRODUCT of the positive entries to row 1.&quot; &quot;Add the SUM of rows 3, 4 and 5 to row 6.&quot; Notice that a noun result may yield a scalar as in the first example or a vector as in the second. The noun result is evaluated similarly to imperative verb operations, and the result of the calculation is inserted into the appropriate higher level structure for further processing. null</Paragraph> </Section> <Section position="9" start_page="0" end_page="0" type="metho"> <SectionTitle> 7. Flow-of-Control Semantics </SectionTitle> <Paragraph position="0"> Thus far, this paper has discussed sentence by sentence processing, where system actions occur one at a time, determined directly from keyboard inputs. Most means of enhancing the usefulness of the system fall into one of two categories: (1) the introduction of programming-language type control structures and (2) the ability to define and execute self-contained portions of natural language &quot;coding&quot;. These topics are addressed separately here.</Paragraph> <Section position="1" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 7.1 Conditional Execution </SectionTitle> <Paragraph position="0"> To specify conditional execution of a command or a group of commands in English, one uses such words as &quot;if&quot;, &quot;when&quot;, &quot;unless&quot;, &quot;otherwise&quot;, etc. Following are some sentences typical of inputs that NLC-like systems will likely be called upon to process.</Paragraph> <Paragraph position="1"> &quot;IF row 3 contains a positive entry ...&quot; &quot;IF the largest entry occurs in the last row ...&quot; Implementation of this facility is not complete on the NLC system. When it becomes totally operative, users will be told that they may begin sentences with the word &quot;if&quot; as well as with imperative verbs. The characteristic language feature appearing in each of the above sentences is the independent clause: declarative (rather than imperative) in nature, and requiring the evaluation of a Boolean (i.e., a condition whose truth or falsity is to be determined). Fortunately, the conjugated verbs are typically either &quot;be&quot; or one of the verbs which have already occurred in relative clauses, and so an appreciable degree of different syntactic processing is not required. Thus, &quot;if row 3 contains a positive entry ...&quot; relates directly to &quot;the rows which contain a positive entry&quot; The semantic routines originally written for qualifier verbs can, therefore, with a slight modification be used in handling these constructs.</Paragraph> </Section> <Section position="2" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 7.2 Looping </SectionTitle> <Paragraph position="0"> NLC provides several ways of creating loops using the verb &quot;repeat.&quot; In the typical situation, the user supplies and observes the execution of a sequence of commands on particular members of the data world.</Paragraph> <Paragraph position="1"> The system is then capable of abstracting, from the specific instructions, general code to operate on other entities. Frequently, an algorithm requires the application of a sequence of commands to several members of the domain. One way of accomplishing this is to make use of the following pattern.</Paragraph> <Paragraph position="2"> &quot;Choose an entry which ... and call it x.&quot; &quot;... to x.&quot; &quot; x by &quot; &quot;Repeat for the other entries.&quot; When such a sequence is recognized, the &quot;repeat&quot; processor finds the set given to the most recent unmatched &quot;choose&quot; (or &quot;pick&quot;, etc.) and thereby knows what &quot;other&quot; members are to have the intervening commands applied to them. In instances where there is no non-deterministic &quot;choose&quot;-type operation to delineate the statements to be repeated or to make explicit the set to which previous commands are to be applied, alternate versions of &quot;repeat&quot; are provided.</Paragraph> </Section> <Section position="3" start_page="0" end_page="0" type="sub_section"> <SectionTitle> Examples include </SectionTitle> <Paragraph position="0"> &quot;Repeat the last 3 commands.&quot; &quot;Repeat the last command 5 times.&quot; &quot;Repeat the last 3 commands for all other odd entries.&quot; &quot;Repeat those commands twice on row 3.&quot;</Paragraph> </Section> <Section position="4" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 7.3 Procedures </SectionTitle> <Paragraph position="0"> Another way of extending sentence by sentence processing is the facility for defining procedures, enabling the user to describe operations in terms of existing commands. Subsequent inputs may access the newly-created imperatives as though they had been previously defined, including their use in further pro-American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 81 Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation cedure definitions. Programmers will recognize the following illustration as an instance of the &quot;calledprocedure&quot; type of subroutine. There is no reason, however, for not providing the &quot;function&quot; procedure as well. Interestingly, the &quot;noun result&quot; discussed earlier corresponds to this value-returning subroutine.</Paragraph> <Paragraph position="1"> In addition, the NLC design includes the creation of new adjectives. The correspondences between natural language words and conventional programming language procedures are roughly as follows.</Paragraph> <Paragraph position="2"> Natural Language Programming Language imperative verb &quot;called&quot; subroutine noun result * &quot;function&quot; subroutine adjective * &quot;predicate&quot; (* - not yet operative on NLC) Both the noun result and the adjective routines require an explicit &quot;return&quot; command. Methods of incorporating them into the present system, as well as ways of relaxing the restrictions for the imperative verb procedures discussed below, are being developed.</Paragraph> <Paragraph position="3"> In order to assure correct re-execution of the commands within a procedure, it is necessary to detect occurrences of the parameters among the nouns of the procedure body. To accomplish this, the system requires that the arguments at the time of procedure definition be names. When a user input indicates that a procedure is about to be defined, names are saved so that their re-occurrence can be recognized as denoting a parameter rather than simply the current argument.</Paragraph> <Paragraph position="4"> While the procedure definition is in progress, appropriate changes are made in the syntax trees, which are then saved on disc. As an example, suppose the user types &quot;Define a procedure to zap z into w.&quot; &quot;Double w.&quot; &quot;Add z to w.&quot; &quot;Negate z.&quot; &quot;End.&quot; At this point, there will be four new files containing parse trees which can be informally represented as follows.</Paragraph> <Paragraph position="5"> This enables flow-of-control semantics processing, when an invocation of the new &quot;zap...into&quot; imperative is detected, to evaluate the arguments and substitute them appropriately into the procedure's syntax trees wherever param-i is present.</Paragraph> <Paragraph position="6"> Syntax for user-created imperatives parallels that for the system-provided routines of corresponding type. For instance, the same type of verbicle/particle compatibility checking (where applicable) takes place. Thus some acceptable inputs are &quot;Zap row 3 into row 6.&quot; &quot;Zap into column 4 the second column.&quot; and some intentionally rejected inputs are &quot;Zap row 5.&quot; \[missing operand\] &quot;Zap row 5 from row 6.&quot; \[wrong verbicle\] 8. System Behavior The sentence processing capabilities of the system will be indicated in this section by demonstrating its ability to handle paraphrases and by describing an experiment in which it was used by paid subjects to solve problems.</Paragraph> </Section> <Section position="5" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 8.1 Syntactic Breadth </SectionTitle> <Paragraph position="0"> To demonstrate the variety of the syntax handled by the system, fifty-five paraphrases are given below for the sentence &quot;Double the first row in matrix 1.&quot; These paraphrases are not all exact in that some of them omit reference to matrix 1, assuming context makes it clear, others entail side effects, such as the creation of a label, etc. This set gives only a small fraction of all the possible paraphrases that can be processed, but it is representative. The typical time required for complete processing of each sentence is two seconds on the PDP-11/70.</Paragraph> <Paragraph position="1"> The first set of paraphrases demonstrates some variations on the qualifier.</Paragraph> <Paragraph position="2"> 1. &quot;Double the first row of matrix 1.&quot; 2. &quot;Double the first row which is in matrix 1.&quot; 3. &quot;Double the first row that appears in matrix 1.&quot; 4. &quot;Double the first tow that matrix 1 contains.&quot; 5. &quot;Double the first row matrix 1 contains.&quot; The matrix reference can also appear as a classifier 6. &quot;Double the first matrix 1 row.&quot; or if context indicates the matrix reference, it can be omitted.</Paragraph> <Paragraph position="3"> 7. &quot;Double the first row.&quot; 8. &quot;Double row 1.&quot; A row may be referred to by the values it contains. 9. &quot;Double the first row that contains a positive or a nonpositive number.&quot; 10. &quot;Double the row that contains the first entry of matrix 1.&quot; 11. &quot;Double the row in which the first entry of matrix 1 appears.&quot; 12. &quot;Double the first row in which there is a positive or a nonpositive number.&quot; 82 American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 Alan W. Biermann and Bruce W. Bsllard Toward Natural Language Computation 13. &quot;Double the row containing the first entry of column 1.&quot; 14. &quot;Consider column 2.</Paragraph> <Paragraph position="4"> Consider the first entry in it.</Paragraph> <Paragraph position="5"> Double the row which contains that entry.&quot; Rows may be thought of as sets of entries.</Paragraph> <Paragraph position="6"> 15. &quot;Double the entries of row 1.&quot; 16. &quot;Double the elements in row 1.&quot; 17. &quot;Double the row 1 entries.&quot; 18. &quot;Double the row 1 numbers.&quot; The next several sentences illustrate some quantifiers. 19. &quot;Double all the entries of row 1.&quot; 20. &quot;Double each entry in row 1.&quot; 21. &quot;Double every entry in row 1.&quot; 22. &quot;Double each one of the entries in row 1.&quot; Assume the row has 5 members.</Paragraph> <Paragraph position="7"> 23. &quot;Double the first five entries of matrix 1.&quot; Some rows may be located poSitionally.</Paragraph> <Paragraph position="8"> 24. &quot;Double the top row.&quot; Suppose there are four rows in the matrix. The first row can be found by counting up from the bottom. 25. &quot;Double the fourth row from the bottom.&quot; 26. &quot;Double the fourth from the bottom row.&quot; 27. &quot;Double the fourth from bottom row.&quot; 28. &quot;Double the fourth from the last row.&quot; Generality of ordinal processing allows for some rather strange sentences.</Paragraph> <Paragraph position="9"> 29. &quot;Double the first one row.&quot; 30. &quot;Double the first row from the top.&quot; Row 1 can be located with respect to other rows. 31. &quot;Double the row in matrix 1 corresponding to row 1 in matrix 2.&quot; 32. &quot;Double the row in matrix 1 which corresponds to row 1 of matrix 2.&quot; One can use multiple clauses by labelling or focusing attention in one clause and then using it in the second clause.</Paragraph> <Paragraph position="10"> 33. &quot;Consider row 1 and double it.&quot; 34. &quot;Consider row 1. Double it.&quot; 35. &quot;Consider row 1. Double that row.&quot; 36. ~ &quot;Consider and double row 1.&quot; 37. &quot;Consider row 1.</Paragraph> <Paragraph position="11"> Double the row considered by the last command.&quot; 38. &quot;Consider row 1.</Paragraph> <Paragraph position="12"> Double the row the last command considered.&quot; 39. &quot;Consider matrix 1 and double its first row.&quot; 40. &quot;Consider rows 2, 3 and 4.</Paragraph> <Paragraph position="13"> Double the other row.&quot; 41. &quot;Consider row 1 of matrix 2.</Paragraph> <Paragraph position="14"> Double the row in matrix 1 corresponding to it.&quot; Users may access entities by naming them.</Paragraph> <Paragraph position="15"> 42. &quot;Call row 1 x. Double x.&quot; 43. &quot;Call row 1 x. Double row x.&quot; 44. &quot;Call row 1 x. Double it.&quot; 45. &quot;Call row 1 x. Double the x row.&quot; 46. &quot;Call the first entry x. Double the x row.&quot; The &quot;backup&quot; command will undo the calculation of previous commands.</Paragraph> <Paragraph position="16"> 47. &quot;Double row 1. Clear it. Backup.&quot; Other imperatives can be used to achieve the result of &quot;double&quot;.</Paragraph> <Paragraph position="17"> 48. &quot;Add row 1 to itself.&quot; 49. &quot;Add row 1 to row 1.&quot; 50. &quot;Multiply row 1 by 2.&quot; 51. &quot;Divide row 1 by 0.5.&quot; 52. &quot;Divide 0.5 into' the first row.&quot; 53. &quot;Add the entries in row 1 to themselves.&quot; Finally, noun result groups may be used.</Paragraph> <Paragraph position="18"> 54. &quot;Put the product of 2 and row 1 into row 1.&quot; 55. &quot;Subtract the negative of row 1 from that row.&quot; There are, of course, many paraphrases which are not currently recognized by NLC. Some examples include sentences with superfluous words or phrases: 1. &quot;PLEASE double row 1.&quot; 2. &quot;Double the VERY first row of matrix 1.&quot; 3. &quot;Double the first BUT NOT THE SECOND row.&quot; certain unimplemented noun-result formats: 4. &quot;Put twice row 1 into row 1.&quot; 5. &quot;Put row 1 times 2 into row 1.&quot; and verbs taking more than 2 operands: 6. &quot;Add row 1 to itself, putting the result into row 1.&quot;</Paragraph> </Section> <Section position="6" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 8.2 Some Observations of Performance </SectionTitle> <Paragraph position="0"> In April of 1979, twenty-three students in a first course in programming at Duke were paid to be subjects in an experiment on the system. Each subject was left alone in a room with the display terminal and given a short tutorial to read, a few simple practice exercises to do, and a problem to solve. No verbal interactions were allowed between experimenter and subject except those related to the administration of the test. Typical times required to complete the tutorial, the exercises, and the problem were 35, 15, and 50 minutes, respectively. In the problem solving sessions, the subjects typed a total of 1581 sentences, 81 American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 83 Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation percent of which were processed immediately and correctly. Approximately half of the remaining 19 percent were rejected because of system inadequacies, and the other half were rejected because of errors in user inputs. This experiment is described in \[5\] by Biermann, Ballard, and Holler, with an analysis of the types of errors that were made. Also included in the experiment was a test of the subjects' ability to do the same problems in the programming language from their course, PL/C. These results are discussed in \[5\], too.</Paragraph> <Paragraph position="1"> Some specific observations that have come out of the experiment and other usages of the system are as follows: 1. The vocabulary of over 300 words is nearly adequate for a reasonable class of problems. Only eight words were typed during the experiment which were not available in the system. However, any casual user who attempts to push the system capabilities significantly will quickly find many unimplemented words.</Paragraph> <Paragraph position="2"> 2. Some of the implemented words have inadequate definitions. For example, NLC will process &quot;the entry corresponding to x&quot; but not &quot;the corresponding entry&quot;. The latter form is more difficult because the item to be corresponded to is not explicit.</Paragraph> <Paragraph position="3"> 3. The variety of the syntactic structures which are processed is approximately as good as indicated by the experiment: About 70 to 90 percent of a typical user's inputs will be handled by the parser. null redesigned. We notice for example that NLC processes &quot;Double EACH entry in the first column&quot; but not &quot;Double the first entry in EACH column.&quot; In the former case, the first column is found and the matrix computer doubles its entries in one operation. In the later case, the definitions of &quot;entry 't , &quot;first&quot;, &quot;the&quot;, and &quot;double&quot; must be invoked in that order for every column.</Paragraph> </Section> </Section> <Section position="10" start_page="0" end_page="0" type="metho"> <SectionTitle> 9. Comparison With Other Work </SectionTitle> <Paragraph position="0"> A number of projects in automatic programming propose to have a user converse about a problem in a completely natural manner, using problem dependent vocabulary, and largely omitting discussion of data structures and coding details. Examples of such work have been described by Balzer\[2,3\], Biermann\[4\], Green\[13,14\], Heidorn\[16,17,18,19\], and Martin et a1.\[23\]. Inputs to these systems typically include a collection of fragments about the program to be generated, in which case the system must perform considerable induction and synthesis to produce an output. While the long term goals of the NLC project are similar to those of these other projects, the method of research is somewhat different. Whereas many projeets attempt to tackle problems associated with several levels of cognition at once, NLC attempts to begin with a reliable sentence-by-sentence processor and to add facilities slowly while reducing demands on the user.</Paragraph> <Paragraph position="1"> Many of the research efforts in natural language processing have been associated with information retrieval from data base systems (Codd\[9\], Harris\[15\], Hendrix et a1.\[20,21\], Petrick\[25\], Plath\[26\], Simmons\[31\], Thompson & Thompson\[34\], Waltz\[35,36\], and Woc~ds\[39\]). Most of the inputs for these systems are questions or simple imperatives such as &quot;list all of the ...&quot; Top level sentence syntax for these systems may have more variety than NLC. At the noun group level, however, NLC appears to have more extensive capabilities. This is due to the need in the NLC environment to conveniently refer to objects or sets of objects on the basis of their properties, geometrical location, operations performed upon them, etc.</Paragraph> <Paragraph position="2"> Concerning world modelling, a system which bears some resemblance to NLC is SOPHIE by Brown and Burton\[8\]. Their system allows natural language interaction with a simulator for an electric circuit.</Paragraph> <Paragraph position="3"> In the artificial intelligence literature, there is much emphasis on (1) artificial cognitive abilities, (2) induction mechanisms, (3) problem solving facilities, and (4) mechanisms for dealing with context and sequence.</Paragraph> <Paragraph position="4"> Future work on NLC will move in the direction of adding such facilities, but in its current state the system works more like an interpreter for English in the style of programming language interpreters than like a &quot;thinking&quot; machine. Thus the mechanisms described in Bobrow & Collins\[7\], Cullingford\[10\], Minsky\[24\], Schank\[2g,29,30\], Winograd\[37\], and others for various kinds of cognition and problem solving are, for the time being, largely without counterpart in NLC. The philosophy of this project has been to build from the bottom, attempting to solve the least difficult, though still challenging, problems first.</Paragraph> <Paragraph position="5"> 10. Conclusion Natural language programming has seemed in recent years to be a rather remote possibility because of the slow progress in representation theory, inference theory, and computational linguistics. The NLC system is designed to compensate partially for the weakness of current technology in these areas by presenting 84 American Journal of Computational Linguistics, Volume 6, Number 2, April-June 1980 Alan W. Biermann and Bruce W. Ballard Toward Natural Language Computation the user with.a good environment and with some well-designed linguistic facilities. All of the quoted phrases and sentences in this paper and the Appendix have been run on the system except for the &quot;if&quot; constructions in Section 7. Current efforts are aimed at the development of a number of flow-of-control semantics facilities for handling various types of control structures and definitions of new vocabulary items.</Paragraph> <Paragraph position="6"> Appendix: A Natural Language Program and Its</Paragraph> </Section> <Section position="11" start_page="0" end_page="0" type="metho"> <SectionTitle> PL/I Equivalent </SectionTitle> <Paragraph position="0"> The following &quot;pivot&quot; routine uses a computational technique described in Gallie and Ramm\[12\] and gives an example of a nontrivial usage of the system.</Paragraph> <Paragraph position="1"> &quot;Display a 4 by 5 matrix and call it testmat.&quot; &quot;Fill the matrix with random values.&quot; &quot;Choose an entry and call it p.&quot; &quot;Define a method to pivot testmat about p.&quot; &quot;Choose an entry not in the p row and not in the p column and call it q.&quot; &quot;Compute the product of the entry which corresponds to q in the p row and the entry which corresponds to q in the p column.&quot; &quot;Divide the result by p and subtract this result from q.&quot; &quot;Repeat for all other entries not in the p row and not in the p column.&quot; &quot;Divide each entry except p in the p row by p and negate those entries,&quot; &quot;Divide each entry except p in the p column by p.&quot; &quot;Put the reciprocal of p in*o p.&quot; &quot;End the definition.&quot; The PL/I equivalent program as given in \[12\] is as follows:</Paragraph> </Section> class="xml-element"></Paper>