|Lesson 1A||Lesson 1B||Lesson 2X||Lesson 2A||Lesson 2B||Lesson 2C||Lesson 2D|
Read Document 2X
and Homework 2D.
The grammar eg2D introduces a limited conjunction mechanism. It provides for the conjoining of LXR type definitions and specified strings. The conjunctions are and, or, but and comma. The corresponding conjunction strings (new BNF definitions) are <ANDSTG>, <ORSTG>, <BUTSTG> and <COMMASTG>. An example of <ANDSTG> in an LXR type definition (<LNR>) is the portion and Vikings in arrowheads, buttons and Vikings; and (with a non-conjunctional comma preceding and) in arrowheads, buttons, and Vikings. An example of string conjoining is conjoined <ASSERTION>s (They found a tower and they dug under it). However, the grammar cannot handle conjoined <ASSERTION>s where the <SUBJECT> of the second <ASSERTION> is missing (They found a tower and dug under it). The missing second SUBJECT is actually a silent repeat of the preceding <SUBJECT> (They found a tower and [they] dug under it).
To incorporate the conjunction mechanism few changes are needed in the BNF component of the grammar. Most of the work is done by new and revised routines and restrictions. In addition to the four new BNF definitions mentioned above, there is <Q-CONJ>, whose initial value is <*NULL>. For example,
The <*NULL> is replaced in the course of parsing by a generated definition for the conjunction string (e.g. <ANDSTG>) based on the context in which it occurs. The generated structure repeats the parse tree structure which precedes the occurrence of the conjunction in the sentence. For example, when and occurs after an <ASSERTION> has been constructed (They found a tower), the content of <ANDSTG> can be another instance of <ASSERTION> (they dug under it).
The generation of conjunction strings is carried out within the execution of DCONJ0 by the operator GENERATE, which replaces the <*NULL> value of <Q-CONJ> by a repeat of the elements of the structure to which the conjunction string (e.g. <ANDSTG>) is attached. This is a case of interrupting the normal syntax-driven parsing procedure to dynamically generate new BNF definitions not originally in the grammar. The interrupt is signalled from the dictionary as soon as a conjunction word becomes the current sentence word to be analyzed. For example, and in the dictionary has the definition
This says that and is defined as belonging to the category SPWORD ("Special Process WORD"), which has the attribute ANDSTG, the name of the grammar definition associated with and. When and becomes the current sentence word to be analyzed, the parser begins the "special process" of generating an <ANDSTG>, which it then uses to parse the upcoming sentence words.
Several restrictions limit the nodes to which the very general Special Process mechanism is applied. Some others impose other constraints. In particular:
In addition to the six new conjunction restrictions, the restrictions WAGREE and WAGREE-VO have been revised to take account of conjunctions. Also the new routine LOOKAHEAD is defined. It is used by DCONJ4, which checks for an and or but or or ahead before accepting a comma as a conjunction.
To accommodate conjunctions, the CORE routine is modified so that in descending through nodes of the parse tree it is blocked by ADJSET1, not ADJSET. ADJSET1 is a new type list that includes all the nodes listed in ADJSET and, in addition, ANDSTG, BUTSTG, COMMASTG, and ORSTG. This ensures that CORE will remain within the confines of one string and not pass through conjuncts, just as CORE was prevented by ADJSET from reaching into an adjunct instead of landing on the central element of an LXR type node.
The presence of a conjunction string also affects routines that move upward in the parse tree. For example, in parsing the phrase the tower that was built by the Vikings and that Columbus discovered, the permission to accept a <*NULLWH> as the value of <OBJECT> following the verb discovered (i.e. with '[ ]' representing <*NULLWH>: and that Columbus discovered [ ]) is given by the restriction WWH2, which uses the upward-looking routine NONSEG-IMMSTG to locate an immediate <WHS-N>. This routine must be modified to allow passage through a conjunction string (in this example <ANDSTG>) so as to reach the "omitting string" <WHS-N> that is above <ANDSTG> in the parse tree.
In addition to the six new conjunction restrictions, WAGREE, WAGREE-VO, WCOUNT1, and WVC1 have been revised to handle conjunctions (but not all cases). Also the new routine LOOKAHEAD is defined, used by DCONJ4 as noted above.
Another modification is the inclusion of an optional <INTRODUCER> preceeding <CENTER>. This may be either and or but (And then they dug). These words do not function as conjunctions within the sentence in which they occur. Since they are at the beginning of the sentence, there is no previous structure from which the dynamic generation of a conjunction string can be based.
A few additions are also needed in the dictionary, specifically the conjunction words.
CHANGES MADE IN THE GRAMMAR
CHANGES MADE IN THE DICTIONARY