Slot Grammars
M i c h a e l C. M c C o r d
C o m p u t e r S c i e n c e D e p a r t m e n t U n i v e r s i t y of K e n t u c k y Lexington, K e n t u c k y 4 0 5 0 6
This paper presents an approach to natural language grammars and parsing in which slots and rules for filling them play a major role. The system described provides a natural way of handling a wide variety of grammatical phenomena, such as W H - movement, verb dependencies, and agreement.
1. Introduction
This p a p e r presents a formalism for natural lan- guage g r a m m a r s , with a c c o m p a n y i n g parser. T h e g r a m m a r s are called slot grammars b e c a u s e they are o r g a n i z e d a r o u n d slots ( g r a m m a t i c a l relations) and rules for filling them. T h e p a r s e r w o r k s b o t t o m - u p and maintains, for e a c h phrase being built up, a list called the available slots list, A S L O T S . A p h r a s e can grow b y having one of the slots in its A S L O T S list filled b y a suitable adjoining phrase.
As a p h r a s e grows, its A S L O T S list generally shrinks, b e c a u s e slots are ordinarily r e m o v e d f r o m A S L O T S as they get filled. H o w e v e r , a slot c a n be m a r k e d as multiple a n d t h e n receive m o r e t h a n one filler. A m o r e interesting exception to the shrinking of A S L O T S is that the p r o c e d u r e for filling a slot m a y o p e r a t e on A S L O T S itself and add new slots to it. T h e o p e r a t i o n of raising builds such n e w slots as " c o p i e s " of slots in the A S L O T S list of a filler phrase. C e r t a i n s t a n d a r d g r a m m a t i c a l constructions, such as W H - m o v e m e n t , c a n be h a n d l e d with this raising operation.
T h e p a r s e r p r o c e s s e s the w o r d s of a s e n t e n c e f r o m left to right, at e a c h stage working out all the slot-fillings t h a t d e v e l o p w h e n the n e w w o r d is t h r o w n in with the phrases t h a t h a v e already b e e n built up. H o w e v e r , a given phrase grows middle-out. Its history begins with a w o r d which is its head, and its slot-fillers m a y be a d j o i n e d on the left or the right. A l e f t - a d j u n c t i o n , if a p p r o p r i a t e , is m a d e immediately, b e c a u s e the filler already exists; b u t a r i g h t - a d j u n c t i o n waits till m o r e w o r d s h a v e b e e n p r o c e s s e d . M i d d l e - o u t c o n s t r u c t i o n allows m o r e d a t a - d i r e c t e d control. F o r instance, the initial value
of the A S L O T S list of a phrase is d e t e r m i n e d p a r - tially b y the lexical e n t r y for its h e a d word.
In c o m p u t a t i o n a l linguistic b a c k g r o u n d , the sys- t e m is m o s t closely related to the a u g m e n t e d phrase s t r u c t u r e g r a m m a r s ( A P S G ' s ) of G e o r g e H e i d o r n ( 1 9 7 2 , 1 9 7 5 ) . In A P S G ' s , s y n t a c t i c a n d s e m a n t i c slots (relation a t t r i b u t e s ) are heavily used, t h o u g h not as systematically as in slot g r a m m a r s , b e c a u s e the A P S G s y s t e m d o e s n o t m a i n t a i n an A S L O T S list. T h e A P S G parsing algorithms are b o t t o m - u p ; a n d in the s a m p l e g r a m m a r s , p h r a s e s are usually built up in a m i d d l e - o u t fashion, starting with a h e a d w o r d and adjoining items on the left or the right.
A l t h o u g h slot g r a m m a r s are o r g a n i z e d m a i n l y a r o u n d slots, they also m a k e use of states, and thus h a v e a relationship to the a u g m e n t e d transition net- works ( A T N ' s ) of W o o d s ( 1 9 7 0 , 1 9 7 3 ) . But the use of states in slot g r a m m a r s is m u c h m o r e c o n s t r a i n e d t h a n in A T N ' s , and, in general, slot g r a m m a r s are c o n t r a s t e d with A T N ' s in the paper.
O n the linguistic side, the t h e o r y p r o p o s e d is m o s t closely r e l a t e d to w o r k in the systemic g r a m - m a r tradition ( H u d s o n , 1971,1976; M c C o r d , 1975, 1977), especially to H u d s o n ' s t h e o r y of daughter- dependency g r a m m a r ( H u d s o n , 1976). 1 T h e w o r k of K a c (1978) is also related; and there are some c o n - n e c t i o n s to the t r a d i t i o n of K e n n e t h Pike a n d C h a r l e s Fries ( C o o k , 1969), at least in the basic notion of slot and filler.
T h e p a p e r is i n t e n d e d as a c o n t r i b u t i o n to natural l a n g u a g e s y n t a x a n d parsing. V e r y little is said a b o u t semantics. H o w e v e r , the s y s t e m could readily
1 I wish to thank Richard Hudson for many useful discussions pertinent to the present work.
Copyright 1980 by the Association for Computational Linguistics. Permission to copy without fee all or part of this material is granted provided that the copies are not made for direct commercial advantage and the Journal reference and this copyright notice are included on the first page. To copy otherwise, or to republish, requires a fee and/or specific permission.
0 3 6 2 - 6 1 3 X / 8 0 / 0 1 0 0 3 1 - 1 3 $01.00
Michael C. M c C o r d S l o t Grammars
be augmented with procedures that build up seman- tic interpretations along with syntactic analyses. In such a " c o m p l e t e " system, semantic and pragmatic knowledge would be applied concurrently with syn- tactic knowledge; but syntax would still play a guid- ing role in the processing.
Section 2 of the paper,
The centrality of slots,
argues for the advantages of an A S L O T S list, mainly in c o n n e c t i o n with verb d e p e n d e n c i e s , u n b o u n d e d m o v e m e n t rules, and conjunctions. Section 3,States
and slots,
explains how states are used and basicallyhow slot-filling takes place. A simple diagrammatic notation for slot grammars is introduced. Section 4,
Formal representation o f syntax,
describes the formof the input of syntax to the program (which is writ- ten in LISP). Section 5,
Representation of frames by
the system,
gives details of the data structures usedb y the system. Section 6,
The lexicon,
describes the formal representation of the lexicon, and argues for some of the a d v a n t a g e s of d a t a - d i r e c t e d control. Section 7 is anOutline of the parsing algorithm.
Sec- tion 8 givesA sample grammar
and discusses some of the linguistic choices made in it. Section 9 is aSummary
of the characteristics of the system.2. The centrality of slots
In natural language parsing, c o m m o n c o n t r o l devices are the use of states (as in transition net- works) and the examination of individual slots and flags. These devices are used in slot grammars, but in a restrained way. The most central control device is the m a i n t e n a n c e of the
available slots
list, A S L O T S . T h e claim of this section is that this is linguistically and computationaUy natural, especially in c o n j u n c t i o n with b o t t o m - u p parsing and middle- out construction of phrases.The ideas will be illustrated with the formation of verb phrases (VP's). Following H e i d o r n (1972, 1975), I use this term to include a verb with
any
of its sisters, even the subject. The data structure used by the slot grammar system for analyzing a VP, dur- ing parsing, is called the VPframe.
This is an asso- ciation list ofregisters
and theirvalues,
much as is used in A T N parsing (Woods, 1973). The values of registers can be p r o c e d u r e s as well as " d e c l a r a t i v e " structures. T h e r e is some parallel of characteristics of these frames with the frames of Minsky (1975) and W i n o g r a d (1975). C o m p l e t e details will be given in Section 5.The main register of c o n c e r n now is A S L O T S . The initial A S L O T S register for a V P frame might contain the list (SUBJ IOBJ OBJ A D V L ) . If the SUBJ slot can be filled, t h e n the system f o r m s a new VP frame showing SUBJ filled and having its A S L O T S r e d u c e d to ( I O B J O B J A D V L ) . Some slots, such as A D V L (adverbial), m a y be marked as
multiple
slots in the grammar, and these are not re-m o v e d f r o m A S L O T S when t h e y are filled. T h e members of A S L O T S are in general
optionally
filled. A n y checking for obligatory slots must be done ex- plicitly in the grammar. Although A S L O T S is stored as a list, it is t r e a t e d as an u n o r d e r e d set; the posi- tion of a slot in A S L O T S has no effect on w h e t h e r it can be filled.One advantage of this a p p r o a c h is that one can express v e r b - d e p e n d e n c i e s in an immediate and sim- ple way. Instead of classifying verbs b y features like
transitive,
one can just initialize the A S L O T S register of the VP frame so that it contains the slot OBJ. The initialization i n f o r m a t i o n that is special to a given verb is stored in the lexical e n t r y for the verb, in a list of slots called thesister-dependency
list of the verb. ( T h e s e slots c o r r e s p o n d roughly tosister-dependency
rules in the t h e o r y of H u d s o n , 1976.) F o r example, the s i s t e r - d e p e n d e n c y list stored with the v e r bgive
might be ( I O B J O B J ) . W h e n a VP frame is f o r m e d withgive
as its head, its initial A S L O T S will include (IOBJ OBJ). Certain o t h e r slots, such as SUB J, A U X L (auxiliary), and A D V L , are c o m m o n to all verbs, so it would be r e d u n d a n t to list them in the lexicon. These aredefault
slots and are listed in the general syntax ofthe VP. ( T h e s e slots c o r r e s p o n d roughly to
daughter-dependency
rules in H u d s o n , 1976.) In set- ting up the initial value of A S L O T S , the parser au- tomatically c o m b i n e s the default slots with the s i s t e r - d e p e n d e n c y slots of the particular verb, so that the initial VP f r a m e forgive
w o u l d have A S L O T S = (SUBJ A U X L A D V L IOBJ OBJ).This t r e a t m e n t of v e r b - d e p e n d e n c i e s is m o r e direct than the use of transitivity features or e n c o d - ing in transition n e t w o r k states, because this initial A S L O T S list expresses more directly what the verb " n e e d s " to be the head of the VP. The semantic i n t e r p r e t a t i o n of the VP should be built (partially) f r o m these slots and their fillers, and the syntax of the VP is guided by the filling of these particular slots. F u r t h e r m o r e , this m e t h o d ties in nicely with the middle-out construction of the VP; search pro- ceeds o u t w a r d f r o m the item that sets the goals.
N o t only does the slot grammar system initialize A S L O T S appropriately, but it also updates A S L O T S as parsing proceeds. At any point, A S L O T S pro- vides a natural e x p r e s s i o n of what remains to be adjoined to the VP. Most parsers (e.g. A T N and A P S G parsers) keep track of what slots
have
b e e n filled, but it seems reasonable also to keep track of what slots m a y yet be filled, and use these in the control mechanism. T h e n rules that might be ap- plied to fill a slot like OBJ n e v e r b e c o m e activated if OBJ is not available.F o r instance, H e i d o r n (1972) has a rule roughly like the following:
Michael C. McCord Slot Grammars
V P ( T R A N S , - ~ O B J ) NP - - > V P ( O B J = N P ) .
This says that w h e n a transitive VP with O B J slot unfilled is f o l l o w e d b y an N P , t h e n a n e w VP is f o r m e d with O B J filled b y the NP. T h e rule will be tested every time a VP is f o r m e d , and this will be fruitless if the v e r b is not transitive ( c a n n o t take an OBJ) or if it already has an OBJ. Notice t h a t O B J is (implicitly) m e n t i o n e d three times ( c o u n t i n g the T R A N S ) in the rule, w h e r e a s o n e feels s o m e h o w that O B J should be m e n t i o n e d only once, since the rule is a b o u t filling the O B J slot. F u r t h e r m o r e , if o n e h a d a slot that could be filled b y m o r e t h a n one kind of filler (not just an N P ) t h e n this sort of rule would have to be duplicated f o r each t y p e of filler.
T h e a p p r o p r i a t e n e s s of b a s i n g s e a r c h on an available-slots list s e e m s especially clear in a lan- guage like J a p a n e s e with a rather free o r d e r of VP constituents. Suppose a g r a m m a r is to be written which captures the simple idea that the v e r b c o m e s at the e n d of the VP, and the preceding N P ' s h a v e case markings and can c o m e in a n y order. In a slot g r a m m a r , the v e r b c a n activate a VP f r a m e which has an A S L O T S list a p p r o p r i a t e for that verb. T h e n the VP f r a m e "looks to the left", filling slots in AS- L O T S , a n d r e m o v i n g n o n - m u l t i p l e slots f r o m AS- L O T S as it goes. In a situation that starts with, say, four slots and r e m o v e s all b u t one, only this one slot will be relevant f o r f u r t h e r e x p e c t a t i o n s in looking to the left, and rules will not be a t t e m p t e d needless- ly.
Still a n o t h e r r e a s o n f o r basing e x p e c t a t i o n s on A S L O T S has to do with the w a y raising construc- tions can be t r e a t e d in b o t t o m - u p , m i d d l e - o u t analy- sis. M a n y languages allow u n b o u n d e d raising of items, as in
(1) Which chair does M a r y believe J o h n said he was sitting in?
H e r e the question arises as to w h a t syntactic role the initial N P which chair fills. T w o VP levels and a PP down, there is a slot O B J which is the o b j e c t of the preposition in. D o e s which chair fill O B J direct- ly? If we try to write rules which accomplish this, we have to m a k e t h e m search d o w n VP chains of arbitrary length and be aware of possible b r a n c h i n g due to conjunctions, as in
(2) Which chair does M a r y believe t h a t AI b o u g h t and J o h n was sitting in?
It seems that the rule f o r filling the o b j e c t of the p r e p o s i t i o n should not h a v e to " k n o w a b o u t " these complications. T h e complications are c r e a t e d b y VP c o m p l e m e n t a t i o n of verbs like believe and b y c o n - junctions like and. T h e constructions that create the complications should take responsibility and should s m o o t h the w a y for the placing of which chair.
In slot g r a m m a r s this is handled b y the o p e r a t i o n of raising slots. E v e r y slot has a p r o c e d u r e a t t a c h e d
to it called its slot-rule, which c a n test for the sorts of fillers the slot might h a v e and can p e r f o r m ac- tions. R A I S E is a possible action, and is illustrated as follows. C o n s i d e r a s e n t e n c e like
(3) Which chair does M a r y believe that AI b o u g h t ?
T h e VP f r a m e f o r believe has a slot C O M P ( v e r b - c o m p l e m e n t ) which c a n be filled b y a n o t h e r VP. T o the right of believe is a VP that A I bought. This VP is " i n c o m p l e t e " in the sense that its A S L O T S regis- ter still contains a slot OBJ. In the slot-rule f o r C O M P there is an instruction to R A I S E all m e m b e r s of the filler's A S L O T S t h a t b e l o n g to a specified list. (Some slots, such as v e r b auxiliaries, are not raised b y C O M P . ) Raising a slot m e a n s creating a
new m e m b e r of the matrix V P ' s A S L O T S which is a sort of " i m a g e " of the lower slot. It has the s a m e slot-rule and it is m a r k e d as being associated with the lower slot. A slot m a y be raised t h r o u g h several levels, but a p a t h showing its origin is m a i n t a i n e d for the p u r p o s e of semantic interpretation.
In s e n t e n c e (3) w h e n the C O M P slot for believe
raises the l o w e r O B J to a n e w slot O B J 1 , this is available to be filled b y which chair at a c e r t a i n stage w h e n the t o p V P is looking to the left.
T h e W H - m o v e m e n t t h a t a p p e a r s in s e n t e n c e s ( 1 ) , ( 2 ) , a n d (3) is a special kind of unbounded left movement (the left-dislocated i t e m can be m o v e d out of an u n b o u n d e d n u m b e r of e m b e d d e d V P ' s ) . A n - o t h e r kind is topicalization, as in
(4) This chair, she said y o u could put in the room.
Raising applies to u n b o u n d e d left m o v e m e n t in gen- eral, and in fact the same R A I S E o p e r a t i o n i n v o k e d b y the V P C O M P slot is used f o r handling b o t h (3) and (4).
In A T N g r a m m a r s , u n b o u n d e d left m o v e m e n t is h a n d l e d b y the H O L D facility (Woods, 1970, 1973). T h e A T N puts the l e f t - d i s l o c a t e d i t e m (like this chair in (4)) on a special stack b y the H O L D action, a n d t h e n at a later o p p o r t u n e time r e m o v e s it f r o m the stack while traversing a virtual arc - - - in the case of (4), an arc parallel to the v e r b - o b j e c t - N P arc - - - so that this chair b e c o m e s the o b j e c t of put.
T h e H O L D m e t h o d d o e s n o t mix well with b o t t o m - u p parsing, h o w e v e r , b e c a u s e it d e p e n d s on using the c o m p l e t e left c o n t e x t at e a c h point. ( T h e item retrieved on a virtual arc could h a v e b e e n held a n y w h e r e f r o m the beginning of the sentence.) Since b o t t o m - u p , m i d d l e - o u t analysis a p p e a r s to be b e s t f o r n a t u r a l l a n g u a g e (as this p a p e r a t t e m p t s to show), and since R A I S E is a viable alternative to H O L D , we h a v e an a r g u m e n t against H O L D .
F u r t h e r m o r e , raising a p p e a r s to be m o r e general- ly applicable t h a n H O L D . As hinted at in the dis- cussion of (2) a b o v e , c o n j u n c t i o n c o n s t r u c t i o n s should also involve raising. In t h a t sentence, the
Michael C. M c C o r d S l o t Grammars
and f r a m e should be responsible for creating the c o n j o i n e d V P f r a m e spanning that AI bought and John was sitting in, whose A S L O T S contains a slot OBJ1 which is related to b o t h the o b j e c t of bought
and the object of id, b y raising. This OBJ1 is fur- ther raised by the C O M P slot of believe to a slot which is finally filled by which chair.
The details for raising b y conjunctions have not b e e n completely w o r k e d out, but the general situa- tion seems tO be roughly as follows. W h e n a con- junction frame sees two frames of the same category on either side (the two conjuncts), it should con- struct raised slots corresponding to the intersection
of the A S L O T S lists of the conjuncts. (In calculat- ing the intersection, two slots that are already raised are c o n s i d e r e d equal if t h e y originated f r o m the same slot.) F o r example, in the sentence
(5) J o h n ate and slept.
we could consider the ate frame to have A S L O T S = (SUBJ A U X L A D V L O B J ) , but the slept f r a m e would have A S L O T S = ( S U B J A U X L A D V L ) . T h e i n t e r s e c t i o n would be (SUBJ A U X L A D V L ) , and these slots would be raised to slots (SUBJ1 A U X L 1 A D V L 1 ) in the c o n j o i n e d VP ate and slept.
T h e n John fills SUBJ1, to form the complete VP (5). T h e r e is no o b j e c t slot available in the con- joined VP. On the o t h e r hand, the c o n j o i n e d VP
cooked and ate would have b o t h a subject and an object slot available, and we could get
(6) John c o o k e d and ate the pizza.
In W o o d s (1973) conjunctions were handled by a
system facility designed specially for conjunctions --- meaning that the rules for conjunctions are not input by the grammar writer. T h e b o t t o m - u p , middle-out analysis with raising outlined a b o v e seems m o r e straightforward and more controllable b y the gram- mar writer. Consider a raising t r e a t m e n t possible for the following example discussed in W o o d s (1973):
(7) J o h n drove his car through and
c o m p l e t e l y demolished a plate glass window.
The and frame has on its left the V P drove his car through with A S L O T S = (SUBJ A U X L A D V L O B J 1 ) , where OBJ1 is raised from the OBJ slot in the incomplete PP by A D V L . T o the right is the
V P completely demolished having A S L O T S = (SUBJ A U X L A D V L OBJ). T h e and f r a m e creates the conjoined VP drove his car through and completely demolished, having raised A S L O T S = (SUBJ1 A U X L 1 A D V L 1 0 B J 2 ) corresponding to the essen- tially identical A S L O T S lists of the two conjuncts. T h e n SUBJ1 is filled b y John and OBJ2 is filled b y
a plate glass window, for the analysis of the complete sentence.
3. States and slots
If all phrases had their heads at the beginning or end, a n d their o t h e r slots could be filled in any or- der, then all searching could be controlled by the u n o r d e r e d set A S L O T S . M a n y languages (including English) have an intricate c o m b i n a t i o n of free place- m e n t of some slot-fillers with ordering restrictions on others. One conceivable m e t h o d of controlling o r d e r would be to include tests in slot-rules for the position of the filler relative to o t h e r slot-fillers; but this seems to result in an unreasonable a m o u n t of testing, especially in languages in which there is a good deal of fixed order. It appears to be advisable to use some notion of " s t a t e " or " s t a g e " in building phrases. In middle-out construction, a n o t h e r r e a s o n for using states is to control the direction in which the construction is proceeding; adjunctions might be made on the left, then the right, then switch direc- tions again.
In a slot grammar, each phrase frame has a regis- ter S T A T E , which contains an atom somewhat like an A T N state. E a c h state has a direction, L E F T or R I G H T , associated ( p e r m a n e n t l y ) with it, the idea being roughly that if a phrase is in state S, then it is looking for fillers in the direction associated with S.
A restriction placed on states in slot grammars which makes their use much more constrained than in A T N ' s is that the set of states for a given phrase type (like VP) is linearly ordered. As a phrase gets built up, it can m o v e ahead, b u t can n e v e r m o v e back, in this ordering of states. Because of the line- ar order, the term stage might be more suggestive than state.
In the grammar, slots are related to states in the following way. E a c h slot is specified to be attached
to one or more states. T o fill a given slot with a p r o p o s e d filler, one must be able to advance (or not m o v e b a c k ) f r o m the c u r r e n t state of the matrix phrase (along the linear o r d e r of states) to a state to which the slot is attached, with the direction of the state corresponding to the direction of the p r o p o s e d filler.
T h e following diagram for a small V P grammar illustrates the use of states and slot attachment.
(8)
67]
(Tq
A U X L > A U X L O B J
S U B J >
A D V L
T h e states are $1, $2, and $3. H e r e , and in future examples, the integers in the state n a m e s indicate their linear order. States $1 and $2 have direction L E F T and $3 has R I G H T . Slots are written u n d e r the states to which they are attached. N o t e that A U X L is attached to b o t h $1 and $2. The sign >
M i c h a e l C. M c C o r d Slot G r a m m a r s
a f t e r a slot indicates that it is a t t a c h e d as a state- advancer. This m e a n s that if the slot is filled while the f r a m e is in the given state, t h e n the f r a m e will a d v a n c e to the next state (otherwise it stays in the given state). A U X L is a t t a c h e d to $2 as a state- advancer, b u t to S1 as a n o n - s t a t e - a d v a n c e r . Slots A D V L and A U X L are multiple slots, although that is not s h o w n in the diagram.
H e r e is an e x a m p l e of VP c o n s t r u c t i o n using VP g r a m m a r (8). T h e successive V P ' s c o n s t r u c t e d are underlined, and to the side of e a c h underline is s h o w n the slot just filled and the state the VP is in after the slot-filling.
C o u l d A 1 h a v e a l r e a d y l e f t the b u s ? (9) HEAD, S I A D V L , S I AUXL, S I SUBJ, S 2 A U X L , S 3 OBJ, $3
W h e n SUBJ is filled at S1, the f r a m e is a d v a n c e d to $2, where it m a y get an A U X L in a question sen- tence. Several A U X L ' s m a y a p p e a r in state S1, but once the SUBJ has b e e n filled, there is a chance for only o n e m o r e A U X L , b e c a u s e an A U X L at $2 will a d v a n c e the f r a m e to $3. Also n o t e t h a t there is no c h a n c e for an A D V L b e t w e e n the S U B J a n d the p r e p o s e d question A U X L , as in
(10) * C o u l d a l r e a d y kl h a v e l e f t t h e b u s ?
C o n s i d e r a n o t h e r example:
( 11 ) A1 h a s l e f t t h e bus.
HEAD, S I A U X L , S I SUBJ, $2 OBJ, $3
This illustrates, in the filling of OBJ, that a slot can be filled e v e n w h e n the f r a m e is not yet in a state to which the slot is attached; it just has to be possible to advance to such a state S (only the first such is used). A f t e r the filling, if the slot is a t t a c h e d to S as a s t a t e - a d v a n c e r , t h e n the f r a m e will be a d v a n c e d to the next state a f t e r S; otherwise it stays in state S.
T h e use of states in slot g r a m m a r s can be consid- e r e d a g e n e r a l i z a t i o n of s o m e t e c h n i q u e s used b y H e i d o r n in A P S G ' s . In the g r a m m a r of H e i d o r n ( 1 9 7 2 ) , a VP first w o r k s to the right getting all postmodifiers of the main verb, t h e n works to the left getting, all premodifiers. T o control this, H e i - d o r n u s e d a r e g i s t e r P R M ( s t a n d i n g f o r " p r e m o d i f i e d " ) as follows. P R M is p r e s e t to off. E v e r y rule that picks up a p o s t m o d i f i e r checks that P R M is still off, and every rule that picks up a p r e - m o d i f i e r sets P R M to on. T h e slot g r a m m a r register S T A T E can b e considered a generalization of P R M ,
in that its values are a t o m s that control direction of search.
In a r e c e n t A P S G g r a m m a r for N P ' s , H e i d o r n 2 uses a technique which is e v e n closer to our use of states. 3 H e uses a register M L ( s t a n d i n g f o r " m o d i f i c a t i o n ' l e v e l " ) which takes on integer values, and the numerical ordering is used in controlling the stages of building up an NP, allowing multiple direc- tion changes. T h e l e f t - h a n d sides of p r o d u c t i o n rules o f t e n check that M L is less t h a n or equal to a certain value, and the right-hand sides set M L to a certain value. This is similar to o u r r e q u i r e m e n t f o r advancing states in slot filling.
N o w let us e x t e n d the VP g r a m m a r (8) to one which accepts a wider range of constructions.
( 1 2 )
6q
FbF3
O B J A U X L > A U X L I O B J O B J A D V L S U B J > C O M P
A D V L A D V L
N o t e t h a t t h e r e are t w o direction switches in this g r a m m a r . First S1 and $2 go left; then there is a switch to the right with $3 a n d $4, a n d t h e n a switch b a c k to the left with $5. R e a s o n s f o r this c o m p l i c a t i o n will be given below. T h e additional slots in this d i a g r a m are I O B J and C O M P . I O B J (indirect o b j e c t ) accepts only N P ' s ; the semantically e q u i v a l e n t t o - f o r m is a c c e p t e d b y A D V L at $4.
( A D V L a c c e p t s , say, a d v e r b s and P P ' s . ) C O M P ( c o m p l e m e n t ) has VP fillers.
This VP g r a m m a r is i n t e n d e d to c a p t u r e the fol- lowing intuitive description of a w a y of building up a VP. Starting at the h e a d verb, we w o r k left get- ting possible auxiliaries a n d adverbials. A t s o m e point, we m a y get a subject. If so, t h e n there is a chance for o n e m o r e auxiliary (in the case of a ques- tion sentence). T h e n we w o r k to the right and m a y pick up an indirect o b j e c t (with no o t h e r items in- tervening b e t w e e n it and the h e a d verb). Then, still to the right, we pick up OBJ, C O M P , or a n y n u m - b e r of A D V L ' s , in a n y order. Then, b a c k to the left, we might find an O B J or a n y n u m b e r of A D V L ' s . O f course if O B J has already b e e n filled at $4, it will h a v e b e e n r e m o v e d f r o m A S L O T S and will not be available at $5. A n e x a m p l e in which O B J is filled at $5 is
(13) W h i c h c h a i r d i d J o h n b u y ?
O B J A U X L S U B J H E A D
2 Private communication to the author.
3 These two techniques were developed independently of each other.
M i c h a e l C. M c C o r d Slot G r a m m a r s
W h y are there two direction switches? A c c e p t i n g for the m o m e n t the r e a s o n a b l e n e s s of starting to the left with S1 and $2, w h y not continue left and m a k e $5 the third state? T h e answer involves raising. In sentences like (1), (2), and (3), which chair fills an object slot raised f r o m a VP f o u n d b y C O M P at $4. So' $4 has to be visited b e f o r e $5.
It still might s e e m t h a t one could m a k e only o n e direction switch b y starting i m m e d i a t e l y to the right after the h e a d verb, as was d o n e in H e i d o r n (1972). O n e r e a s o n for going left initially has to do again with raising. T h e relative clause slot in the subject N P c a n be raised to the right of the h e a d verb, as in:
(14) T h e m a n is here that I was telling y o u about.
E v e n if this right e x t r a p o s i t i o n were not h a n d l e d b y the precise m e c h a n i s m of raising, it seems r e a s o n a - ble that the subject should already be p r e s e n t in the V P b e f o r e " p l a c i n g " the e x t r a p o s e d m o d i f i e r c o r - rectly.
Also, it seems plausible psychologically to go left first, b e c a u s e the auxiliaries and the subject are so closely related to the v e r b and their position usually identifies their role. But the role of a f r o n t e d item like which chair in sentences (1), (2), and (3) can- not be identified until a good deal of the rest of the s e n t e n c e has b e e n processed.
4. Formal representation of syntax
T h e i n t e r p r e t e r - p a r s e r is written in L I S P 1.6 run- ning on a D E C - 1 0 . T h e r e are two functions, S Y N - T A X a n d L E X I C O N , which a c c e p t the g r a m m a r a n d p r e p r o c e s s it. T h e y are b o t h F E X P R functions (receiving their a r g u m e n t s u n e v a l u a t e d ) . T h e f o r m of a call to S Y N T A X will b e described in this sec- tion.
S Y N T A X is called for e a c h p h r a s e - t y p e , such as VP, NP, and PP. T h e t o p - l e v e l f o r m of a call is
( S Y N T A X p h r a s e - t y p e S T A T E S :
s t a t e - s p e c i f i c a t i o n ... SLOTS:
slot-specification ... D E F A U L T S :
slot ... )
B e f o r e going into m o r e details, let us l o o k at an e x a m p l e , the f o r m a l specification of the g r a m m a r s h o w n earlier in d i a g r a m (8).
( S Y N T A X V P S T A T E S :
(Sl L) (S2 L) ($3 R) S L O T S :
S U B J
( F L R NP) ($I >) A U X L
( F L R AUX) (SI S2 >) A D V L *
(OR ( F L R A D V ) ( F L R P P ) ) ($I) O B J
( F L R NP) ($3) D E F A U L T S :
S U B J A U X L A D V L )
T h e g e n e r a l rules are as follows. T h e s t a t e - specifications are given in the order to b e assigned to the states. T h e f o r m of a s t a t e - s p e c i f i c a t i o n is a list:
( n a m e direction [ t e s t - a c t i o n ... ])
where the square b r a c k e t s are m e t a s y m b o l s indicat- ing optionality. T h e name is the n a m e of the state and c a n be a n y L I S P atom. T h e direction is L or R.
A test-action, if given, is a L I S P f o r m which will be e v a l u a t e d , a n d m u s t give a n o n - N I L result, f o r a slot-filling to succeed, w h e n e v e r the f r a m e is a d - v a n c e d to the given state b y the slot-filling. F o r example, s u p p o s e given the s t a t e - s p e c i f i c a t i o n
($5 L (IS S U B J ) )
in a VP syntax. If an a t t e m p t e d slot-filling a d v a n c e s the f r a m e to state $5, t h e n the test (IS SUB J) will h a v e to succeed ( m e a n i n g that the SUBJ slot is al- r e a d y filled) in order for the slot-filling to succeed.
T h e g e n e r a l f o r m of a s l o t - s p e c i f i c a t i o n is as follows:
n a m e [*] slot-rule s t a t e - a t t a c h m e n t s
T h e o p t i o n a l star indicates t h a t the slot is multi- pie. During parsing, the s y s t e m takes care of re- m o v i n g n o n - m u l t i p l e slots f r o m A S L O T S as they get filled,
T h e slot-rule is a L I S P f o r m which c a n test for the sorts of fillers the slot can have, a n d p e r f o r m actions. In the s a m p l e g r a m m a r a b o v e , the slot- rules use the test ( F L R cat), which requires that the filler be of the c a t e g o r y cat. N o actions are s h o w n in this g r a m m a r ; b u t possible actions are calls to the R A I S E f u n c t i o n a n d the setting of registers, a n d these are exhibited in the g r a m m a r of Section 8,
T h e last p a r t of the slot-specification is the state- a t t a c h m e n t s . T h e required f o r m is
( { s t a t e - n a m e [ > ] } ... )
In o t h e r w o r d s , o n e writes a list of s t a t e n a m e s , e a c h optionally followed b y the sign > . If the sign > does follow the state, t h e n the slot is a t t a c h e d as an a d v a n c i n g slot, o t h e r w i s e as a n o n - a d v a n c i n g slot. T h e m e a n i n g of this f o r state transitions was discussed in the p r e c e d i n g section.
T h e last p a r t of the call to S Y N T A X is the se- q u e n c e of d e f a u l t slots. T h e s e are c o l l e c t e d b y S Y N T A X into a list and stored on the p r o p e r t y list of the p h r a s e - t y p e , to b e used as described in Sec- tion 2.
Michael C. McCord Slot Grammars
T h e r e are a few " p r i m i t i v e " functions (like F L R and R A I S E ) supplied for writing slot-rules and state test-actions. T h e s e will be described as t h e y a p p e a r in e x a m p l e s below.
5. R e p r e s e n t a t i o n of f r a m e s by t h e s y s t e m
As m e n t i o n e d earlier in Section 2, f r a m e s are stored as association lists:
( {register value} ... )
Because of the n o n - d e t e r m i n i s m in the processing, I follow W o o d s ( 1 9 7 3 ) in setting registers b y just t a c k i n g on the n e w r e g i s t e r / v a l u e pair o n t o the f r o n t of the frame.
T h e r e are several special registers k n o w n to the system. T w o that h a v e already b e e n discussed ex- tensively are A S L O T S and S T A T E . T h e others are as follows. C A T contains the a t o m which is the p h r a s e - t y p e , such as VP, or, in the case of words, the basic p a r t of speech, such as V or N. W O R D , in the case of lexical f r a m e s , c o n t a i n s the actual (inflected) word, and R O O T contains the r o o t form. F E A T U R E S c o n t a i n s the list of a t o m s t r e a t e d as features. F o r e x a m p l e , a VP m i g h t h a v e F E A - T U R E S = ( Q U E S T I O N P R O G R E S S I V E ) .
LB and R B contain, respectively, the left b o u n d - ary and right b o u n d a r y of the phrase or word. A b o u n d a r y is an a t o m r e p r e s e n t i n g the space b e t w e e n two words in the input sentence, or the start or end. (A p h r a s e always represents an analysis of a c o n - nected s e g m e n t of words in the s e n t e n c e - - - all the words b e t w e e n its left and right boundaries.)
F T E S T stands f o r
filler-test
a n d contains a f o r m which is evaluated (as a t e s t - a c t i o n ) b y the p a r s e r w h e n the f r a m e is tried as a filler. M o r e details on this will be given in the next t w o sections.T h e final s y s t e m register is F S L O T S , which is used to hold the results of already filled slots. T h e value of F S L O T S is a n o t h e r association list, of the f o r m
( {slot filler} ... )
where each filler is of course a n o t h e r frame. T h e s l o t / f i l l e r pairs in F S L O T S are placed in a c c o r d a n c e the actual positions of the fillers in the sentence. F o r instance, in the VP
P r o b a b l y J o h n left y e s t e r d a y
F S L O T S would be of the f o r m
( A D V L x SUB.I x H E A D x A D V L x).
N o t i c e that in this sort of association list, the same register can occur m o r e t h a n once, a n d an earlier o c c u r r e n c e does not " h i d e " a later one. T h e r e is a s y s t e m function
( S L O T S E T slot filler direction)
which takes care of u p d a t i n g F S L O T S during slot- filling, putting the n e w pair on the c o r r e c t side of
F S L O T S . Maintaining F S L O T S as a reflection of surface o r d e r is useful f o r o u t p u t t i n g p a r s e trees, and it is also p r o b a b l y i m p o r t a n t for s e m a n t i c inter- pretation.
N o t i c e that the t e r m s
register
andslot
are being used in distinct ways.Register
is the general t e r m for o n e of the v a r i a b l e s in o u r a s s o c i a t i o n lists.Slots
are specific to the linguistic theory. Besidesthe special slot H E A D , t h e y m u s t b e m e n t i o n e d as slots in calls to S Y N T A X ; and a n y slot relevant to a given p h r a s e f r a m e will a p p e a r s o m e w h e r e in its
A S L O T S or F S L O T S .
Although s l o t / f i l l e r associations are all stored in the register F S L O T S , each slot is also used as a reg- ister in the phrase frame. As a register, a slot c o n - tains its slot-rule. S Y N T A X stores the slot-rule of a slot on the p r o p e r t y list of the slot (under the p r o p - e r t y R U L E ) . But this is basically a default rule, and the s y s t e m allows the lexicon to m a k e exceptions, by i n f o r m a t i o n in the s i s t e r - d e p e n d e n c y list f o r the head item. Thus, the slot-rule for C O M P in the initial VP f r a m e for a v e r b like
help
can be special to t h a t verb. T o allow this flexibility, the slot-rule f o r C O M P is stored in theregister
C O M P . F u r t h e r - m o r e , it a p p e a r s t h a t the slot-rule for a given slot in a given p h r a s e f r a m e should actually be allowed to change while the phrase is being built up. R e a s o n s for this will be given in the next section, c6. T h e lexicon
T h e lexicon is a c c e p t e d and p r e p r o c e s s e d b y the L I S P f u n c t i o n L E X I C O N . E a c h m e m b e r of the a r g u m e n t list is a lexical entry, of the form:
(word c a t e g o r y [feature] ... [form] ... )
E x a m p l e s are
(JOHN N SG PROPER)
(GIVE V (VM GIVES G I V I N G GAVE GIVEN) (SD (IOBJ) ( O B J ) ) )
H e r e V M and SD stand f o r " v e r b m o r p h o l o g y " a n d " s i s t e r - d e p e n d e n c i e s " , and are actually L I S P func- tions.
W h a t L E X I C O N a c c o m p l i s h e s f o r e a c h lexical e n t r y is to p r o d u c e f r a m e s associated with the words involved in the entry, and put t h e m on the p r o p e r t y lists of the words under the p r o p e r t y L E X . T h e s e are f r a m e s f o r the w o r d as filler, as well as initial f r a m e s f o r p h r a s e s in which the w o r d is H E A D . F o r instance, the L E X list for H A S in the trial g r a m m a r s consists of a w o r d f r a m e which might b e c o m e a fil- ler for the A U X L slot in s o m e VP, as well as a V P f r a m e in which H A S is the main verb.
T h e f o r m s t h a t a p p e a r at the e n d of a lexical e n t r y (such as the V M a n d SD f o r m s a b o v e ) are e v a l u a t e d b y L E X I C O N and c a n a d d to the collec- tion of f r a m e s being constructed. If no f o r m s are
Michael C. McCord Slot Grammars
given, L E X I C O N will only construct a single word frame (for the word at the beginning of the entry).
F o r m s like VM add inflected words to the root word at the h e a d - o f the entry, so that frames get constructed for all these words. I have not gone into spelling rules for regular inflections, but these could easily be added.
T h e SD f o r m implements the ideas on sister- d e p e n d e n c y slot lists discussed in Section 2. A call to SD has the form:
(SD {(slot [slot-rule])} ... )
An example is
(SD (OBJ) (COMP (FLR ADJ))).
The slots listed are of course the s i s t e r - d e p e n d e n c y slots for the verb. T h e optional slot-rule after a slot will replace the slot-rule given for that slot in syn- tax; thus the latter should be considered a default
slot-rule. The function SD constructs the initialized p h r a s e f r a m e in which the verb is H E A D . T h e (initial) A S L O T S list consists of the default slots from the VP syntax plus the slots specified in SD. Also, any test-actions associated with the first state of the VP are e v a l u a t e d --- as if the H E A D ad- vances the frame to the first state.
It was argued in H u d s o n ( 1 9 7 7 ) that subject- verb agreement rules belong to m o r p h o l o g y and not to syntax. T h e main point of the argument is that some verbs make more distinctions than others. Considering the standard six combinations of person and number, one notes that nearly all English verbs make a distinction o n l y b e t w e e n the third p e r s o n singular and the o t h e r combinations --- and this is only in the present tense. The exceptions are that the modals make no distinctions (in present or past), and the verb be makes three distinctions in the pres- ent and two in the past.
If we put subject-verb agreement in English syn- tax, we would p r e s u m a b l y have to c a r r y along enough distinctions of p e r s o n and n u m b e r tO satisfy the fastidious verb be. On the o t h e r hand, if the finite verb is gave or can, t h e r e is no n e e d for subject-verb a g r e e m e n t to come up at all. A n o t h e r example is that some d e t e r m i n e r s require n u m b e r agreement with the head noun in English, but for the most c o m m o n one of all, the, there is no need for n u m b e r agreement to e n t e r the picture.
As with s i s t e r - d e p e n d e n c y slots, this is a case where data-driven processing is called for, and all agreement rules are put in the lexicon. It was men- t i o n e d in the p r e c e d i n g section that the system knows a b o u t a frame register F T E S T containing a test which must be satisfied when the frame is used as a filler. This is where we place the a g r e e m e n t check, and the lexicon can adapt it uniquely to the particular type of verb involved.
T h e F T E S T e m p l o y e d f o r a g r e e m e n t uses a ( F E X P R ) function C H E C K , which is called as fol- lows:
( C H E C K slot test)
F o r example, the filler frame for the verb has has in the F T E S T register:
(CHECK SUBJ (NEGF IT PL))
H e r e the N E G F test requires that the subject does not have the feature P L (plural). It seems b e t t e r to express it negatively, instead of requiring the SUBJ to have the feature SG (singular), so that for VP subjects as in
T h e b o y s ' being there causes trouble
we will not have to say that the VP subject is SG.
W h e n the finite verb is tried as a filler (either of A U X L or the VP H E A D ) and ( C H E C K SUBJ test) gets evaluated, what happens? A p r o b l e m is that the SUBJ m a y or m a y not have already b e e n filled at this point, depending on w h e t h e r we have certain question sentences or not. I f SUBJ is already pres- ent, C H E C K applies the test to the SUBJ filler on the spot. Otherwise, it adds the test to the slot-rule of SUBJ, by making a new SUBJ slot-rule of
( C O N D (test original-SUB J-slot-rule)).
Being able to change slot-rules in this way is a n o t h - er r e a s o n for storing slot-rules in the slot as register, as was discussed at the end of the preceding section.
T h e lexical function V M actually takes responsi- bility for creating these C H E C K ' s as necessary for all verbs besides be and the modals. F o r instance, VM will create a C H E C K f o r G I V E S , but none for G A V E .
A n o t h e r example of data-driven processing which has b e e n put into the lexicon is the set of require- ments that English auxiliaries have on o t h e r auxiliar- ies and the main verb. In the VP syntax, there is simply a multiple slot A U X L , with no distinction b e t w e e n kinds of auxiliaries, their ordering, or their inflectional requirements. But t h e r e is the well- k n o w n sequence:
modal p e r f e c t - h a v e p r o g - b e passive-be main-verb
with the inflectional r e q u i r e m e n t that each auxiliary has on w h a t e v e r verb follows it.
O n e alternative would be to have f o u r slots M O D A L P E R F , P R O G , and PASS. But a problem is that this clutters up A S L O T S quite a bit, so that a lot of slots would keep getting tried uselessly. It seems b e t t e r to go more b o t t o m - u p and p r o c e e d from w h a t e v e r verbs actually appear. T h e A U X L filler be, i f it appears, can check w h e t h e r the next verb to its right is an ing-form or e n - f o r m , and can declare that the V P is progressive or passive accord- ingly. This test-action is put into the lexical e n t r y
Michael C. M c C o r d Slot G r a m m a r s
for BE, and L E X I C O N m a k e s it p a r t of the F T E S T for the be filler-frames.
O n e thing that is done in syntax to facilitate this testing is to k e e p a VP f r a m e register V E R B 1 set to the current l e f t - m o s t verb. E a c h auxiliary has to check the f e a t u r e s of V E R B 1 . This will a p p e a r in the sample syntax given in Section 8.
T h e o r d e r i n g of the auxiliaries is strict, a n d checks on this are also m a d e in their filler-tests. P e r h a p s it is not e v e n c o m p u t a t i o n a l l y n e c e s s a r y or p s y c h o l o g i c a l l y real to do this in parsing; p e r h a p s one could leave it to generation.
T h e multiple slot A U X L collects what could be t h o u g h t of as premodifiers of the main verb. A n analog in N P ' s is the multiple slot A D J C which col- lects p r e m o d i f i e r s of the h e a d noun, filled b y certain types of adjectives, adjective p h r a s e s , and N P ' s . H e r e too, there are ordering restrictions as in big red house vs. *red big house, although it would seem foolish to enshrine this in syntax b y making lots of slots for different types of n o u n premodifiers. A n e x a m p l e that m a k e s A U X L look a little m o r e free is that in s o m e A m e r i c a n dialects, m o r e t h a n one m o - dal can be used, as in might ought to do that, or e v e n might should do that.
7. O u t l i n e of t h e parsing a l g o r i t h m
T h e parsing algorithm takes a d v a n t a g e of some preprocessing done b y the function S Y N T A X . The input to S Y N T A X shows a linear order on the states and shows each slot a t t a c h e d to certain states. R e - call ( f r o m Section 3) the conditions n e c e s s a r y for filling a slot SL w h e n the matrix f r a m e is in state ST, a n d the p r o p o s e d filler is on, say, the left. T h e r e must b e a state s_> ST such that SL is a t t a c h e d to s and the direction of s is L E F T . Suppose such an s exists. L e t ST1 be the first such. I f SL is a t t a - ched to ST1 as a s t a t e - a d v a n c e r , let S T R A N S be the successor state of ST1; otherwise let S T R A N S = ST1. If no s exists, let S T R A N S be N I L . L e t us call S T R A N S the left-transform of state ST b y slot SL. T h e right-transform is d e f i n e d similarly. T h e s e state t r a n s f o r m s are precalculated b y S Y N T A X , and stored on the p r o p e r t y lists of the slots, thus saving on search time.
T h e heart of the parsing algorithm is a function
( M O D I F Y I T M A T R I X D I R )
It constructs all f r a m e s which result w h e n the f r a m e I T modifies (fills a slot in) the f r a m e M A T R I X f r o m the direction DIR. ( D I R = L E F T m e a n s that I T is on the immediate left of M A T R I X . )
M O D I F Y p r o c e e d s as follows. L e t us assume that D I R = L E F T (the case D I R = R I G H T is en- tirely s y m m e t r i c ) . L e t ST be the c u r r e n t state of M A T R I X . T h e n for e a c h slot SL in the A S L O T S
list of M A T R I X , M O D I F Y d e t e r m i n e s w h e t h e r I T can fill SL b y m a k i n g the following five tests, in the o r d e r given:
(a) T h e l e f t - t r a n s f o r m S T R A N S o f ST b y SL m u s t be n o n - N I L .
(b) T h e slot-rule of SL is evaluated, and the re- sult must be n o n - N I L . This result is called A C - T I O N a n d is s a v e d for use in test (d).
(c) T h e filler-test (the value of the F T E S T regis- ter in IT) m u s t evaluate to n o n - N I L .
(d) T h e A C T I O N m u s t e v a l u a t e to n o n - N I L . (The reasons for this double evaluation of the slot- rule will be given below.)
(e) If S T R A N S is not equal to ST, then the test- action a s s o c i a t e d with S T R A N S is e v a l u a t e d a n d m u s t give a n o n - N I L result.
If these five tests are satisfied, t h e n the f r a m e M A T R I X is u p d a t e d as follows. SL is set to I T using S L O T S E T , as in Section 5. A S L O T S is modi- fied b y the deletion of SL if SL is n o n - m u l t i p l e . S T A T E is set to the l e f t - t r a n s f o r m S T R A N S . Final- ly, the left b o u n d a r y of M A T R I X is set to the left b o u n d a r y of IT. T h e p r e s e n c e of this new version of M A T R I X is r e c o r d e d b y a f u n c t i o n I N S E R T , described below. O f course the old version of M A - T R I X stays around, f o r possible use in o t h e r modifi- cations.
N o t e t h a t tests (b) a n d (d) p e r f o r m a double e v a l u a t i o n of the slot-rule: T h e value o b t a i n e d in (b) should be a n o t h e r L I S P f o r m ( A C T I O N ) , and this is f u r t h e r evaluated in (d). The r e a s o n f o r this is that the action p e r f o r m e d b y a slot-rule m a y dis- turb registers that m u s t be e x a m i n e d b y the filler- test, used in (c). This situation does not c o m e up in the sample g r a m m a r of the preceding section, but it will be illustrated in the next section. (In the g r a m - m a r of the preceding section, all slot-rules just eval- uate to T if they do not give N I L , so the action, T, is trivial, and (d) will be satisfied if (b) is.)
T h e top level function, P A R S E , of the p a r s e r t a k e s a s e n t e n c e , a n d p r o c e s s e s its w o r d s left to right as follows. It creates b o u n d a r y m a r k e r s f o r the w o r d s (as it goes), and, f o r e a c h b o u n d a r y m a r k e r B, it stores on the p r o p e r t y list of B, u n d e r the indicator R E S U L T S , the list of all f r a m e s p r o d - uced so far whose right b o u n d a r y is B.
F o r e a c h n e w w o r d W, P A R S E looks o n the L E X list of f r a m e s associated with W ( p r o d u c e d b y the lexicon). If this list is e m p t y , W is not in the lexicon and parsing is halted with an error message. O t h e r w i s e , P A R S E calls the f u n c t i o n I N S E R T on each f r a m e in the L E X list.
T h e goal of the f u n c t i o n I N S E R T , w h e n it is given a f r a m e F R , is to w o r k out all w a y s t h a t F R can m o d i f y , or be m o d i f i e d by, the f r a m e s that al-
M i c h a e l C. M c C o r d Slot G r a m m a r s
r e a d y exist, as well as to record the existence of F R f o r future m o d i f i c a t i o n s ( a f t e r m o r e w o r d s h a v e b e e n processed). F o r the latter purpose, I N S E R T simply puts F R o n the R E S U L T S list of its right b o u n d a r y . F o r the f o r m e r purpose, I N S E R T does the following. F o r e a c h f r a m e F R 1 in the R E - S U L T S list of the left b o u n d a r y of F R , I N S E R T calls
( M O D I F Y F R F R 1 ' R I G H T ) and
( M O D I F Y F R 1 F R ' L E F T ) .
N o t e the recursion t h a t exists b e c a u s e I N S E R T calls M O D I F Y a n d M O D I F Y c a n call I N S E R T . T h e recursion stops b e c a u s e M O D I F Y does not call I N S E R T if no modifications are possible.
W h e n P A R S E h a s p r o c e s s e d the last word, it looks for those V P f r a m e s t h a t s p a n the whole sen- tence, a n d it prints t h e s e o u t in an i n d e n t e d t r e e f o r m a t , as will b e d e s c r i b e d a n d illustrated in the next section.
8. A sample grammar
T h e syntax diagrams are s h o w n in Figure 1, and the input to L I S P is s h o w n in Figures 2 a n d 3. A p o r t i o n of the lexicon is given later.
L e t us first look at the N P syntax. A n N P f r a m e begins with the h e a d n o u n in state N1. T h e test- actions a s s o c i a t e d with this first state involve R A I S E F , which raises f e a t u r e s f r o m the m o s t recent filler (in this case, the h e a d n o u n ) to the m a t r i x frame. T h e result is t h a t the n u m b e r of the h e a d n o u n is m a d e a f e a t u r e of the N P itself. F r o m the h e a d noun, o n e c a n w o r k left getting a n y n u m b e r of adjectives ( A D J C is multiple). If a d e t e r m i n e r is selected (filling D E T R ) t h e n the NP is a d v a n c e d to state N2, so that no m o r e p r e m o d i f y i n g adjectives can be picked up. T h e n o n e is r e a d y for p o s t m o d i f i - ers (in this case, P P ' s ) , filling the multiple slot R E L . B u t the f r a m e c a n get into state N 2 a n d r e c e i v e R E L fillers, as in tea with cream, w i t h o u t being ad- v a n c e d there b y D E T R , just b e c a u s e of the fact t h a t N 2 follows N1.
T h e PP syntax is trivial, just having a p r e p o s i t i o n as head, followed b y an NP.
T h e V P syntax is an extension of the g r a m m a r s h o w n earlier in d i a g r a m (12). T h e c u r r e n t g r a m - m a r has a fairly c o m p l e t e t r e a t m e n t of the v e r b sys- tem. As outlined in the section on the lexicon, the r e q u i r e m e n t s of the v e r b auxiliaries are m a n a g e d b y k e e p i n g a VP register V E R B 1 set to the currently l e f t - m o s t verb. This is initialized b y the state test- action a t t a c h e d to state S1 (see Figure 2). This is e x e c u t e d as s o o n as the H E A D v e r b is filled in (actually in the lexicon), setting the register V E R B 1 to the value of the slot H E A D (i.e., to the f r a m e for the h e a d verb).
U p d a t i n g of V E R B 1 is handled b y the slot-rule for A U X L :
( = = > ( F L R V AUX) ( = VERB1 I T ) )
This rule is involved in a non-trivial application of the d o u b l e e v a l u a t i o n s c h e m e f o r slot-rules de- scribed in the p r e c e d i n g section. W h e n
( = = > test action)
is evaluated, the test will first be evaluated. In the a b o v e example, this asks w h e t h e r the filler is a v e r b with the f e a t u r e A U X . I f the test gives N I L , t h e n the function = = > returns N I L , Otherwise, = = > returns the action, unevaluated. T h e p a r s e r saves this f o r m a n d evaluates the filler-test f o r the c u r r e n t filler auxiliary, which needs to e x a m i n e V E R B 1 be-
fore it gets changed. If this test succeeds, then the p a r s e r evaluates the action, ( = V E R B 1 I T ) , which u p d a t e s V E R B 1 to the new filler auxiliary.
O n e addition a p p e a r i n g in the VP syntax a b o v e is the B I N D E R slot a t t a c h e d to state $8. This gets subjunctions like that, although, if, and whether at the f r o n t of the VP.
T h e o t h e r additions of states h a v e to do with the auxiliaries a n d the s u b j e c t in q u e s t i o n sentences. State $3 has no slots a t t a c h e d , but is just there to hold the t e s t - a c t i o n ( A D D F Q U E S T I O N ) , as s h o w n in Figure 2, which is e x e c u t e d f o r p r e p o s e d auxiliar- ies. This adds the f e a t u r e Q U E S T I O N to the matrix VP. N o t e t h a t the state t e s t - a c t i o n is placed on the state that the p r e p o s e d auxiliary advances the f r a m e to, in a c c o r d a n c e with the rules described in Section 4. A n d the p r e p o s e d A U X L is a t t a c h e d to $2 as a s t a t e - a d v a n c e r so that no m o r e A U X L ' s c a n a p p e a r to its left. T h e extra state $3 does not " g e t in the w a y " of o t h e r state transitions b e c a u s e of the p r e - processing d o n e b y S Y N T A X ( d e s c r i b e d in Section 7).
State $4 is a d d e d in o r d e r to h a n d l e q u e s t i o n sentences in which the h e a d v e r b is the only v e r b and is an auxiliary, as in
Is J o h n H a p p y ? M a y I? D o e s he?
This is r e f l e c t e d in the state t e s t - a c t i o n s for $4 s h o w n in Figure 2. T h e f u n c t i o n (IS slot) tests that t h a t slot is filled; (ISF f r a m e f e a t u r e ) tests w h e t h e r the given f r a m e has the given feature; ($ register) gets the value of the register.
In o u r g r a m m a r , the h e a d of a VP is just the last
v e r b in the v e r b group, a n d in elliptical V P ' s will be t r e a t e d like a m a i n verb. In an elliptical s e n t e n c e like Could he be? the v e r b be is the H E A D of the VP and is just a v e r b which h a p p e n s to be m a r k e d with the f e a t u r e A U X . W e leave it for o t h e r ( n o n - syntactic) rules to decide w h e t h e r this VP is ellipti- cal for s o m e t h i n g like Could he be happy there? or
Could he be going there?
Michael C. McCord Slot Grammars
V P
6q
B I N D E R
6q
O B J A D V LO7]
A U X L >
O7]
A U X L S U B J > A D V LJ%
S U B J[7O
I O B J
50
O B J C O M P A D V L
N P P P
<77
A D J C D E T R >50
R E L
F3
O B JFigure 1. Syntax diagrams.
( S Y N T A X V P
S T A T E S :
($I L (= VERBI (SL$ H E A D ) ) )
(s2 L)
($3 L ( A D D F Q U E S T I O N ) )
SZ~ R
( N O T (IS A U X L ) )
( I S F ($ V E R B I ) A U X )
( A D D F Q U E S T I O N ) )
S5 R)
S6 R)
($7 L (IS S U B J ) ( C L O S E ) ) (S8 L)
S L O T S : B I N D E R
( F L R S U B J U N C T I O N ) ( $8 )
S U B J
( F L R NP) ($I > $4)
A U X L
( = = > ( F L R V A U X ) (= VERBI IT))
($I $2 >)
I O B J
( F L R N P ) ($5) O B J
( F L R NP) ($6 $7)
C O M P
(==>(FLR VP) ( R A I S E ( O B J A D V L ) $ 7 ) ) ($6)
A D V L
( O R ( F L R A D V ) ( E L m P P ) )
(SI $6 $7)
D E F A U L T S :
B I N D E R S U B J A U X L A D V L )
Figure 2. VP syntax.
( S Y N T A X N P S T A T E S :
( N I L ( R A I S E F SG) ( R A I S E F PL)) (N2 R)
S L O T S : D E T R
( F L R D E T ) (NI >) A D J C *
( F L R A D J ) (NI R E L
( F L R PP) (N2 D E F A U L T S :
A D J C D E T R R E L
( S Y N T A X PP S T A T E S :
(Pl R) S L O T S :
O B J
( F L R PP) (Pl D E F A U L T S :
O B J )
Figure 3. NP and PP syntax.
The slot-rule for C O M P in Figure 2 c o n t a i n s a call to the R A I S E function:
( R A I S E ( O B J A D V L ) $7).
T h e first argument to R A I S E is the list o f slot types to be raised. A n y slot in the filler's A S L O T S will be raised if it is actually OBJ or A D V L o r if it origi-
nally c a m e f r o m o n e o f these slots (by previous rais- ings). E a c h raised slot is given a n e w and unique name, but a record is kept o f w h e r e it c a m e from. It is given the s a m e slot-rule and multiple property as the slot it w a s just raised from. T h e remaining arguments to R A I S E f o r m a s t a t e - a t t a c h m e n t s list, s h o w i n g w h e r e the raised slots are to be attached.
[image:11.612.66.561.0.728.2] [image:11.612.69.546.52.661.2]