Professional Documents
Culture Documents
C ompu te r S c i e n c e N S C- 2
GE FOR E XP RE S S I N G G RE S T RI C T I ON S
IN N O DAL S P AN S P A R S I N G O F N AT U RA L
J e r ry R . H obb s
Re p o r t N o N S C - 2 p re p a re d un de r
.
G r an t No N S F - GJ - 1 2 0 2 X 2
. f r om
th e N at i on a l S c i e n c e F oun d a t i on
T AB LE O F C ON T E N T S
C h ap t e r
1 . I n t r o du c t i on
S t r i ng An a l y s i s
A u t oma t i c P a rs i n g o f N a t u r a l L a n g u a ge
P a rs i n g A l g o ri thms
Amb i g u i t y i n N a tu r a l L an g u ag e
2 . Th e G r amma r
T h e C omp on e n t s o f th e G ramma
r r 24
T h e BN F C omp o ne n t 25
Th e Re s t r i c t i on s 45
L o c a t i n g R e l at i on s
T h e W o r d D i c t i on a ry
3 . Th e N o d a l S p an s A l g o r i thm
I n f o rma l D e s c r i p t i on
F o rma l D e s c r i p t i on
E x amp l e
C an d i d a t e s Li s t s
S p a c e and T ime R e q u i re me n t s
H i s t o ry
4 . N od a l S p an s P a r s i n g wi t ho u t Re s t r i c ti on s :
S tati s t i cal Re s u l t s
I n t r od u c t i on
Th e I n ve r s e G r amma r
Th e Me r g i n g P ars ing A l go r i th m
Re s u l t s
-
iii
C h a p te r
5 . A Me t a l an g u age f or E xp re s s i n g G r amma t i c a l
Re s t r i c t i on s 100
G e ne r al D e s c r i p t i on o f th e R e s t r i c t i on
Me t a l an gu age ; Th e C o re
H o u s i n g S p e c i f i c a t i on s
F l ag an d A t t ri b u te — C h e ck i n g S t a teme n t s
F o rmi n g th e N ew C o re ; F l a g - S e t t i n g I n s t ru c ti on s
E n dp o i n t C h e ck i n g S t a t e me n t s ; C omma R e s t r i c t i on s
S p an C h e c k i n g S t a t e me n
ntts
S e m i g r a mm a t i c a l i t y Ma r
rke
k rs
S yn t ax o f th e R e s t r i c t i on M e t a l an g u ag e
S e m an t i c s o f th e Re s tr i c t i on M e t a l an g u a ge
Th e L an gu a ge i s S t i l l C on t e x t — F re e
fo r E n g l i s h
I n t rod uc ti on
R e s t ru c t u r i n g th e A s s e r ti on S t r i n g
R e s t ru c t u ri n g the L e f t A d j un c t of the N o un
A dve rb i a l P re p o s i t i on P re p o s i t i on S trings
OBJLI S T R e s t r i c t i on s
W r i ti n g Re s t ri c t i o n s
E x amp l e s o f R e s t ri c t i on s i n A c t i on
Th e C omp l e te A l g o r i thm
Th e I mp l e me n t a t i on
_
i v_
7 . An A l go r i thmi c Ap p ro ac h to S e m i g r a mm a t i c a l i ty
I n t ro du c t i on
Th e A l g o r i thm
Th e H i e r a r ch y
B i b l i o g r ap h y
A pp e n d i x
T he R e s t r i c t i on s E xp re s s e d i n th e B o t tom - Up
R e s t r i c t i on M e t a l an g u ag e .
2 06
" "
D e e p e s t V e rb an d D e e p e s t O b j e c t o f Be
Re s t r i c t i on s .
A g re e me n t R e s t r i c t i on s
C omm a R e s t r i c t i on s
N o un P h r as e R e s t r i c t i on s
P o s i t i on a l R e s t r i c t i on s
Q u an t i t i e s R e s t r i c t i on s
S e l e c t i on a l Re s t r i c t i on s
S e n te n c e N omi n a l i z a t i on R e s t r i c t i on s
V e rb an d C e n t e r R e s tr i c t i on s
Wh — S t r i n g R e s t r i c ti o n s .
I ndex of F l ag s
S tr in g G r am m a r o f E n g l i s h u s e d i n S ta ti s t i c al
S t u dies o f C h ap t e r 4 .
260
W i th i n t he l e ve l o f s yn t a c t i c an a l y s i s by c omp u te r
p os s i b l e t od ay , a l a r ge n umb e r o f E ng l i s h s e n te n ce s a re
al l p ars e s of a se t ne n c e . T op - d own s i n g l e - t r a ck i n g
a l go r i thms n e c e s s a r i l y re q u i re e xp on e n t i a l t i me i n th i s
p a r s i n g a l g o r i thm p ro c u c e s al l p ar s e s i n p ara l l e l i n
3
t i me n , y i e l ds a c onve n i e n t re p re s e n t a t i on of amb i g u i ty ,
i f a p o r t i on o f an i n p u t s t r i n g i s c ap ab l e o f two d i f f e re n t
s ymb o l , th e a l go r i th m re p re s e n t s th i s s ymb o l b y o n ly on e
n o d e i n the t re e - l i k e s t ru c t u re i t b u i l d s . Amb i g u i ty i s th u s
l oc a l i z e d an d p re ve n te d f r om c au s i n g e xp on e n ti a l e xp l o s i on .
I n a dd i t i on , a d e v i c e k n own as c an d i d a te s l i s t s , o r p re d i c t o r ,
c on s t r a i n s p o s s i b l e i n t e rp re t a t i o n s to th os e c on s i s te n t w i th
th e i n t e rp r e t a t i on s o f e a r l i e r pa r ts o f th e i n p u t . A
re q u i r e s n .
- vi i
Th i s d i s s e r t at i on con f ron t s th e p r ob l em o f ad ap t i n g th e
n o d a l s p an s a l g o r i thm to th e p a rs i n g o f n a t u r a l l an g u age .
Th e g r amma r t ak e n as a p ro t o ty p e i s th e re a s on ab l y b ro ad
U n i ve r s i ty . Thi s gra L ma r c on s i s t s o f a c on te x t - f re e
c omp on e n t of ab ou t 200 p r od u c t i on s wh i ch i n d i c a t e th e
p os s i b l e c on s t ru c t i on s o f E n g l i s h , an d a set o f ab o u t 200
re s t r i c t i on s wh i ch l o ok a t a t t ri b u te s o f w o r ds i n th e i n p ut
to ch e ck th e p a r s e t re e as i t i s e vo l ve d f o r w e l l - f o r m e d n e s s .
F i rs t , s t a t i s t i c a l te s t s we re run to de te rm i n e i f th e
a l go r i thm c ou l d b e ap p l i e d t o th e c on te x t - f re e c omp on e n t
a l on e , w i th th e re s t ri c ti on s b e i n g app l i e d a f t e rw a rd s .
D i s a s t ro u s e xp l o s i on s i n s p a c e re q u i re me n t s r e s u l te d .
N e ve rt h e l e s s , c omp a r a t i ve te s t s i n d i c at e d th e f o rm th e
I n pa r ti cul ar , c an d i d a te s l i s t s w e re f o un d t o s ave up t o
50% i n s p a c e an d t ime . Re s u l t s o f th e s e t e s t s a re p re s en te d .
No dal s p an s p a rs i n g o f Engl i sh th e re fo re re q u i re s t h e
e xp re s s i on of re s t r i c t i o n s i n a f o rm app rop ri a te to th e
a l go r i thm . I n par ti cu l ar , th e y mu s t a c t s t r i c t l y l o c a l l y .
B e c a u s e d i f f e r en t i n t e rp re t a t i on s o f an amb i g u o us po r ti on
o f a s e n te n c e may b e me r ge d un de r o ne s p an , it is n ot
p os s i b l e t o t r ave r s e th e p a r s e t re e e as i l y ; i n f o rma t i on
n e e de d b y a re s t r i c ti on mu s t b e an ti c i p a te d an d m ade re a d i l y
a va i l ab l e a t th e p oi nt at wh i ch th e re s t r i c t i on i s ap p l i e d .
-
V iii
A me t a l an g u ag e f o r e xp re s s i n g re s t r i c ti on s i s de ve l o p e d .
It is b a s e d up on a s s o c i a t i n g w i th e ac h n ode i n th e p a rs e
t re e a w o rd i n th e i np ut s t r i n g as i t s c ore an d a s e t o f
f l a g s wh i ch s i gn a l s t ru c t u r a l f e a tu r e s i n th e s ub t re e s
b e l ow th e n od e . R e s t r i c t i on s a re e xp re s s e d i n te rm s o f
th e s e f l ag s an d the a t t r i b u te s o f th i s c ore w or d , an d c an
b e e xe c u te d q u i c k l y w i th ou t t ime - c on s um i n g t re e t r a ve rs a l s .
Th i s me t a l an g u a ge i s de s c r i b e d an d de f i n e d an d ap p l i e d
t o th e e n t i re re s t r i c t i on c ompon e n t o f th e S ag e r g r amma r .
I n t e re s t i n g p rob l e ms th a t c ome up a l on g th e w ay a r e d i s c u s s e d .
Th e s y s t em is c u r re n t l y b e i n g i mp l eme n te d a t N ew Y o rk
U n i ve rs i ty .
T h e n o d a l s p an s a l g o r i t hm an d th e me t a l an g u a ge ap p r o a ch
t o re s t r i c ti on s l e n d th em s e l ve s t o an a l g o ri thmi c t re a tme n t
of s e m i g r a mm a t i c a l i ty , an d th i s is a l s o d e ve l op e d .
-ix _
CH AP T E R I I N T RO DU C TI ON
Th i s wo rk c on f r on t s th e p rob le m o f a d ap t i n g the f a s t
b o t t om - u p p a r a l l e l p a rs i n g te ch n i q u e k n own as n od a l s p an s
to th e s y n t a c t i c an al ys i s of n a t u r a l l an g u a ge . Af te r a
b r i e f h i s t o ry an d d i s c u s s i on o f th e i s s ue s i n vo l ve d , an
b y N a om i S ag e r a s an e x amp l e o f th e ty p e o f b r o a d an d
de t a i l e d g r amma rs n e c e s s a ry i n n at u r a l l an g u age p r o ce s s i n g .
Th e n th e n od a l s p an s a l go r i thm i s de s c r i b e d . T o d e mon s t ra te
th e n e ce s s i ty o f e xp re s s i n g g r a mm at i c a l re s t r i c t i on s i n a
run to de te rm i n e th e f e as i b i l i t y of p a r s i n g w i th o u t s u ch
re s t r i c t i on s . A me t a l an g u a ge i s d e s c r i b e d an d de f i n e d fo r
th e e xp re s s i on o f g ramma ti c a l re s t r i c t i on s . Th i s i s
to th e S a g e r g r amm a r i s p re s e n te d .
Th e w o rk de s c r i b e d h e re re s u l t s f r om th e c on ve rg e n ce o f
th re e de ve l opme n ts wh i ch a re o u t l i n e d i n tu rn b e l ow .
S t r i n g An a ly s i s
T h e f i r s t d e ve l opme n t b e g i n s w i t h t h e i n c re a s e d i n t e re s t
of l i n g u i s t s i n th e s y n ta c t i c an a l y s i s o f s e n te n c e s i n th e
l a s t f o r ty y e a rs . L e on ar d B l oomf i e l d l me n t i on e d th a t s e n t e n c e s
c ou l d b e an a ly z e d i n t o i mme d i a te c on s t i t ue n t s . For
e x amp l e , th e s e n te n c e
" "
Ma n u s e s l an gu a ge .
" "
c an b e b rok e n i n t o a s ub j e c t man an d a p re d i c a te us e s
" " "
l an g u ag e wh i ch c an i n tu rn b e b r ok e n i n to th e ve rb uses
" " 2
an d an ob j e c t l an gu a ge . Z e l l i g H arri s out l i n e d a te ch
s e q ue n c e s o f w o r d s or mo rpheme s i n s e n te n ce s , vi z .
s ub s t i t u t i o n o f the s e q ue n ce of w o r d s f o r a s i n g l e w or d ,
an d g ave a s amp l e l i s t o f s ub s t i t u t i on ru l e s f o r E n g l i s h ;
3
imme d i a te c on s t i t ue n t an a l y s i s . R u l on We l l s e xp an de d
th i s rema rk i n t o wh a t w a s fo r th e t ime a re a s on ab l y de t a i l e d
i mme d i a te c on s t i tu e n t an a l y s i s o f Engl i sh .
'
I n the e a r l y 19 50 s th e i mpo r t an c e of g r amma ti c a l
i n t h i s ar t i c l e t ran s fo rm a t i on s a re s e e n p r i ma r i l y as
e q u i va l e n ce re l at i on s b e twe e n s e n te n ce s . Tw o s e n te n c e s a re
2 " "
Ze l l i g H arri s F r om Mo rph eme t o U t te r an ce
, , L an gu ag e , Vo l .
22 , p 165 - 183
. 1946 , .
3 "
R u l on S . We l l s ,
"
I mme d i a te C on s t i t ue n t s , L an g u a g e , V ol . 23 ,
pp . 8 1- 1 1 7 , 1947 .
4 " "
Ze l l i g H a rri s , D i s c ou r s e An a l y s i s , L an g u a ge , V ol . 28 ,
pp . 1- 3 0 19 52 , .
s ame c on t e x t s as the o r i g i n a l . Thu s , th e s en te n ce s
" "
Man us e s l an g u a ge .
" "
an d L an g u a ge i s u s e d b y m an .
a re re l a t e d t r an s f o rm a t i on a l l y . I n th e mi d d l e an d l a te
' 5
19 50 s , e s p e c i a l l y i n th e w o rk o f N o am C h oms ky , th e s t u dy
o f t r an s f o rm a t i o n s b e c ame c e n t r a l ; h e p r op o s e d a mode l f o r
l an g u a ge i n wh i c h a b a s e c omp on e n t p ro du c e s k e rn e l t re e s
o r s e n ten c e s wh i ch a re th e n O p e r a t e d upon by t r an s f o rm a t i on s
to p r o du c e t h e fu l l va r i e ty of n a t u r a l l an g u a ge s e n te n ce s .
Th u s , i f th e tw o s e n te n c e s
" "
Me n c on c e a l th e t r u th .
" "
an d Me n ab u s e l an g u a ge .
" "
w e re p r odu c e d b y th e b as e c omp one n t an d a c t e d up on b y p a s s i ve
an d e mb e dd i n g t r an s f o rm at i on s , the s e n te n c e
" "
T h e t r u th i s c on c e a l e d b y me n wh o ab u s e l an gu age .
wo u l d b e p ro d u c e d .
W h i l e m an y l i n gu i s t s h a ve c on ce rn e d th ems e l ve s w i th th e
g e n e r a ti on o f g r amma t i c a l s e n te n c e s , th e i n ve r s e p r ob l em i s
c l e a r l y a l s o i mp o rt an t . G i ve n a g r amm at i c a l s e n t e n c e , h ow
c an on e de t e r mi n e wh i ch tr an s f o rma ti on p r odu c e d i t an d wh a t
' 6
k e r n e l s e n t e n c e s un de r l i e i t ? H arri s d e ve l opme n t of th e
me th o d o f s t r i n g an a l y s i s p ro v i d e s th e b e g i n n i n g o f an an s w e r
t o th a t q ue s t i on .
S t r i n g an a l y s i s , l i k e imme d i at e c on s t i tue n t an a l y s i s ,
ha s as i ts go a l th e r e s o l u t i on o f t h e s e n te n ce i n to a
6
Z e l l i g H ar ri s S t ri n g A n al y s i s o f S e n te n ce S t ru c tu re
, ,
Th e H a gue 1962 , .
t re e - l i k e s t r u c tu re . I n s t r i n g an a ly s i s th e p r i n c i p a l
c on s t i t ue n ts o f a s e n ten c e a re S ub j e c t V e rb Ob j e c t :
" "
Man u s e s l an g u age .
fo r t r an s i t i ve ve rb s , or f o r i n t r an s i t i ve ve rb s , s imp l y
S ub j e c t Ve rb :
" "
L an g u a g e e x i s t s .
e l eme n t s wh i c h a re a d j oi ne d UD t h e b a s i c s e n te n ce a t v a ri o us
po i n t s to mo d i fy or amp l i fy wh a t is s ai d . On e ty pe o f
" "
ad j un c t , th e s e n te n ce ad j un c t , a c t s a t th e s ame l e ve l as
the p r i n c i p a l c on s t i t ue n t s an d s e rve s to mo d i fy th e e n t i re
s en te n c e o r re l a te i t to o th e r s e n te n ce s i n th e d i s c ou rs e :
" "
As a re s u l t , l an gu a g e e x i s t s .
" "
I n a dd i t i on , m an u s e s l an g u a g e .
An o th e r ty p e o f ad j un c t is ad j oi n e d to th e l e f t or r i gh t o f
"
T h a t ch ub b y m an wi th th e c i g a r an d th e b ow l e r h a t
"
f re q ue n t l y us e s th e E n g l i s h l an gu age .
Th e a d j un c t s a re O p t i on a l i n th a t de l e t i on o f th em wou l d
re s u l t , f o r th e mo s t p a r t , on ly i n th e s ub t r a c t i on o f de t a i l ,
an d no t i n th e l o s s o r a l t e ra t i o n o f me an i n g . F u rt h e rm o re ,
a f t e r de le t i on o f the s e ad j un c t s the s e n te n ce s w ou l d w i t h
ce r t a i n e x c e p t i on s s t i l l b e g ramma t i c al .
" "
E ac h o f th e p r i n c i p a l c on s t i tu e n ts h a s as i ts c o re
a w o rd or s t r i n g t o wh i ch th e a d j un c t s a re a t ta ch e d . In
the s e n ten c e
" "
H i s a r g ume n t i s c on f u s i n g . (l)
" "
th e c o r e O f th e s ub j e c t i s th e wo rd a rg ume n t to wh i c h
" "
the a d j un c t his i s a t t a ch e d . A s t r i n g i s th e re s u l t an t
of a t r an s fo rma t i on ap p l i e d to an a s s e r t i on , an d un de r
c e r t a i n re s t r i c t i on s c an re p l a ce a wo rd an d i t s a d j un c ts
as a p r i n c i p a l c ons t i t ue n t . F o r e x amp l e , a n om i n a l i z i n g
t r an s f o rma t i on ap p l i e d t o th e a s s e r t i on
" "
H e s a y s s ome th i n g .
y i e l ds th e s t r i n g
" "
wh a t h e s ay s
wh i ch c an b e s ub s t i t u te d f o r th e s ub j e c t i n s e n te n ce (1)
" "
W h a t h e s ay s i s c on f u s i n g .
An o th e r n om i n a l i z i n g t r an s f o rma t i on ap p l i e d to th e s e n t e n c e
" "
H e m e an s th e O pp o s i t e o f wh a t h e s ay s .
y i e l d s the s t r i n g
" "
h i s me an i n g th e O p po s i t e of wh a t he s ay s
wh i c h c a n a l s o b e u s e d a s th e s ub j e c t o f s e n te n c e (1)
" "
H i s me an i n g t h e O pp o s i t e of wh a t h e s ay s i s c on f u s i n g .
(2)
Th i s de v i c e o f s ub s t i tu t i on i s f i rs t of al l a logi ca l
e x t e n s i on O f th e c l as s i c a l me th o d o f d i s c ove ry an d an a l y s i s
'
i n de s c r i p t i ve l i n g u i s t i c s an d g row s n a t u r a l l y o ut of H arri s
7
e a r l i e r wo rk on mo rph e me s e q ue n c e s . S e c on d o f a l l , s ub s ti
tu t i o n is o ne O f th e de vi ce s b y wh i ch man i s ab l e , in
C h oms k y s w o rd s
'
, t o ge t i n f i n i t e u s e o u t O f th e f i n i t e
re s o u r c e s O f l a n gu a ge . Th re e k e rn e l s e n te n c e s un de r l y
e x amp l e th e or e t i c a l l y th e re i s n o l i mi t on th e n umb e r
o f k e rn e l s e n te n c e s wh i ch may un de r l y a s e n te n c e .
Vo l . 22 , p . 161 , 1946
S t r i n g an a l y s i s , v i ew i n g s en te n c e s as m ade up o f
p r i n c i p a l c on s ti t ue n t s an d O p t i on a l l y ad j o i n e d e l e me n t s ,
l e n d s i t s e l f t o an o th e r i n f orma l me th od fo r th e d i s c ove ry
an d an a ly s i s o f g r amma r s , V i z . e x c i s i on . S up p o s e we a re
g i ve n a c o l l e c ti on O f u t te r an c e s i n a n ew l an gu ag e wh i ch
h ave p re vi ou s l y b e e n d i vi de d i n to wo r d s or mo rph e me s , an d
s up po s e we h ave an i n fo rm an t wh o w i l l te l l u s wh e n we
e xc i s e a p o r t i on o f a s e n t en c e
a . wh e th e r th e rem a i n d e r s t i l l me an s th e s ame , or
wh e th e r w e h a ve s ub t r a c te d de t ai l , or whe the r we
h ave ch an ge d th e me an i n g e n t i re l y , an d
b . whe th e r th e re ma i n de r i s s t i l l a g r amm at i c a l s en te n c e .
C on s i de r fo r e x amp l e th e s e n te n ce
" "
Th e re is a c omp a s s o n th e h o us e b oa t .
" "
I f we e x c i s e h o us e ,
" "
Th e re i s a c omp as s on th e b o a t .
ou r i n f o rman t wi l l te l l us we h a ve me re l y s ub t r a c te d de t a i l .
" "
I f we e x c i s e boat ,
" "
Th e re i s a c omp a s s on th e hou s e .
he wi l l s ay w e s t i l l h a ve a g r amma t i c a l s e n te n c e b u t i t s
me an i n g ha s b e en r ad i c a l l y a l te re d . Th e s e e x amp l e s l e ad
u s to p o s tu l a t e t h a t th e s e c on d n oun i s th e c r i t i c a l e l e me n t
" "
an d th e f i rs t i s an ad j un c t . Ne x t we e x c i s e th e ,
" "
Th e re i s a c omp a s s o n h o us e b o a t .
N ow h e t e l l s u s th at i n a s e n s e we s ti l l h ave th e s ame
me an i n g , b u t we h a ve l o s t g r amma t i c a l i ty . T h i s i n d u ce s us
" "
h i s we a r i n g
wh i c h l a ck s me an i n g . W e th e re f o re c on c l u de th at th e ph r as e
i s i n fa c t a s t r i n g .
Th e go a l o f s t r i n g an a l y s i s is th e re c o gn i t i on o f th e
s t r i n g s i n a s e n t en ce . I t th e re f o re o c c up i e s an i n te rme d i
a te po s i t i on b e tw e e n imme d i a te c on s t i t ue n t an a l y s i s an d
t r an s f o rma t i on al an a l y s i s . I mme d i a t e c on s t i t ue n t an a l y s i s
O f f e r s n o h e l p i n de t e c t i n g th e a c t i on o f t r an s fo rm a t i on s .
B y c on t r a s t , it is l i k e l y th a t on ce th e s t r i n g s i n a
s e n te n c e a re re c o gn i z e d , o ne i s i n a ve ry g o od p o s i t i on
i n de e d t o de t e rm i n e wh a t t r an s f o rma t i on s t ook p a rt i n
p ro d u c i n g the s e n t en ce .
S p u r re d i n p a r t b y th e f a i l u re o f e a r ly a t te mp t s i n
me ch an i c a l t r an s l a ti on , in t e re s t g rew i n th e a u t oma t i c
p a r s i n g o f n a t u r a l l an gu a ge i n th e e a r l y l9 6 o
'
s . The
ch i e f p rob l em i n th i s re ga r d is c on s t r u c t i ng a g r amm a r fo r
s yn t a c t i c c on s t ru c ti on s an d de t a i l e d e n ou gh to e l i mi n at e
s p u r i o u s amb i gu i t i e s .
O n e o f th e e ar l i e s t m a j o r e f f o rt s w as th e H a rva rd
8
P r e d i c t i ve A n a ly z e r de ve l op e d b y K un o an d O e t t i n ge r . The i r
g oa l was t o c on s t ru c t au toma t i c a l l y t re e s re f l e c t i n g th e
8 "
S u s umu K un o an d An th on y G . O e t t i n ge r , S yn t ac t i c S t ru c t u re
"
an d Amb i g ui ty o f E n g l i s h , P ro ce e d i n g s F a l l Jo i n t
C ompu te r C on f e re n ce 196 3 , , pp . 3 9 7 —4 1 8 .
s u r f a c e s t r uc t u re o f E n g l i s h s e n t e n ce s . F o r th i s p u rpo s e ,
a ve ry l a r g e p u re l y c on te x t - f re e g ramma r w a s de ve l op e d .
Th e H a r va rd P re d i c t i ve An a l y z e r we n t th ro ugh a n umb e r of
ch an ge s , b u t a t on e po i n t h a d app r ox i ma t e l y 2 10 0 p ro d u c t i on s
an d ab o u t 1 30 te rm i n a l s ymb o l s de fi n i n g wo rd s ub c l a s s e s .
W i t h a l l O f th i s ma ch i n e ry , th e n um b e r O f f a l s e amb i g u i t i e s
i n th e an a ly s e s th e p a rs e r p r od u c e d w a s s t i l l c on s i de re d
un a c c e p t ab l e . The tw o mo s t imp o r t an t c on c l us i on s th a t
th a t th e p rob l e m o f s y n t a c t i c an a l y s i s o f English is
e n o rmo u s , an d s e c on d th a t th e g r amm a r c an n o t b e e xp re s s e d
a s a l a rge p u re l y c on te x t - f re e g r amm a r . O n e wo u l d l i k e to
re q u i re re a s on a b l e b r e v i t y an d c omp re h e n s i b i l i ty o f th e
on th e s e c o un t s . O n e w ou l d a l s o l i k e to b e ab l e to e x te n d
a n ew g r amm a t i c a l c o n s t r a i n t m ay e n t a i l ad d i n g on ly a few
mo re wo rd s ub c l a s s e s , b u t i f th e i r u s a g e de p e n d s u p on
d i s t an t e l e me n t s i n th e s e n te n ce , i t may b e n e c e s s a ry to
ad d a l a r g e n umb e r o f n ew p r odu c t i on s an d ma j o r d i f f i cu l t i e s
may b e c a us e d w i th c ur re n t p r od u c t i o n s .
T h e s y n t a c t i c a n a l y z e r P A RS E de ve l op e d a t RAN D b y J an e
9
R ob i n s on w a s a l s o b a s e d on a p u re l y c on te x t - f re e g r amma r
an d a l s o s o ug h t t o an a l y z e th e s u r f a c e s t ru c t u re O f Engl i sh
9
J an e Rob i n s o n
an d S h i r l ey M a rk s P A RS E : A S ys t em f o r
,
A u toma t i c S y n t a c t i c An al y s i s O f E n g l i s h T e x t R a n d C o rp , .
,
19 6 5 .
s e n te n c e s . I t c on t a i n e d app ro x ima t e l y 35 0 0 p r o d u c fit m s an d
th e pa r s e r g ave re as on ab l e re s u l t s on m any s e n te n ce s , th e re
we re s e ve r a l e x amp l e s o f ve ry h i gh de g re e s of amb i gu i ty
a l 3 - w o rd s e n te n ce w i th 35 p a rs e s ; an l 8 - wo rd s e n ten ce w i th
91 pa rs e s ; a 2 7 - w o rd s e n t e n c e w i th 10 6 p a rs e s ; an d a 3 3 - wo rd
K un o and O e t t i n g e r s w o rk
'
app l y h e re a s w e l l ; th e an a l y s i s
th a t ma de i t e as y to e xp an d .
A v e ry d i f f e re n t app r o a ch w as t ak e n a t th e MI T RE C o rp
10
o r a t i on b y A rn o l d Z w i ck y an d o th e r s . Th e i r g o a l w as to
re c o gn i z e th e t r an s f o rma t i on s th at un d e r l i e E n g l i s h
s e n t en c e s . The an a ly s i s p ro ce e de d i n fo u r s t ag e s :
1 . T he E n g l i s h s e n ten ce w a s p a rs e d a c c o rd i n g to a
s ur f ac e g r amm a r t o p r o du c e a t re e rep re s e n ti n g th e s u r f a ce
s t ru c tu re o f th e s e n te n ce . T h e s u r f a c e g r amma r c on s i s te d
2 . U s i n g th e ou tp u t o f th e f i r s t s t a ge , re ve rs e t r an s
tre e s o f k e rn e l s en ten ce s . Th e re we re ab o ut 1 34 re ve r s e
t r an s fo rm a t i on s .
10
A rn o l d Zw i ck y , Jo y c e
F ri e dman B a rb a r a C H a l l an d , .
,
"
D on a l d W a lk e r The M I T RE S yn t a c t i c A n a l y s i s P r o ce d u re
,
"
f o r T r an s f o rm a t i on a l G r amma rs P r o ce e d i n g s ,Fal l
J o i n t C omp u te r C on fe re n c e 19 65 pp 3 1 7- 3 2 6
, , . .
-
10
3 . S ome o f th e s e p r e s ume d b a s i c t re e s we re i nc o n s i s
b a s i c t re e s wh i ch c ou l d no t b e ge n e r a te d b y th e b as e
c omp o n e n t w e re d i s c a rde d .
4 . F o rw a rd t r an s f o rm at i on s w e re ap p l i e d t o th e
rem a i n i n g s e t s o f b a s i c t re e s to de te rmi n e i f th e y c o u l d i n
f a c t g e n e r a t e th e o r i g i n a l s e n te n ce . I f so , th at se t of
b as i c t re e s co n s t i tu t e d a c o r re c t an a l y s i s O f t h e s e n te n c e .
I f not , th e s e t o f b a s i c t re e s w a s d i s c a rd e d an d an o th e r
se t tri e d .
A p p a re n t l y th e re a s on f or s t ag e s 3 an d 4 w a s th a t th e
an a ly s i s i n s t a ge s 1 an d 2 w as n o t re f i ne d e n o u gh . F u r th e r
mo r e , th e M I T RE pa rs e r , l i k e th e o the r tw o d i s c u s s e d , h as
l 2 - w o rd s e n t e n ce h ad 48 p re s ume d s u r f a ce t re e s a f t e r s t ag e 1
O n e c an e n vi s i on a n at u r a l l an g ag e an a ly s i s s y s te m
c on s i s t i n g o f mo d u l e s f o r s u r f a ce , re ve r s e t r an s fo rma t i on a l ,
an d s e m an t i c an al y s i s . T he s e mod u l e s c ou l d p e r f o rm th e i r
wo r k i n t u rn o r th e i r f un c t i on s c o u l d b e i n te rm i x e d . I n an y
case , the l e s s on s o f th e th re e p r o j e c t s de s c r ib e d a re th a t
th e s u r f a c e g r amma r mu s t be e x t reme l y de t a i l e d an d th a t a
p u re l y c on te x t - f re e mod e l i s no t a pp r op r i a te f o r i t s
e xp r e s s i on .
T h e p a r s i n g s y s tem O f the L i n g u i s t i c S t ri n g P ro j e c t a t
N ew Y o rk U n i ve r s i ty un de r N a omi S a ge r g rew o ut of th e e a r l i e r
UN I VAC I p a r s i n g p r og r am a t th e U n i ve r s i ty Of P e n n s y l v an i a ,
-1
1
de ve l op e d i n co n j un c t i on w i t h Z e l l i g H ar r i s '
s t r i n g an a l y s i s l l .
con s t i tue n t an a l y s i s an d t ra n s f o rm a t i on a l an a l y s i s , so th e
g r amma r de ve l o pe d by S ag e r b a s e d on s t ri n g s c an b e an a ly z e d
i t m ak e s e xp l i c i t the i n fo rm at i on i n a s e n te n ce n e e de d to
p e r f o rm t ran s fo rm a t i on a l an a l y s i s . S t ri n g an a ly s i s th u s
p r ovi de s s o l i d l i n g u i s t i c g r ou n d s f o r a s u r f a ce g r amma r .
12
Th e L i n g u i s t i c S t r i n g P ro j e c t g r amma r h as ove r c ome
th e d i f f i c u l t i e s O f a l a rg e unw i e l dy p u re l y c on te xt - f re e
g r amma r b y h a vi n g i n s t e a d a sm a l l e r c o n te x t - f re e g r amm a r
wh i ch i n di c at e s t h e p e rm i s s ib l e c on s t r u c t i on s ‘
o n ly i n b ro ad
o ut l ine . Th e re a re on ly on th e o rde r of tw o h un d re d p ro du c
h a ve v a r i o u s a t t r i b ut e s a s s i gn e d to i t a s we l l . T h e con te x t
o f re s t r i c ti on s to h an d le th e f i n e r de t a i l . Th es e re s tr i c
ti on s ch e ck as pe c ts o f th e t re e s t ru c tu re so f a r e vo l ve d
to ge th e r w i th a t t ri b ut e s o f c o re w o rd s i n th e s e n te n ce , an d
on th i s b a s i s p e rmi t o r d i s qu a l if y b u t n e ve r mo di f y c on s tr u e
ti on s p ro du c e d b y th e c on te x t - f re e c omp on e n t . A s p r ove d i n
S e c t i on a g r amma r th u s de fi n e d c o ul d b e c on ve rt e d i n t o
l an g u a ge . H ow e ve r , th i s co n t e x t - f re e g r amma r w ou l d b e s e ve r a l
Z e l l i g H a rri s S t r i n g An al ys i s
, O f S e n ten c e S t r u c tu re , Th e
H a g ue 1 9 6 2 p p 5 8 - 6 5
, , . .
12 "
N a omi S age r , A Tw o - S t a ge BN F S p e c i f i c a t i on o f N a t u r a l
"
L an g u ag e , J ou rn a l o f C yb e rn e t i c s , V o l 2 , 1 9 7 2 , pp 39- 50
. . .
-
12
o rde r s of ma gn i tu de l a r ge r , mu ch l a rg e r i n f a c t th an the
K un o an d O e t t i n g e r an d R ob i n s on g r amma rs .
T he S a ge r g ramm a r is e x p l a i n e d i n mo re d e t ai l i n
C h a p te r 2 .
P a r5 1 n g A l go r i thms .
F o l l ow i n g th e s pe c i f i c a ti on o f AL GO L i n B a ck u s - N au r
l3
fo rm ( BN F ) i n th e A L GO L 60 re p o r t , an i n t e re s t a ro s e i n
s y n t ax - d i r e c t e d c omp i l i n g . I n s yn t a x - d i re c te d c omp i l i n g ,
th e s yn t ax o f th e l an g ua ge i s s p e c i f i e d i n de pen de n t ly o f
g row th O f i n t e re s t i n al go r i th ms f o r p a r s i n g a l an g u age
a c c o rd i n g to a s y n t a x - s p e c i f i c at i on o r g r amm a r .
Two c l a s s e s o f p a r s i n g te ch n i q ue s ap p e a re d a lmo s t
i mme d i at e l y t op - d own an d b o t t om - u p . E a r l y ve rs i on s o f
14
th e t op - d own s t r a te gy app e a re d i n a r t i c l e s b y F l oy d and
ls
b y C h e a th am an d S a tt le y . B r i e f ly , a t op - d own p a rs e r
p ro ce e d s f r om l e f t to ri gh t g e n e r a t i n g a t re e f r om th e roo t
s tri n g . Wh e n n o ma tch i s p o s s i b l e th e p a r s e r b a ck s up an d
"
P e t e r N au r Re p o rt
on th e A l g o r i t hmi c L an g u a ge
AL GO L C ommun i c a t i on s O f th e AC M V o l 3 1 9 6 0 p , .
, , . 299 :
14 "
R ob e r t F l oy d
W . T h e S y n t ax o f
, P r o g r amm i n g L an g u ag e s
"
A S u r ve y I E E E T r an s a c t i on s o n
, E l e c t ron i c C omp u t e rs ,
Vo l E C- l 3
. pp 346 - 353
, .A u gu s t , 19 64 .
15 " ‘
T . E . C he a th am an d K . S a ttl ey , S yn t ax
C omp i l i n g -
D i re c te d ,
P r o c e e d i n gs E a s te rn J o i n t C ompu t e r C on f e re n c e AF I P S , I
Vo l . 2 5 , pp . 3 1- 5 7 , 1964 .
a t temp ts to ge ne r a t e an o th e r tre e . I f a t re e i s ma t ch e d
w i th th e e n ti re i n p u t s t r i n g , a va l i d p a rs e h a s b e e n f oun d .
I f a l l p a th s i n th e g r amma r h a ve b e e n e xh au s t e d w i tho u t
ma t c h i n g th e en t i re i n p u t s t r i n g , n o p ars e i s po s s ib le .
s ymb o l s i n t h e i n p u t s t r i n g . I f s u c ce s s i ve s ymb o l s s p an n i n g
c on t i g uou s p o r t i on s of th e i n p u t s t r i n g c on s t i tu t e th e
b e c o a le s c e d an d re p l a c e d by th e s ymb o l on the l e f t s i d e o f
th a t p ro duc ti on . I f n o f u r th e r c o a l e s c i n g i s p os s i b l e ,
th e pa r s e r b a ck s up an d t r i e s a l t e rn a t i ve w ay s o f c o a le s c i n g
a va l i d p a r s e h as b e e n f oun d . I f a l l p o s s i b l e pa t h s i n th e
g r ammar a re e xh au s t e d w i th o u t p r od uc i n g th e ro o t s ymb o l ,
n o p a r s e i s po s s i b l e .
l7
F l o yd de ve l op e d a f as t b o t t om - u p p a rs i n g te c hn i q u e f o r
mos t p r og r amm i n g l an gu a g e s b as e d on th e p re c e de n c e r e l a t i on s
u s e d i mp l i c i t l y by e a r l y c omp i l e r s . B y d e f i n i n g p re ce de n c e
re la t i on s on the O pe r a t o r s i n a l an gu ag e (e g. .
on e c ou l d i s o l a te the mo s t de e p l y n e s te d p o rt i on s ( called
" "
the h an d l e ) O f th e i n p u t s t r i n g an d c o a le s c e the m f i r s t .
"
E T
. I r on s
. A S yn t ax D i re c te d C omp i l e r f o r A L GO L
,
-
C ommun i c a t i on s o f th e AC M V o l 4 pp 51— 55
, J an .
, .
, . 19 61 .
17 "
R obe r t W F l oyd , S yn t a c t i c An a l y s i s an d O pe r a to r
.
3 1 6 —3 3
"
P re c e de n c e , J o u rn a l o f the A CM , V o l 10 , pp . .
,
Ju l y 1 9 6 3 .
-
14
in pa ra l le l . I f a p o rt i on o f t he i n p u t s t r i n g i s c ap ab l e
o f tw o d i f f e r e n t i n te rp re t at i on s wh i ch i n t u rn c an b e
by on ly on e n ode i n th e t re e l i k e s t ru c tu re b u i l t up by
-
the p a r s e r . Am b i g u i t y i s th u s l oc a l i z e d an d p re ve n te d
th e a l g o r i th m i s g i ve n i n C h ap te r 3 .
A d r awb ac k O f n od a l s p an s p a r s i n g is th a t i t re q u i re s
3
n s pa c e a s O pp os e d to l in e a r s p a ce f o r t op - d own p a r s i n g .
O f c ou r s e , i f the s p a c e is a va i l ab l e th i s s h o u l d n ot b e a
c on c e rn . H owe ve r , i t w i l l b e s e e n d r ama t i c a l l y i n C h ap te r 4
th a t S p a c e c on s i de r a t i on s d o i n de e d b e come c r u c i a l . On th e
othe r h an d , i f d i f f i c u l t i e s w i th s p a ce c an b e c on t r o l l e d ,
3
th e g a i n i n t i me f rom e xp on e n t i a l t o n wo u l d c e rt a i n l y
j u s t i fy th e e f f o r ts .
A n o t he r adv an t ag e O f a nO d e l s p an s p a r s e r wo u l d b e i ts
con ve n i e n t re p re s e n t a t i on of amb i g ui ty .
Amb i g u i ty i n N at u r a l L an gu a ge
P r ob ab l y the m a j o r i ty o f E n g l i s h s e n t e n ce s a re amb i g u ou s ,
a t l e as t w i th i n th e l e ve l O f g r amma ti c a l r e f i n eme n t po s s i b l e
to d ay . T he me an in g or re fe re n ce of a w o rd or ph ra s e or th e
s t r u c t u re of a ph r a s e m ay be un c e r t a i n i n a s ma l l e r c on te x t
an d on l y b e c ome c e r t a i n i n a l a r ge r c on t e xt . F o r e x amp l e ,
th e wo rd
c an e i th e r b e a p l u r a l n o un o r a s i n g u l a r ve rb . O n l y wh e n we
-1 6
l o ok a t l a r ge r c on t e x t i s th i s amb i g u i ty r e s o l ve d :
" "
he typ e s
" "
th e typ e s
Th e re s e ems to b e no l i m i t on th e amo un t of c on te x t
re fe r e n ce . K n ow l e dge o f i d i oms an d s e l e c t i on a l re s t r i c t i o n s
s uf fice t o re s o l ve th e s t ru c t u r a l amb i g u i t i e s o f
" "
I avo i d wi a t ing r ooms .
" "
I av o i d w a i t i n g t ab l e s .
T he s t r uc tu r a l l y amb i gu ou s p h r a s e
"
Th e e xp e r i me n t o f Mi ch e l s on a n d E i n s t e i n on
s p e c i a l re l a t i vi ty
i s d i s amb i gu a te d b y s y n t a c t i c an a l y s i s o f th e re s t o f th e
s e n te n c e °
"
T h e e xp e ri me n t o f M i ch e l s on an d E i n s te i n on s p e c i a l
"
re l a t i v i ty a re c o rn e r s t on e s O f mo de rn phy s i c s .
S ome t i me s s ub l an g u a ge d a t a i s re q u i re d , fo r e x amp l e in
th e d i s amb i g u a t i on of the f i n a l s e n te n ce i n a s u r ge ry re p o r t :
" " 20
Th e p a t i e n t l e f t th e O pe r a t i n g r o om i n g o od c on d i t i on .
"
( C omp a re : Th e j an i t or l e f t th e O p e r a t i n g r oom i n go o d
O n e m i gh t b e ab l e to re s o l ve the s t r u c t u r a l
amb i g u i ty o f
" "
I d on t l i k e vi s i t i n g r e l a t i ve s
'
.
b y c on s i de r i n g s ome wh a t mo re c on te x t , e .
g .
I . D . J . B ro s s , P
an d B B A n de r s o n
. A . S h ap i r o , . . ,
"
H o w I n f o rma t i on i s C a r r i e d i n S c i e n t i f i c S ub L an g u a ge s
" -
,
S c i e n c e J un e 1 9 7 2 pp 1 3 0 3 - 7
, , . .
-1 7
"
U n f o rt un a te ly , U n c l e Y o r i ck c ame to vi s i t u s th i s we e k e n d .
"
'
I don t l i k e vi s i t i ng re l a t i ve s .
"
U n f o r tun a t e l y , we h a ve t o go to P h i l ade l ph i a to v i s i t
"
U n c l e Y o r i ck .
'
I d on t l i k e vi s i t i n g r e l a t i ve s .
R a th e r de t ai l e d kn ow l e d ge O f c u r ren t c on d i t i on s i n Ame r i c a ,
wh i ch o ne w ou l d no t o rd i n a r i l y e xp e c t to f i n d i n th e g i ve n
te x t wo ul d b e n e e d e d to d i s am b i g u a te th e s e n te n ce s
"
T h e e l de r l y p e op l e wh o w a l k e d th ro ugh th e p a rk at n i gh t
"
n e e de d p r o te c ti on f rom th e p ol i c e .
"
T he a rre s t e d d emon s t r a t o r s n e e de d p r ot e c ti o n f r om the
"
p o l i ce .
" "
I s aw th e m an i n th e p a rk w i th a t e l e s c op e .
c ou l d n o t b e re s o l ve d w i th o u t ge og r ap h i c a l k n ow l e dg e so
l oca l i ze d as t o b e vi r tu a l l y un a va i l ab l e . An d of c ou r s e ,
i n t e n t i on al l y o r un i n te n t i on a l l y th at no amo un t o f c on t e x t
an d n o de g re e O f de ta i l i n an a l y s i s w i l l s e r ve to
d i s amb i gu a te th em .
I n an y n at u r a l l an g u a ge p ro c e s s i n g s y s t em , th e re f o re ,
th e de c i s i on mu s t b e ma de whe th e r to h ave th e s yn t a c t i c
18
c omp on e n t ou tp u t a l l p os s i b l e p a r s e s or me re l y th e mo s t
l i k e ly p a r s e . Th e l a t te r p os i t i on h a s b e e n a rg ue d by an a l ogy
w i th a s s ume d h um an th o u gh t p r o c e s s e s , b u t wh i l e s u ch an a l o
g i e s wo u l d s e e m a f r u i t f u l s o u r ce of i n s p i ra t i on i n
c omp u t at i on a l l i n g u i s t i c s , th ey d o n o t ap p e a r p a r t i c u l a r l y
re l e v an t a s a r g ume n t s f o r th e s h ap e o f a s p e c i f i c s y s t em
wh i ch i s n o t me an t a s a c o gn i t i ve m od e l .
I n s o me s i t u at i on s i t i s a c c e p t ab l e t o a i m fo r th e
one i n t e n d e d p a r s e an d n e g l e c t th e r e s t , fo r e x amp l e i n
on - l i n e q ue s ti on - an sw e ri n g s y s t ems i n wh i ch th e an
swe r is
c ou c he d i n te rms wh i ch i n d i c a te th e p a r s e s e l e c te d . Th i s
mi g h t b e a c c omp l i s he d , w i th va ry i n g d e g re e s of s u c ce s s , by
me an s o f c a r e fu l o rde r i n g o f a l te rn a t i ve s i n a c on t e x t - f re e
g r amma r , e x am i n a ti on O f ce r t a i n amoun t s o f c on te x t , an
ap pe a l to s t a t i s t i c a l p r ob ab i l i t i e s , o r an e x i t to a r ou t i n e
wh i c h a s k s th e u s e r fo r h e l p . I n f a i r ly re s t r i c te d s y s t ems
d i s amb i g u a t i on ; how e ve r , i n s ys t e ms w i th a b ro ad e r s c op e ,
f o r e x amp l e th e s ys te m s wh i ch wo u l d b e n e c e s s a ry fo r e f fe c ti ve
i n f orma t i on re t r i e va l f r om s c i e n t i f i c l i t e r a t u re , s u ch a
W o r k h a s b e e n d on e on d i s amb i g u a t i on by me an s o f s e l e c t i on al
re s t r i c t i on s wh i ch h o l d t r ue fo r s p e c i f i c s ub l an g u a ge s , e .
g .
21
t he s ub l an g u a ge O f th e o re t i c a l ph a rma c o l o gy an d th e
21 "
N a omi S age r , S y n t a c t i c F o rm a t t i n g o f S c i e n t i f i c I n f o rma
"
t i on ,
AF I P S C on f e re n ce P r o ce e d i n g s V o l 4 1 1 9 7 2 p 7 9 1
, .
, , . .
-
19
22
s ub l an guag e o f s u r ge ry re p o rt s . T h i s app r o a ch h a s p ro ve d
u s e fu l , b u t i t i s un l i k e l y i t c an b e e x te n de d ve ry s u c c e s s
f u l ly t o l e s s re s t r i c t e d a re a s i n w h i ch l an gu a ge i s u s e d
w i th l e s s p re c i s i on . C omp l e t e d i s amb i g u a ti on O f s e n te n ce s
f r om re a s on ab ly ge n e r a l te x t s , th e re fo re , s e ems b e yo n d ou r
g r a s p a t th i s p oi n t .
I f we w i s h our s y n t ac t i c c omp on e n t th e n to o ut p u t a l l
po s s i b le p a r s e s , we wo u l d l i k e th i s i n fo rma t i on p re s e n te d
i n a l u c i d man n e r .
C on s i d e r fo r e x amp l e the s e n te n ce
"
I b e l i e ve h e h i d th e f l as h l i gh t i n th e k i t ch e n
"
un de r the s i n k .
(3)
I t i s n ot c l e a r wh e the r h e to ok th e f l a s h l i gh t f r om th e
l i v i n g room an d hi d i t i n th e k i t ch e n un de r the s i n k , or
'
to ok th e f l as h l i gh t th a t s u s u a l l y k e p t i n a c upb o a rd i n
th e k i tc h e n an d h i d i t un de r th e s i nk , o r t o ok th e f l a s h
l i gh t wh i c h is u s u a l l y k e p t i n th e k i t ch e n un de r th e s i n k
an d h i d i t in th e b a th r oom . In fact , i n th e ab s en ce o f an y
s e m an t i c i n f o rm at i on , i t c ou l d b e th a t th e k i t ch e n i s un de r
th e s i n k . T he s e n t e n ce th u s h as f i ve p a r s e s , b u t to s ay
th i s i s t o d i s g u i s e the f a c t th at i t s amb i g u i t y i s l o c a l i z e d .
I t i s on l y th e re fe re n c e o f th e p re p o s i t i on al ph r a s e s th a t
i s un ce r ta i n . A to p - d own p a rs e r l i s t s e a c h p a r s e s e p a r a te l y ,
c omp a r i s on . Th e n od a l s p an s a lg o r i th m , by c on t r as t , g i ve s
22
I . D . J . B ro s s , e t a l .
, Op . Ci t .
a l l p a r s e s s i mu l t an e o u s l y an d i n a c on c i s e f r om th a t p i n
p o i n ts the s o u r c e O f th e amb i g u i ty . Th e ab b re vi a t e d r e p re
s e nt a t i o n of th e p a r s e s o f s e n te n ce (3) s h own b e l ow c an be
re a d d i re c t l y O ff the tr e e s t r uc t u re g e n e r a te d b y th e
n od a l s p an s a l go r i thm .
1 .
< S U B JE C T > < VE RB >
I b e l i e ve
23
2 . < S UB J E C T > < VE RB > < RV >
A . He hid 3A . 4 .
B . He hi d 3A . 4 .
C . He hid 3A . 4 .
D . He hid 3B .
E . He hid 3B .
3 ,
< *P > <N S TGO >
A . in th e k i t ch e n
B . in the k i t ch e n 4 .
un de r th e s i n k
Th e n o d a l s p an s a l go r i thm a l s o p e rm i t s f i n e r c l a s s i f i c a
t i on o f w o r d s . S upp o s e f o r e x amp l e th at a wo rd i n th e
s e n t en c e b e i n g p a r s e d h a s s i x d i f f e re n t m e a nh xfis an d th e
23
The n ot at i on h e r e i s ad op t e d f rom th e S a ge r g r amm a r < RV > .
s t an d s f o r r i gh t ad j un c t o f th e ve rb < *P > f o r a p re po s i ,
-
21
for a l l p a rs e s n e e d s th i r ty p a s s e s ove r th e s e tw o wo rd s ,
an d o f c our s e fo r l on g e r s e n te n c e s th e n umb e r o f p as s e s
g row s e xpon e n t i a l l y . F o r th i s re a s on th e re i s ve ry l i t tl e
b re ak i n g o f wo rd s i n t o the i r va ri ou s me an i n g s w i th a top
d own pa r s e r . I n a b o t t om — u p p a ra l l e l p a r s e r , n od e s f o r
a l l th e me an i n g s c an b e g e ne r a te d i n on e p as s , e l i mi n a ti n g
th e ne e d f o r
. b a ck t r a ck i n g an d p e rmi t t i n g g re a t e r re f i neme n t
O f wo r d me an i n g .
I n a s y s t em wh o s e on ly g o a l is p a rs i n g , a w o rd c an b e
b r ok e n in t o as man y d i f f e re n t me an i n g s as h ave d i f f e re n t
s e t s o f a t t r i b ut e s . I n a me ch an i c a l t r an s l a t i on s ys t em ,
th e wo rd s c an b e b rok e n i n to a s man y d i f f e re n t me an i n g s as
h av e d i f f e re n t t r an s l a t i on s i n th e t a rg e t l an g u a ge . Thi s
c an h e l p re s o l ve th e p r ob l e ms o f mu l t i p l e me an i n g s i n
me ch an i c al t r an s l at i on , fo r i f on ly two o f s i x p os s i b l e
me an i n g s O f a wo r d c an p a r ti c i p a t e i n a f i n a l p a r s e o f th e
s en t e n c e , w e h ave s i gn i f i c an t l y re s t r i c te d th e n umb e r O f
t r an s l a t i on s we n e e d c on s i d e r fo r t h at w o r d .
Th e p a r s e r i n c u r re n t u s e i n th e L i n g u i s t i c S t r i ng
P ro j ec t i s a n a i ve t o p - d own b a ck - u p p a r s e r . G e ne r a l l y th e
f i r s t pa r s e i s f ou n d r a th e r r ap i d ly an d i n a s u rp r i s i n g l y
h i gh p r op ort i on o f th e c a s e s th i s i s th e p re f e r re d p a r s e .
On the o the r h an d , t o f i n d a l l p o s s i b l e p a r s e s re q u i re s
e xp o ne n t i a l t i me , wh i ch me an s i n p r a c t i ce th a t fo r l on g
s e n te n ce s , a l l p a r s e s a re n o t f oun d . Th e s e c on s i de ra t i on s
mo t i va te the d e ve l opme n t of a n od a l S p an s p a rs e r f o r th e
S a ge r g r amma r .
-
22
CHAP T E R 2 . T H E GRAMMA R
T h e c omp on e n t s of th e G r amma r
Th e g r amma r u s e d b y th e L i n g u i s t i c S t r i n g P ro j e c t at
N ew Y o rk U n i ve rs i ty un de r N a omi S ag e r w a s de ve l op e d by
S a ge r i n 19 62- 6 3 a s a mo d i f i c a t i on O f th e U n i ve rs i ty o f
a s e n te n ce . Th e s y s t em was f i r s t p r og r amme d i n 19 6 4 - 6 5
an d h a s s in c e gon e th rou gh s e ve r a l r e p r o g r a mm i n g s . Th e
s t ud i e s , i n c l u di n g i n ve s t i g a t i on s O f i n fo rmat i on e x t ra c
t i on f r om phy s i c s te x t s , f o r e i gn l an g u a ge te a ch i n g , an d th e
s ub l an g u ag e of ph a rma c o l ogy .
1 . A c on t e xt - f re e g r amma r , w r i t te n i n B a ck u s - N au r
F orm ( BN F ) . I t c on s i s ts o f ab ou t 200 p r o d u c t i on s w i th ab o u t
ab ove , th i s c omp on e n t s p e c i f i e s i n b ro ad ou t l i n e th e
s yn ta c t i c c on s t r uc t i on s wh i ch o c c u r i n E n g l i s h .
2 . R e s t r i c t i on s , w r i tt e n i n a S pe c i a l - p u rp os e me t a
l an gu a g e . T h e re a re ab ou t 200 re s t r i c t i on s . T h e y s up p l y th e
n e c e s s a ry de t a i l wh i c h th e BN F c omp on e n t om i t s . Th i s is
e l i mi n a t i n g i t wou l d re q u i re an e xp an s i on o f th e BN F
-
24
3 . L o c a ti n g re l at i on s . I n th e t o p - d own p ars e r , th e
re s t r i c t i on s f i n d the i r a r gume n t s b y me an s O f ab ou t 30
l o c a t i n g r e l at i on s wh i ch ope r a t e on th e n ode s O f th e t re e .
Th e s e re l a t i o n s a re de f i n e d e i th e r i n a s p e c i a l - p u rpo s e
me t a l an g u ag e or as F O RT RAN s ub r ou t i n e s .
4 . Th e wo rd d i c t i on a ry , c on s i s t i n g O f ab o u t
e n t r i e s i n c l ud i n g i n f l e c te d fo rms . I n d i v i d ua l w o rds a re
l i s te d a s t re e s t r u c tu r e s wh o s e n ode s a re th e va r i ou s
c a t e g o r i e s an d a tt r i b u te s th a t a w o r d c an h ave .
E a ch O f th e s e c omp one n ts w i l l b e de s c r i b e d i n tu rn .
Th e BN F c omp on e n t w i l l b e de s c r i b e d i n s omewh a t g re a t e r
de t a i l th a n th e o th e r c omp on e n ts , f o r we w i l l us e i t a s
an O p po r t un i ty t o t ak e a l on ge r l ook at th e E n gl i s h l an g u ag e
an d s ome O f th e i s s u e s th at c ome up i n i ts s y n t a c t i c an a ly s i s
NO a t temp t i s made t o l i s t a l l th e c on s t r u c t i on s i n t he
g r amma r , b u t on ly e n o u gh to i mp a r t i t s S c op e an d f l av o r .
1
Th e BN F C omp o n e n t
l . T he A s s e r t i on : Th e E n g l i s h s e n te n c e c on s i s t s of
a c e n t e r s t r i ng f ol l owe d b y an e n dm a rk
Th e mo s t imp o r t an t c e n t e r s t r i n g i s th e a s s e rt i on .
Th e a s s e r t i on c on s i s ts o f a s ub j e c t fo l l owe d b y a ve rb
1
Th i s s e c t i on i s f o r th e m os t p a r t
, , a s umm a ry O f N a omi
S ag e r S t r i n g P r og r am Re p o rt N o 4
,
. : A C omp u te r S t r i n g
G r amma r o f E n g l i s h P a r t s I an d I I
, , N ew Y o rk 1968 ,
-2 5
f o l l owe d b y an Ob j e c t . I n ad d i t i on , th e s en ten c e ad j un c t s
m ay b e i n s e r te d a t th e b e g i nn i n g o r th e e n d of a sel te nce
or b e twe e n , an d i n s ome c a s e s e ve n w i th i n , th e p r i n c i p a l
c on s t i t u e nus o f the s e n te n ce . F o r i n s t an ce , i n th e s en t e n ce
"
F o r i n s t an ce , i n th e s e n te n ce is an i n i t i a l
"
s e n t e n c e ad j un c t .
" "
F o r i n s t an c e is an i n i t i a l s e n te n ce a d j un c t . F u r th e rmo re ,
the ve rb may h a ve a r i gh t a d j un c t to th e ri g h t o f th e O b j e c t ,
"
as the w or d i n de f i n i t e l y i n th e s e n te n ce
" "
I c an c on ti n ue th i s i n de f i n i t e l y .
S i n ce th i s r i g h t ad j un c t is no t ad j a ce n t to th e v e rb i t mu s t
app e a r i n th e de f i n i t i on O f th e a s s e r t i on at th e s ame l e ve l
as th e p r i n c i p a l c on s t i t ue n t s an d th e s e n te n c e ad j un c t s .
T he de f i n i t i on O f th e as s e r ti on i n th e g r amm a r i s
th e re fo re
<A S S E RT I ON >
2
th e R i gh t ad j un c t o f th e V e rb , an d th e b r a ck e t s e n c l o s i n g
an e l e me n t i n d i c a te th at i t i s O p t i on a l .
T h i s an a l y s i s o f th e a s s e rt i on d i f fe r s f r om th e u s ua l
ph r a s e s t ru c t ure an a l y s i s , i n th at i t p l a c e s s ub j e c t , ve rb ,
an d O b j e c t a l l on th e s ame l e ve l o f th e t re e . I n th e u s ua l
3
ph r a s e s t ru c t u re an a ly s i s th e ve rb an d Ob j e c t a re a t a
19 57 p 2 6 ; o r H A G l e as on L i n gu i s t i c s an d E n gl i s h
, . . .
,
G r amm a r , N ew Y o rk , 19 65 , p . 141 .
26
de e p e r l e ve l th an th e s ub j e c t , ap p e a r i n g a s c on s t i tue n t s
" "
O f th e ve rb ph r a s e °
S Np Vp
l
V e rb
Vp
s
T h e r e wo u l d ap pe a r a t f i r s t s i gh t to b e n o c omp e l l i n g re as on s
for p re fe r r i n g on e an a l y s i s o ve r th e o th e r . H owe ve r , i t wi l l
b e s h own i n C h ap te r 6 ho w th e re qu i re me n t s O f th e n od a l s p an s
t i on i n th e d i re c t i on o f th e ph r a s e s t r u c t u re an a l y s i s .
2 . The V e rb : G i ve n th e s e q ue n c e o f ve rb s an d ve rb - l i k e
w o rd s i n th e s e n t en ce
"
Th e y m ay h ave s i mp l y b e e n t ry i n g t o ap pe a r t o b e
"
p re s s i n g fo r a c ti on . (1)
th e q ue s t i on i mme di a te l y a r i s e s a s to wh a t s h ou l d b e c a l l e d
th e m a i n ve rb . T h e p os s i b i l i t i e s i n c l ud e
" "
1) O n l y th e f i r s t ve rb l i k e w o rd -
( i n th i s c a s e , may )
" "
2 ) T he f i r s t in f l e c te d ve rb ( b u t n o t a fo rm o f do pre
ce d in g ah i n f i n i t i ve f o rm ) o r th e f i r s t ve rb f o l l ow i n g a
" " " " " "
mo d a l s u c h a s c an , m ay , etc . ( h e re th e ve rb h ave
f o l l ow i n g th e m od a l
3) Th e f i r s t ve rb o r ve rb a l f ol l ow i n g a l e g a l s e q ue n c e
" " " " " "
of f o rm s O f th e a ux i l i ary ve rb s h ave , be , an d do ( in
th i s ca s e ,
4 ) The l a s t ve rb o r ve rb a l i n th e s e q ue n c e ( i n th i s
c as e ,
-
27
T he q ue s t i on i s me re l y on e o f ch o os i n g th e s o l ut i on
mo s t i n l i n e w i th th e g oa l s an d s i mp l i c i ty o f th e s y s t em .
I n f a v or o f s o l u t i on 1) i s th e f a c t th at n um b e r- ag re e
me n t re s t r i c t i on s w i th th e s ub j e c t a c t on l y on th e f i rs t ve rb
o r ve rb - l i k e wo rd ; i f th e f i rs t ve rb - l i k e wo rd is un i n f l e c t e d ,
" "
like may , th en n o n umb e r a g re eme n t is r eq u i re d f o r an y
wo r d i n th e ve rb s e qu e n c e . I n f avo r o f s o l u t i on 4) i s th a t
s ub j e c t ve rb an d ve rb ob j e c t s e l e c ti on a l re s t r i c t i on s
a c t on th e f i n a l ve rb a l e l e me n t , an d th e re l a t e d re a s on th a t
th e ab ove s e n te n ce i s t r an s f o rm a t i on a l l y de r i ve d f r om th e
s e n te n c e
" "
The y p re s s f o r a c t i on .
P e rh ap s s o l u ti on 3) c o r r e s p on ds b e s t to th e i n tu i t i ve n o ti on
e l eme n t a ry e d u c a t i on h as g i ve n u s O f wh at th e m a i n ve rb
sh o u l d b e .
I n th i s g r amma r , s o l ut i on 2 ) is ch o s e n . T h e mo d a l wo rd s
" " " "
c an , may , e tc ) . s e em i n s u f f i c i e n t l y ve rb - l i k e
"
t o b e c a l l e d th e ma i n ve rb . Th e y t ak e n o a f f i xe s (3 H e ma y s
an d the y c an n o t apep a r a l on e un l e s s a f o l l ow i n g ve rb
"
i s un d e r s t ood ( I T h e re fo re , th e y a re c on s i de re d
p re ve rb a l t en s e wo rd s . As to s o l u ti on i t i s t r ue th a t
" " " "
the v e rb s h a ve an d be m ay b e e i th e r a ux i l i a ry ve rb s o r
"
p r i n c i p a l ve rb s ( a f a c t wh i ch m ak e s th e s e n te n c e The y a re
vi s i t i n g re l at i ve s .
‘
amb i g uo u s ) , H ow e ve r , th e ve rb a l ob j e c ts
" " " "
Of h ave an d be ge n e r a l l y o c c u r i n th e s ame e n vi ronme n t s
a s n o un ob j e c ts :
-
28
" "
H e h a s a r r i ve d .
" "
H e h as mon e y .
" "
Th i s m an i s c a u s i n g me t r oub l e .
" "
Th i s m an i s my un c l e .
" "
an d i t is s i mp l e r c omp ut a ti on a l l y to c on s i de r h ave and
" "
be a s ve rb s i n a l l th e i r o c c u r re n c e s , r a t h e r th an ve rb s
ch o o s i n g s o l u ti on 2 ) o ve r s o l ut i on 4) is th a t i t a l l o w s
g re a t e r re g u l a r i ty i n th e s t a t eme n t O f th e g r amma r . Fo r
th e n b e u s e d i n th e an a ly s e s o f al l th e f o l l ow i n g s e n te n c e s :
" "
V i s i t i n g r e l a t i ve s is an a c t i vi ty I e n j oy .
" "
I e n j oy vi s i t i n g r e l at i ve s .
" "
U n d e r s o l u t i on 4 ) i n th e l a s t tw o s e n te n ce s vi s i t in g wo u l d
"
b e c l as s e d as p a r t o f th e v e rb an d re l a t i ve s as part Of
th e ob j e c t . H owe ve r , th e f o l l ow i n g c on ce s s i on i s ma de to
s o l u t i on I n th e t o p - d own p a r s e r th e l as t ve rb i n th e
" "
s e q ue n c e i s de f i n e d a s the de e p e s t ve rb an d i n th e b o t t om
up p a r s e r i t i s b r ou gh t up a s th e c o re of th e ve rb a l O b j e c t
f o r u s e i n s e l e c t i o n a l re s t r i c t i o n s .
I n l i n e w i th s o l u t i on 2) th e ve rb i s de f i ne d a s
T he i n d i c a te s a t e rmi n a l o r c a t e g o ry s ymb o l o r a
" "
pa r t O f s pe e ch .
-
29
( Th r ougho u t th e g r amm a r < L XR > s t an ds fo r th e e l e me n t X
is a T e n s e d V e rb f l an k e d b y an y l e f t an d r i gh t ad j un c ts .
s ame f o r an un i n f l e c te d ve rb V ) . T h e s t ru c tu re a s s i g ne d
b y the g r amma r to s e n te n c e ( 1) i s g i ve n i n F i g . l .
(N u l l
ad j un c t s h a ve b e e n re mo ve d ) .
I n the g r aph o f F i gu re l , a s th r ou gh o u t th i s w o rk ,
p a r s e t re e s a re re p re s e n t e d i n b i n a ry fo rm . Th i s re f l e c ts
th e i n t e rn a l o rg an i z a t i on of th e g r amm a r an d th e p a rs e r ,
an d a l s o emph a s i z e s th e i mp o r t an c e o f th e c oe l e me n t re l a
ti on .
I n th e g r aph ,
< L VE N R > r e p r e s e n ts th e p as t p a r t i c i p l e
b y an ob j e c t ,
< LV I N G R > r e p re s e n ts th e p re s e n t p a rt i c i p l e ,
3 . The S ub j e c t an d Ob j e c t : N o un P h r a s e an d N om i n al i
z a ti ons : Th e s ub j e c t an d ob j e c t po s i t i on s o f th e as s e r ti on
an d o th e r s t r i n g s c an b e f i l l e d b y s imp l e n oun ph r a s e s or
th e s i mp l e n oun ph r a s e s a re n o un s w i th l e f t an d r i gh t ad j un c t s
" " 5
th e my s te r i ou s l ady i n the b l ac k c ap e ,
p r on oun s w i th a d j un c t s
5 I
Th e n ot at i on u s e d i n th e m a ch i n e g r amma r fo r a c on s t ru c t i on
I O O
w i l l ap pe a r i n p a re n th e s e s a f te r th e e x amp l e o f i t .
-
30
" "
on ly yo u
an d n ame s
" "
G e o r ge B e rn a rd S h aw
b o th s t on g n omi n a l i z a t i on s
i
" "
a p le a s an t w a l k
" "
u tt e r c on f u s i on
f o r wh i ch th e re s e em to be no re gu l a r de ri va ti on ru l e s an d
u s i n g the g e run d f o rm
" "
wh i s k e y d r i nk i n g
Le s s n oun - l i k e s e n te n c e n omi n a l i z at i on s c an a l s o o c c u r :
"
The d r i n k i n g o f I r i s h wh i s k e y c an b e b an e f u l
"
'
to on e s he a l th .
"
Y o ur d r i n k i n g I r i s h wh i s k e y c an b e b an e f u l
'
t o y ou r h e a l th
T he s e c on s t ru c t i on s c an n o t s a t i s f a c t or i l y b e e xp l a i ne d a s
'
g e r un d s f i l l i n g th e n o un s p l a ce i n a n oun p h r a s e , fo r i f
" "
the ve rb is n e c e s s a r i l y t r an s i t i ve , th e of ph r as e c an n o t
b e de l e te d , as n ot e d b e fo re i n th e d i s c u s s i on o f e x c i s i on .
" "
e s p e c i a l l y i n th e O b j e c t p os i ti on , i s th e wo rd th a t
fo l l owe d by an a s s e r ti on .
" "
That C o n n a ll w i l l run i n 19 7 6 i s i n e v i t ab l e .
"
I k n ow th a t C o nn a l l w i l l run i n
" "
I n th e ob j e c t po s i ti on th a t c an b e omi t te d . A s im i l a r
-
32
" "
c on s t r u c t i on r e q u i re s a s ub j un c t i ve ve rb or shoul d in
th e a s s e r t i on an d o c c u r s i n d i f f e re n t e n vi ron me n t s , i . e .
w i th d i f f e re n t p r e d i c a t e s :
Th a t K e n n e d y run i n 19 7 6
"
i s i mp e r at i ve .
An o th e r s e n te n ce n omi n a l i z i n g c on s t r u c t i o n i s a c c omp l i s h e d
" "
w i th fo r to :
Fo r K e n n e dy t o h a ve run a ga i n s t N i xon i n 19 72
"
w ou l d h a ve b e e n fo o l i s h .
Th e < T O VO > c on s t r u c t i on , a t . 1e a s t i n th e s ub j e c t po s i t i on ,
"
( Fo r one ) to h a ve r un a ga i n s t N i x on i n 19 72
"
wo u l d h a ve b e en f oo l i s h .
An i mp o r t an t c l a s s o f s e n t e n ce n omi n a l i z a t i o n s is th e
cl as s o f wh - s tring s . I n a l l o f the m , an as s e r t i on i s
p re c e d e d b y a g r oup o f wo r d s i n c l ud i n g a w h - wo rd i ndi c a ti ng
p ar t o r a l l o f a n o un ph r a s e i n th e a s s e r t i on , th e n o un
" " " "
ph r as e th en b e i n g omi t te d or z e r oe d f r om th e as s e r t i on .
A n o un m ay b e omi t te d f r om th e s ub j e c t o r th e O b j e c t of
the a s s e r t i on or the O b j e ct o f a p re p o s i t i on :
" "
Wh o s t o l e i t i s un c e r t a i n .
(<WH S -
N> )
" "
Wh a t h e s t o l e i s un c e r t ai n . ( WH S
< -
N> )
A p re p o s i t i on a l ph r a s e may b e om i t te d f rom an O b j e c t or f r om
c e r t a i n a d j un c t s , an d th e as s e r t i on p re c e de d b y th e p re po s i
t i on an d a w h - w o rd :
-
33
" "
W i s a go o d q ue s t i o n .
( < P WH S - PN > )
"
W i th wh at we s h o u l d c u t th e s am a m i
i s a g o o d q ue s t i on
I n s t e a d o f th e en ti re n oun ph r a s e b e i n g z e r oe d , on l y i t s
q u a l i f i e r m ay b e z e r oe d . A w h - wo rd fo l l owe d b y th e n oun
p r e c e de s th e as s e r t i on . The ab ove f o u r p o s s ib i l i t i e s o c c u r
i n th i s c a s e as we l l :
< W HN S —N >
" "
Wh i c h m an s t o l e i t i s un c e r t ai n .
( )
"
W h o s e w a t ch h e s to l e is -
N> )
"
O n wh i ch c an d i d a te we c an re l y is
"
a g o o d q ue s t i on , ( < PWH N S - PN > )
"
W i th wh i ch k n i f e w e s h o u l d c u t th e s a l am i
"
i s a go o d que s t i on .
It is po s s i b l e fo r an in d i c at i on o f a f f i rmat i on o r n e g a t i on ,
"
r a th e r th an a n oun ph r a s e , to b e z e ro e d . F re q ue n t l y , or
"
no t o c c ur s in t he s e c on s t ru c ti on s :
"
W h e th e r I w i l l v ot e th i s t i me i s s t i l l up
"
i n th e a i r .
"
W he th e r or no t to v o te f o r th e l e s s e r O f two e v i l s
"
i s a mo o t q ue s t i o n .
Th e r e i s an o th e r c l a s s o f wh - s t r i n g s wh i ch c an o c c u r
in th e s ub j e c t an d ob j e c t p o s i t i on s wh i c h a re t o b e d i s t i ng
u i s he d f rom th e ab o ve s e n t e n c e n om i n a l i z at i on s . Th e s e a re
th e n o un - eq u i v a l en t wh - s trin gs , wh i ch o c c u r i n th e s ame
e n v i ronme n ts as n o un s :
" "
W h at is l o s t i s l o s t f o r e ve r . ( WH<AT S -
N> )
" "
I j us t c ame f r om wh e re y o u a re g o i n g .
S ome o c c u r re n c e s o f th e s e c l au s e s a re O p e n to amb i g u i ty
s i n c e t h ey m ay b e u s e d s e n te n ti a l l y .
"
Wh a t wa s l os t in th e w a r c an n e ve r
"
b e de te rm i n e d . ( < WH S - N > )
or as n oun e q u i v a l e n t s ,
"
Wh a t wa s l o s t i n th e w a r c an n e ve r
" —N >
b e reg aine d .
( WH<AT S )
Th e s e n te n c e
" "
Wh a t h e w r i t e s is un c l e a r .
i s c a pa b l e o f tw o i n t e rp re t a t i on s , th e s e n te n t i a l ,
" "
It is un c l e a r wh a t s o r t o f th i n g s he w r i te s . an d th e
"
n ou n e q u i va l e n t E ve ry th i n g I ve re a d O f h i s h a s b e e n
- '
,
"
un c l e a r .
Th e r e a re o th e r s e n ten c e n omi n a l i z a t i on s wh i c h o c c u r
on l y i n th e O b j e c t p os i t i on , u s u a l l y t ak i ng an ac c u s a t i v e
s ub j e c t °
" "
S h e m a de h i m l e a ve .
" "
I c on s i d e r th a t th e l a s t s t r aw .
" "
I r e g a rd th a t a s th e l a s t s t raw .
M os t O f th e s e s t r i n g s o c c u r on l y i n ve ry re s t r i c te d
e n v i ronme n ts .
_ 35
4 . O th e r O b j e c t S trings : Th e O b j e c t c a r r i e s mu ch O f
a c omp l e x ve rb s e q ue n ce is s h un te d i n t o the ob j e c t p o s i t i on .
a r e i n E n g l i s h tw o k i n ds o f a s s e r t i on th e tr an s i t i ve an d
th e i n t r an s i t i ve . I n th e m a ch i n e g r amma r th e i n t r an s i t i ve
f or < OB JE CT > . I t wo ul d p e rh ap s be mo re p r i n c i p l e d t o s p e c i f y
s e e ms mo re e c on omi c a l , fo r a s w e l l as h av i n g two a s s e rt i on s ,
we wo ul d a l s o n e e d tw o two an d tw o O f
e ve ry o th e r s t r i n g i n wh i c h < O B JE C T > ap pe a r s .
Th e i n d i re c t ob j e c t i s c omb i ne d w i th th e d i re c t ob j e c t
an d l i s t e d as th e f o l l ow i n g a l te rn a t i ve O f < OB JE C T > :
" "
'
He g a ve th e a l umn i f un d a l a r ge c on t ri b u t i on .
O b j e c t p o s i ti on .
P re p o s i t i on a l ph r a s e s u s u a l l y o c cu r i n ad j un c t p o s i t i on s
b u t s ome ve rb s t ak e p re p o s i ti on a l ph r a s e s a s ob j e c ts :
" "
U n i ve r s i t i e s tod ay a re i n de e p f i n an c i a l t ro ub l e .
" "
Th e y c an n o t re l y on i n d i vi du a l c on t ri b u t or s .
O th e r s ub c l a s s e s o f ve rb s t ak e more e l ab o r a te c on s t r u c t i on s
i n vo l v i n g p re p o s i t i on s , f o r e x amp l e , a n oun f o l l ow e d b y a
p re p o s i t i on a l ph r as e ,
-
36
"
Y o u c an n o t a t t r i b u te t h e i r d i f f i c u l t i e s to
"
m i s m an a ge me n t .
an d a n oun f o l l ow e d b y a p re p o s i t i on a nd xfl
x un a l i z e d s e n te n c e ,
" '
D on t ask th e m ab o u t th e i r i n ve s t i n g i n S o u th
"
A f r i c an d i amon d s .
An a dve rb i a l p re p o s i t i on i s a p re p o s i t i on wh i ch c h an g e s
"
th e me an i n g o f th e ve rb t o wh i c h i t is ap p e n d e d , e .
g . l ook
" " " " " " " " "
up , f i n d ou t , m i x up , ri p O f f , c a rry on . P e rh ap s
th e mo s t i n t ui t i v e l y s a t i s fy i n g w ay O f h an d l i n g th e s e wo u l d
b e t o c on s i d e r th e m p ar t O f th e ve rb . H owe ve r s i n c e oth e r
i t s ad ve rb i a l p re p o s i t i on , as i n
"
P l ea s e l ook th e n umb e r pp
th e ad ve rb i a l p re p o s i t i on p a r t O f th e ob j e c t . T h e ad ve rb i a l
p re po s i ti on c on s t r uc t i on s h a ve a v a r i e ty c omp a r ab l e to th e
p re p o s i t i on a l con s t ru c ti on s , f r om th e s i mp l e wo rd o r ph r as e ,
" "
G i ve pp ,
" "
L o ok u
p th e n umb e r .
to t he m o re c omp l e x n oun ad ve rb i a l p re p os i t i on p re p os i
ti o n a l ph r a s e ,
"
H e a lw ay s m i x e s my n ame u
p w i th th e n ame o f h i s
"
o n l y o the r f r i e n d .
A l t o g e th e r th e re a re n e a r ly s i x ty a l t e rn a t i ve s f o r
< OB JE C T > . S to re d w i th e a ch ve rb i n th e d i c t i on a ry i s a l i s t
O f th e a l t e rn a t i ve s i t may t ak e .
- 37
5 . S e n te n c e A d j un c t s : S e n te n ce a d j un c ts mo d i f y th e
e n t i re s e n te n ce or re l a te i t to o th e r s en te n ce s i n th e t e x t .
The re a re f ou r c a t e g o r i e s o f s e n te n c e a d j un c t s . Th e f i r s t ,
th e s h o r t s e n te n ce ad j un c t s , i n c l ud e s adve rb s ,
" "
He ge n e r a l l y s k i s w e l l .
p re p o s i t i on a l ph r a s e s i n v o l vi n g n oun s o r ad j e c t i ve s ,
" "
I n the o r y a t l e as t h e k n ow s h ow to s ki .
t i me n ou n s ,
" "
H e s k i e d e ve r y d a y l a s t w i n t e r .
an d a g r oup of adve rb s wh i ch b e c au s e th e y c an n o t b e mo d i f i e d
b y o the r ad ve rb s a r e c l a s s e d as i n t e r j e c ti on s i n th e g r amma r ,
" "
M o re o ve r , he wo n th r e e me d a l s .
T h e o th e r th re e c a t e g o r i e s a re th e l on g e r s t r i n g s wh i ch
c an b e a t t ach e d on l y to th e ce n te r - l i k e s t r i n gs . T h e re i s
th e imp o r t an t g r oup O f s ub o r d i n a t e c l au s e s . A s ub o rd i n a te
c on j un c t i on c an b e f o l l ow e d by an O b j e c t o f th e imp l i e d
" "
ve rb to be ,
"
T h ou gh b l i n d -
h e wa s a top n o t ch p r i v a te e y e .
,
an as s e r t i on ,
he s o l ve d e ve ry c a s e qu i ck l y .
a pa s t p a r t i c i p l e i n d i c at i n g p a s s i ve ,
"
A l th o u gh c a p t ure d b y th e s y n d i c at e , h i s c ou ra ge
"
d i d n o t f ai l h i m .
a p re s en t p a r t i c i p i a l c on s t r u c t i on ,
"
B e f ore d r opp i n g h i s g un , h e w as p re p a re d to
"
f i gh t i t ou t .
-
38
" "
r a re l y d r i nk s
" "
h a rd l y re l i ab l e
an d mo s t ri gh t ad j un c t s a re adve rb s or p re p o s i t i on a l ph r a s e s ,
" "
re l i ab l y e n o u gh
" "
d r i n k s i n l a r ge gu a n t i t i e s
T h e s t r u c t u re of th e l e f t a d j un c t o f the n oun i s
i n di c a te d b y t h e f o l l ow i n g p ro d u c t i on :
< LN > < TP OS > < Q P OS > < AP O S > < NS P OS > < N P OS >
as i n
" "
T he f ou r s t an da r d c h i l d re n s t e s t p rog r am s '
.
may a l s o b e o c cup i e d b y a p o s s e s s i ve an
i n te r ro g a t i ve o r re l a t i ve p r on oun ( wh os e , wh i ch ) , or th e
" "
s tring h ow m an y o f th e . F u r th e rmo re , an a r t i c l e o r
p o s s e s s i ve c an b e p re c e d e d b y a q u an t i f i e r ( as a l e f t
" " " " " "
a d j un c t ) as in a l l th e , m an y a , on l y J oh n s '
< Q P OS > i s th e g u a n t i f i e r p g g i s i t i o n , as i n
" "
th e t h re e n ew s a i l b o a t s .
< AP O S > is th e p o s i t i on f o r a s t ri n g O f a d j e c t i ve s , an d m ay
a l s o b e o c c up i e d b y a p re s e n t p a r t i c i p l e
" "
th e f l y i n g D u t chm an ,
by a p as t p art i c i p l e ,
" "
a f a l l e n an ge l ,
or b y c e r t a i n n oun p h r a s e s i n d i c a t i n g me as u r e ,
" "
a s i z e te n d re s s .
<N S P OS > is th e p o s t - ad j e c t i va l p os i t i on f o r th e p os s e s s i ve
n oun . I n th i s p o s i t i on th e p os s e s s i ve g e n e r a l l y i n d i c a te s
p u rpo s e r a t h e r th an po s s e s s i on . Th e d i s t i n c ti on b e twe e n
-
40
th e < T P OS > an d th e <N S P OS > p o s s e s s i ve c an b e s e e n i n th e
ph r a s e
" "
'
my l i t t l e d au gh t e r s g rown man s s h i r t '
.
as in
" "
f e a s t d ay
or
" "
rum r un n i n g .
Th e va l i d i ty O f th i s an al y s i s O f t h e l e f t ad j u n c t O f th e n oun
c an b e s e e n b y t ry i n g to p e rmu te th e e l eme n t s , e .
g .
"
1
"
th re e th e n ew s a i l b o a t s
" "
( e x c e p t i n ve ry s p e c i a l c on te x t s )
’
Z the n ew th re e s a i l b o a t s
3
" "
a f e a s t h ap py d a y .
u s u a l p h r a s e s t ru c t u re an a ly s i s o f th e n oun w i th i t s mod i f i e r s ,
i n th at i t p l a ce s a l l th e e l e me n t s on th e s ame l e ve l . Ph ras e
s t r u c t ur e an a ly s i s , b y c on t r a s t , an a l y z e s th e n oun ph r a s e as
6
s h own i n th e f i g u re b e l ow .
N oun P h r as e
Ar t i c l e
Q u an t i f i e r
A d j e c t i ve
H . A . G l e a s on , Jr .
, L i n gu i s t i c s an d E n g l i s h G r amma r ,
N ew Y o rk , 19 65 , pp . 151- 9 .
I n C h ap te r 6 i t w i l l b e s hown ho w th e re qu i reme n t s of th e
n od a l s p an s a l go ri thm f o r ce a re f i n eme n t i n th e s t r i n g
an a ly s i s o f th e n o un ph r as e b u t n ot q u i t e i n th e mann e r of
t r a d i t io n a l ph r a s e s t ru c t u re an a l y s i s .
C on s t ru c t i on s wh i c h c an ap p e a r i n th e r i gh t ad j un c t
o f t h e n o un a re ge n e r a l l y th e s ame a s c an app e a r as th e
" "
ob j e c t o f th e ve rb to be b u t o f t e n i n s omewh a t mo re
re s t r i c t e d e n v i ron me n t s . Th us , c o r re s p on d i n g t o th e n oun
ph ra s e ob j e c t - o f - b e ,
" "
P i c as s o was a f amo us p a i n te r .
is the appo s i t i ve r i gh t ad j un c t ,
" "
P i c as s o , th e f amo u s p a i n t e r ,
B u t app o s i t i ve s a re r are a f te r mo s t p r on o un s :
" "
3 ? He , th e f amou s p a i n te r
S im i l a r l y , ad j e c t i v e s c an ap pe a r as O b j e c t s - o f- be ,
" "
Th e p e op l e a re f re e .
b ut on l y a f ew c an app e a r a l on e a s r i gh t ad j un c t s o f n oun s
wh i l e o th e rs h ave t o b e m od i f i e d i n s ome w ay :
" "
A T he p e op l e f re e
" "
Th e p e op l e re s p on s i b l e
"
T h e pe op l e , f re e a t l as t f rom th e y ok e
"
o f o pp re s s i on .
P re po s i ti on a l p h r a s e s may o c cu r i n muc h l e s s re s t r i c t e d
e n v i r onme n t s :
" "
U n i ve r s i t i e s a re i n de e p f i n an c i a l t r o ub l e .
"
U n i ve r s i t i e s i n d e e p f i n an c i a l t r oub l e n e e d
"
g o ve rnme n t a i d .
-
42
V a r i ou s ve rb a l ph r a s e s may o c c u r i n t he r i g h t ad j un c t
O f n o un s , i n c l u d in g the p a s t p a r t i c i p l e i n d i c at i n g p a s s i ve ,
" "
Th e man s e n t a l e t t e r s e n t a l e t te r .
an d p re s e n t p a r t i c i p i a l c on s t ru c t i o n s ,
" "
Th e m an h i t ti n g th e s i dew a l k is my un c l e .
" "
A s s e r t i on s om i t t i n g a n oun an d po s s i b l y p re c e de d by th a t
c an o c c u r :
" "
T h e man tha t c ame t o d i nn e r . (<T H A T S -
N> )
"
Th e man w e gave th e d i n n e r fo r ( < S -
N> )
I n ad d i t i on man y O f th e wh - s t r i ng s wh i ch a re s e n t e n c e
n omi n a l i z a t i on s c an a l s o o c c u r as r i gh t ad j un c ts o f n oun s ,
an d he re i n a c on s i d e r ab l y w i de r va r i e ty of c on t e x t s s i n c e
th e n oun s th e y re f e r to ne e d n o t be s e n t e n t i a l n o un s :
" "
Th e b i rd wh i c h h as re d t a i l fe a t he r s .
( < WH S - N > )
" "
T h e t r e e i n wh i ch i t h a s b u i l t its ne s t .
"
T h e f r o g wh o s e c r oak i n g w e h e a r ( < WHN S - N> )
S ome o f th e c on s t r u c t i on s wh i ch ap pe a r a s r i gh t ad j un c t s
o f n oun s a l s o o c c u r a s r i gh t ad j un c t s of ad j e c ti ve s .
7 . O th e r C e n te r S t r i n g s : Q ue s t i on s : T h e re a re tw o
s o r t s o f q ue s t i on s th o s e as k i n g f o r a c h o i c e or a n a f f i rm a
t i on or n e g a t i ve , an d y e s - n o qu e s t i on s , an d th o s e a s k i n g f o r
a s pe c i f i c p a r t o f an a s s e r t i on to b e f i l l e d i n , th e wh
q ue s t i on s . The ye s -
n o q ue s t i on i s fo rme d b y s p l i t t i n g th e
ve rb i n to tw o p a r t s , th e f i r s t n o rma l l y a te n s e w o rd or a
" " " " " "
te n s e d fo rm of do , be , or h ave , p re c e d i n g t h e s ub j e c t ,
an d th e s e c on d e i th e r a te n s e l e s s ve rb or n u l l f o l l ow i ng th e
s ub j e c t :
_ 43
" "
W i l l I e ve r u n de r s t an d y o u ?
" "
W a s i t a l l t rue ?
T h e ye s - n o qu e s t i on c o r re s p on ds to th e s e n t e n ti a l n omi n a l i
" "
z a t i on c on t a i n i n g wh e t h e r .
A w h - q ue s t i on c on s i s t s of a wh - wo r d , p o s s i b l y p re c e de d
by a p re O p o s i t i o n an d p os s i b l y fo l l ow e d b y a n oun , f o l l ow e d
b y a ye s —n o q ue s t i on or an a s s e r ti on f r om wh i c h a n oun
ph ra s e o r p re p os i t i on a l ph r a s e ha s b e e n omi t t e d . Th e po s s i
bi li ti e s th a t o c c u r c o r re s po n d e x a c t l y t o wh - s en te n ce - n omi n a l i
z a t i o ns . A n oun ph r a s e m ay b e om i t te d f r om th e s ub j e c t or
th e O b j e c t :
" "
Wh o s to l e i t ?
( < WH Q - N > )
" "
W h i ch m an s tol e i t ? ( < WHN Q - N > )
"
W h a t d i d he s te a l ( <WHQ - N > )
"
W h o s e w a t ch d i d h e s t e a l ( < WH N Q - N > )
A p re p o s i t i on a l ph r as e m ay b e d e l e te d f rom th e Ob j e c t or
an ad j un c t °
"
O n wh om c an we re l y ( < P WH Q - P N > )
"
O n wh i c h c an d i d a te c an we re l y ( < PW HN Q - P N > )
" "
W i th wh a t s h o u l d we c u t th i s s a l ami ?
" ? "
W i th wh i c h k n i fe s h o u l d we c u t th i s s a l ami
o rd e r i n g of an E n g l i s h s e n te n ce c an o c c u r , e s p e c i a l l y i n p oe t i c
7
wri ting . A s C homs k y h a s po i n te d o u t , th e s e a re mo re l i k e ly
C hom s k y N o am A s p e c t s o f th e T h e o ry o f S y n t a x
, , ,
C amb r i dg e Ma s s 19 65
, pp . 2 2 7- 2 2 8
, , . .
_ 44
t i on s . I n th e ma ch i n e g r amma r o n ly tw o o f th e mo s t c ommon
p e rm t u a t i o n s h a ve b e e n i mp l e me n t e d .
I n th e f i rs t , a te n s e wo rd o r a te n s e d a u x i l i a ry f o l l ow s
" " " "
n e i th e r , nor , an ad ve rb , o r a p re p os i t i on a l ph r a s e , an d
i s fo l l ow e d b y t h e s ub j e c t . Th e emp h as i s i s O f t e n n e g at i ve
i n s u ch s e n te n c e s :
" "
Li tt l e did I s us pe c t s h e w as a R u s s i an spy .
" "
Nor did I see h e r ve ry o f te n .
" "
In no c a s e w i l l I t e l l yo u mo re .
"
Th e s e c on d p e rmu t a t i on i s o f th e f o rm O b j e c t- O f - be
"
i s S ub j e c t :
" "
In L on d on a re s e ve r a l f i n e mu s e um s .
" "
F i n e r s t i l l a re th e mu s e ums o f P ari s .
"
B u rn t t o a c r i s p wa s the b a c on s he g ave me .
I mpe r a t i ve : T h e imp e r a t i ve c on s t r u c t i on i s ch a r a c te r
i zed b y a z e ro e d s ub j e c t an d an un i n f l e c te d m a i n ve rb . It
i t o c cu r s r a re l y i n th e s c i e n t i f i c l i t e r a tu re th e p a r s i n g
p r o g r am h as b e e n u s e d f o r so far .
o f t he mn e m on i c s , e x amp l e s O f th e s t r i n g s , an d an i n d e x of
th e n on - t e r mi n a l s ymb ol s i s g i ve n i n A pp e n d i x A .
T h e Re s t r i c ti on s .
F o r t he t op — d own p a r s e r th e re s t r i c ti on s a re w r i t t e n
i n a me t a l an gu a ge wh i ch i s a s ub s e t o f E n g l i s h ( s l i gh t l y
au gme n te d ) so th e y c an b e re ad e a s i l y b y h uman b e i n g s an d
-
45
c an b e c omp i l e d b y th e ma c h i ne i n to s t a ck s O f F O RT RAN
ro ut i n e s wh i ch e x e c u te th e l oc a t i n g r e l a t i on s . Th e re s tri c
t i on s a re c a l l e d a t v a ri o u s p o i n t s i n th e co n s t r uc ti on o f
th e t re e e i t h e r to c h e ck p a r t s o f th e t re e a l re a dy b u i l t
an d up on f a i l u re to t e ar up th at p a r t ( w e l l - f o rme d n e s s
re s t r i c t i on s ) or else to c h e ck th a t c e r t a i n c on d i t i on s
a re s a ti s f i e d b e f o re a t t a ch i n g an a l t e rn at i ve a s a n ode
i n th e f i r s t p l a c e ( d i s q u al i fy i n g re s t r i c t i on s ) .
F o r t h e b o t tom - u p p a rs e r th e r e s t r i c t i on s a re w r i t te n
i n the me t a l a n gu a ge d e s c r i b e d i n C h ap te r 5 . I n th i s f o rmu l a
t i on th e re i s n o ch e ck i n g o f th e t re e b e yo n d th e imme d i a te
n od e s ; r at h e r f l a g s wh i c h a re s e t , p a s s e d up th e t re e , an d
c h e ck e d du ri n g p a r s i n g , c a r ry a l l th e re l e van t i n f o rmat i on .
Th e re s t r i c t i on s h an d l e th e c on te x t - s e n s i t i v e a s p e c ts
o f n a t ur a l l an g u a ge , ge n e r a l l y b y f i n d i n g g r amm a t i c a l l y
re l a te d w o rd s an d ch e ck i n g th at th ey h a ve c omp a t i b l e w or d
s ub c l a s s e s .
O ne c an i d e n t i f y s e ve ra l ty pe s O f re s t r i c t i on s a c c o r d i n g
t o th e ro l e t h e y p l ay i n th e g r amm a r . T h e c omp l e te s e t o f
re s t r i c ti on s t o g e t he r w i th c omme n t s i s g i ve n i n th e n od a l
S p an s re s t r i c ti on me t a l an g u age i n A pp e n d i x B . I n ad d i t i on ,
s ome a re de s c r ib e d i n de t a i l i n S e c t i on s an d R a th e r
th an go i n to d e t a i l ab o ut th em h e re , on l y a f ew of e ac h
ty pe w i l l b e de s c r i b e d .
1 . P o s i t i on a l re s t r i c t i o n s : T h e BN F de f i n i t i on s a re
O f te n a b i t to o l a rge , i n d i c at i n g a s th ey do o n l y th e b ro ad
ou t l i n e s o f a c on s t r uc ti on . Th u s , re s t r i c t i on s a re ne e d e d
_ 46
a l t e rn a t i ve s f o r < OB JE C T > b u t ve ry f ew O f th e s e c an o c cu r
w i th an y g i ve n ve rb . W i th e ve ry ve rb i n th e w o rd d i c t i on a ry
th e re i s s t o re d an a t t r ib u te c a l l e d OB J L I S T wh i ch l i s t s
va l i d O b j e c t a l te rn a t i ve s fo r th a t ve rb . Du r i n g th e t op
d own p a r s i n g , ma t ch i n g i s a t tempt e d on l y w i th th o s e
a l t e rn a t i ve s .
2 . S t ron g s yn t a c t i c r e s t r i c ti on s : Th e s e a re ge n u i n e
O n e s u ch r e s t ri c ti on s ay s th at i f < N VA R > is s i n gu l a r th e n
ph r a s e a s
" "
th e s e b o ok
s pe c i a l c o s n t ru c t i o n s ) , p re c l u d i n g th e s e n ten c e
"
Me an d h i m b ou gh t th e b o ok s "
3 . W e ak s y n t a c t i c re s t r i c t i on s : Th e s e a re a l s o
ge n u i n e g r amma t i c a l re s t r i c t i on s , b ut no t a s s e ri ous i n th e
s e n s e th a t on e w ou l d no t b e con s i de re d q u i t e a s i l l i t e r a te
mak i n g we ak s yn t a c t i c e r ro r s a s s t r on g s yn t ac ti c on e s . In
th i s c a te g o ry i s th e re s t r i c ti on wh i c h s ay s a c e r ta i n ty pe
o f n ou n ( c ou n t n oun s ) re qu i re s s ome th i n g i n th e a r t i c l e
p o s i t i on . F o r e x amp l e , th e p a r s e r re j e c te d th e s en te n c e
" "
E n zyme p re p a r a t i on s f rom r a t an d man we r e an a ly z e d .
b e c a u s e i n s c i e n t i f i c E n g l i s h i n ge n e r a l , wh i ch th e l e x i c on
" "
re f l e c t s , the w o rd rat i s a c oun t n oun , e ve n th o ugh i n th e
s ub l an g u a ge o f ph a rma c o l ogy i t i s n o t a c o un t n o un .
48
4 . S e l e c ti on a l re s t ri c t i on s : Th es e re s t r i c t i on s ch e ck
f o r a t t r i b ut e a g re e me n t an d ve r ge on th e s em an ti c . Th e
s e n te n c e
"
S k y s c r ap e rs l e ap
wh i ch i s p e rh ap s a c c e p t ab l e i n f a i ry t a l e s or i n s ome awkw a rd
me t aph o r i c al s e n s e , wo u l d b e re j e c t e d b e c au s e a re s tr i c ti on
" "
w ou l d ch e ck th e w o r d d i c t i on a ry un de r l e ap f or a l i s t o f
th e a t t r ib u t e s i t s s ub j e c t m ay n o t ta k e , e .
g . i n an i ma t e .
Th i s c he ck i s m a de n o t on l y f o r th e S u b j e c t V e rb c on s t ru c
ti on , b ut al s o for tr an s f o rma t i on s o f th a t c on s t r u c t i on i n t o
a n o un ph r as e . T h u s th e s e n t e n ce
" "
L e ap i n g s k y s c r a p e r s c an b e d an g e r ou s .
"
w ou l d h a ve th e un amb i g uo us i n t e rp r e a t i o n . It is d an g e r ou s
"
for o ne to l e ap s k y s c r ap e r s ,
5 . P un c t u a t i on re s t r i c t i on s : I n th i s c a te g o ry a re
o c c u r b e twe e n a ve rb an d i t s i mme d i a t e l y p re c e d i n g s ub j e c t .
A l s o i n th i s c a t e g o ry i s th e re s t r i c t i on re q u i ri n g a
q ue s t i on t o b e f o l l ow e d b y a q ue s t i on m a rk .
6 . O p t im i z a ti on s : S ome re s t r i c t i on s a re O p t i mi z a t i on s
ma t c h i n g w i th s ome c on s t ru c ti on s i s n o t a t te mp t e d un l e s s
it . W h i l e th e s e re s t r i c t i on s a i d i n th e p a r s i n g , the y d o n o t
_4 9_
7 . M i nw o r d re s t r i c t i on s : Wh en amb i g uo u s s e n te n ce s
a re e n co un t e re d , th e t o p - d own p a r s e r me re l y l i s ts a l l
po s s i b l e p a r s e s . Fo r e x amp l e , i n th e c l as s i c s e n te n ce
" "
T h e y a re f l y i n g p l an e s .
o ne p a rs e w ou l d h ave
an d th e s e c on d p a r s e wo u l d h ave
" "
f l y i n g p l an e s
Th e O p t i on s a re o rde re d so th at h o pe fu l l y th e p re fe r re d p a r s e
c om e s up f i r s t , an d i n f a c t th i s ge n e ra l l y s e ems to b e th e
cas e .
wh a t m ay b e c a l l e d p e rm an e n t p re d i c t ab l e amb i gu i t i e s .
Amb i g u i ty l i k e th at i n th e s en te n ce ,
" "
W e h i d th e f l as h l i gh t i n th e k i t ch e n un de r th e s i nk .
w i l l re s u l t wh e n e ve r th e re is a s e q ue n c e o f p re p o s i t i on a l
ph ra s e s . I n the s e c a s e s , a l l p a r s e s e x c e p t th e f i rs t a re
" "
s upp re s s e d b y wh a t a re c a l l e d th e Mi nw o r d re s t r i c t i on s .
T h e y a re c os me t i c i n p u rp os e an d c au s e i n f o rm a t i on to b e
l os t . I de a l l y we wo u l d l i k e our an a l y s i s to i de n t i fy th e
p re p o s i ti on a l ph r a s e s an d i n d i c a t e by po i n t e rs th e s l o ts
i n the l a r ge r s t r i n g s i n to wh i c h th e y c an f i t . Th i s , in fact ,
is o ne O f th e re a s on s f o r de ve l op i n g a n o d a l s p an s p a r s e r ,
wh i ch d e te c t s a n d s t or e s s u ch i n f o rm a t i on e f f i c i e n t l y .
-
50 _
T h i s c l a s s i f i c at i on O f th e re s t r i c t i on s s u g ge s t s th e
a l g o r i thm i c ap p r o a ch to s e mi g r a mm a t i c a l i t y d e ve l op e d i n
Ch apte r 7 . A s s ume O p t i m i z a t i on s an d m i nw o r d re s t r i c t i on s
h a ve b e e n e l im i n a t e d . Th e an al y s i s o f a s e n te n ce w ou l d
proce e d as f o l l ow s : F i r s t th e p a r s e r w o u l d run w i th a l l
th e re s t r i c t i on s i n e f f e c t . Th e n th e c l a s s e s o f re s tr i c
t i on s w o u l d b e l i f t e d one b y on e , i n th e f o l l ow i n g o rde r :
1 . P un c t u a t i on s i n ce n o o ne sh o u l d b e h e l d to o
re s p o n s i b l e f o r hi s p un c t u at i on .
2 . S e l e c t i on a l to a l l ow th e a u th o r s ome me t ap h or s ,
awkw a rd as th e y m ay b e .
3 . W e ak s y n t a c t i c i n i n vo l ve d s e n te n c e s , e spe ci al l y
i n s c i e n t i f i c w r i t i n g wh e re on e a i ms for c on c i s e n e s s ,
th e s e m ay e ve n b e hon e s t mi s t ak e s .
4 . S t r on g s yn t a c t i c i f th e 1 8 th w o rd is th e s ub j e c t
an d 8 7 th wo rd th e ve rb , t h e a u t ho r may h a ve fo rg o t t e n
wh a t h i s s ub j e c t wa s b y th e t ime h e re a c h e s th e ve rb .
P o s i t i on a l r e s t r i c t i on s wo u l d no t b e l i f t e d a t a l l s i n c e th a t
w ou l d op e n th e d oo r t o n on s e n s e s t r i n g s o f wo r d s .
L o c a t i n g Re l a t i on s
Th e re s t r i c t i on s f o r th e to p - down p a r s e r a re de f i ne d
i n te rm s o f th e l o c a t EEJ r e l a t i o n s wh i ch th em s e l ve s a re
w r i t t e n i n th e s ub l an gu ag e o f E n g l i s h an d a re c omp i l e d i nt o
s t a ck s of p r im a ry r ou t i n e s wh i ch a re F O RT RAN s ub r ou t i ne s
i n th e pa rs i n g p r og r am .
Th e p r ob l e m w i t h g r amma t i c a l r e l at i on s h i p s i s n ot
- 51
s t a t i n g th em b u t f i n d i n g th e app rop ri at e a rg ume n t s w i th i n
t h e s e n ten c e . Th e b a s i c a s s ump t i on , wh i ch s o l ve s th i s
con te x t - s e n s i t i ve n a t u re o f n at ur a l l an g u a ge , i s th at th e re
" '
i s re a l l y no a c t i on at a d i s t an c e b u t ra th e r th a t g r a mm a t i
c a l ly re l a t e d e le me n t s a re ad j ac e n t at s ome p o i n t i n th e t r e e .
F o r an y tw o wo rd s wh i ch h ave an y g r amm at i c a l re l a t i o n s h i p
wh a t s oe ve r , th a t re l a t i on s h i p i s e xp re s s i b l e by a l o c a t i n g
i s the s ma l l s i z e o f th e se t o f l oc a ti ng re l at i on s ( th e r e
a re 25
Th e b u l k o f th e de t a i l e d de f i n i t i on s of th e s e re l a t i on s
b e l ow b y th e c l a s s i n t o w h i c h the y f a l l .
1 . Bas ic t re e - t r ave rs i n g r e l a ti on s :
A c t i n g h o r i z on t a l ly is
C O E L wh i ch s e a r c h e s to th e r i g h t an d l e f t fo r th e n ame d
c oe l e me n t i n th e s t r i n g .
A c t i n g ve r t i ca l l y a re
E LE M wh i ch l o o k s d own i n ve rs e + I MMS T G wh i ch l oo k s up un t i l
f o r th e s pe c i f i e d i t e n c o un te rs a s t r i n g ,
e l e me n t . E LE MO F wh i ch l o o k s up f o r
th e s p e c i f i e d e l e me n t .
C O RE RT go e s a l l th e w ay d own th e t re e , w i th o u t p a s s i n g
th r ou gh ad j un c t n ode s , un t i l i t e n c o un te r s an a tomi c
_
52
o r a s t rin g . Th i s i s th e b as i c rou t i n e o f th e
g r amm a r , b e c a u s e ty p i c a l l y w e w i s h to ch e ck a t t r i b u te s
o f th e co re s o f a d j a c e n t e l e me n t s i n a s t r i n g .
2 . Ad j un c t re l a t i on s :
a . L e f t an d R i gh t A d j un c t s :
LA D J l o c a t e s th e l e f t a d j un c t + i n ve rs e + H O S T RT f i nd s th e c or e
RA D J l o c a te s th e ri gh t ad j un c t o f th e h o s t o f a
l e f t o r r i g h t a d j un c t .
b . S e n te n c e ad j un c t s :
P RE S A l o ok s le f t fo r < S A> + I N VE RS E + H OS T S T RI N G
. f i n d s th e
i s emb e dd e d , e .
g .
< AS S E RT I ON > .
3 . S ub j e c t V e rb O b j e c t - o f - be re l at i on s :
DE E P E S T - VE RB t r ave l s -
i n ve r s e U L T I MA T E - S UB JE C T tr ave l s
d i ag on a l l y d own th e up to f i n d th e s ub j e c t
t re e th r o ugh ve rb a l whe n c a l l e d a t th e
o b j e c t s t r i ng s t o f i n d de e p e s t ve rb .
th e de e p e s t ve rb .
Fo r e xamp l e , i n th e s en te n ce
"
I h ave g i ve n up t ry i n g t o l e a rn to b e ab l e to un de r s t an d
"
th i s g r amm a r .
" "
th e de e p e s t ve rb is un de r s t an d an d i t s u l t i ma te s ub j e c t
" "
is I . DE E P E S T - OB J B E is a c omp o s i t e r e l a t i on wh i ch f i rs t
" "
l o c at e s th e de e p e s t ve rb an d i f i t i s a ve rb l i k e to b e ,
finds the ob j e c t - o f - b e .
_5
3_
' '
I n the b o t tom -
up p a r s i n g th e n o t i on O f c o re b e c ome s
c ru c i a l an d i n f a c t i s e x te n de d i n me an i n g . T he o th e r
th e me rg i n g th at t ak e s p l a c e i n th e no d a l S pa n s a l g o ri t hm ,
i t m ay n o t b e po s s i b l e t o d e t e rm i n e , fo r e xamp l e , th e l e f t
ad j un c t o f a n oun un i q ue l y .
T h e W or d D i c t i on a ry
T h e w o rd d i c t i on a ry l i s t s fo r e ac h w o rd i ts p o s s ib l e
g r amma t i c a l c a t e g o ri e s ( n oun , te n s e d ve rb , e tc ) . an d i ts
a t t r i b ut e s un de r e a ch c at e g o ry . As an e x amp l e , l e t u s l o ok
" "
a t th e d i c t i on a ry e n t ry fo r the word f a ce
a t t r ib u t e s
S I N GU LA R s i n c e i t c an o c c u r i n th e c on t e x t
" "
Th i s is b ut n o t i n Th es e a re
" "
N C OUN T l ( c oun t n o un ) s ince f a ce c an app e a r i n
th e c on te x t
"
Th e is bu t not in is
" "
N ON H UMAN s i n ce f a ce c an n o t appe a r i n th e c on te x t
re ad s
"
The b e l i e ve s
kn ow s
FAC E i s a l s o a t e n s e d ve rb , an d a s a ten s e d ve rb i t i s
P L U RA L s i n c e i t c an n o t o c c u r w i th a de f i n i t e l y s i n gu l a r s ub j e c t .
"
FAC E is a l s o an ( un te ns e d ) ve rb ( as i n to
A s a ve rb an d a te n s e d ve rb i t has th e fo l l ow i n g a tt ri b u t e s :
-5 4_
CH AP T E R 3 . T H E N O D AL S P AN S AL GO R I T H M
I n f o rm a l De s c r i p t i o n .
w i th p r odu c t i on s
A B C
whe r e A , B , an d C a re n on te rm i n a l s ymb o l s an d a is a
te rm i n a l s ymb o l , an d s upp os e we ar e p a rs i n g th e s t r i n g
II II
a
A s i n g l e - t r a ck b a c k t ra ck in g b o t tom - u p p a r s i n g a l g o ri thm w i l l
p r o du c e th e tw o p a r s e t r e e s O f Fi g . l .
A A
B C
a a
F i g u re 1
A n a i ve mu l t i - t r a ck i n g b o t t om — u p p a r s i n g a l g o r i thm w i l l
p r odu c e the t re e - s t r u c t u re O f F i g u re 2 , wh e re th e
l i nk i n d i c at e s an amb i g uo u s p a re n t n o de .
F i g u re 2
_
5 6_
It is e as y to see th a t f o r l a rg e r i n h e re n t l y amb i g uo u s
g r amm a r s w i th th e f i rs t a l g o r i thm th e t i me re q u i re d w i l l
g row e xp on e n t i a l l y w i th th e l e n g th o f th e s tr i n g b e i n g
p a rs e d , an d w i th th e s e c on d a l g o ri thm b ot h t im e an d s p a ce
re q u i re me n t s w i l l g row e xp on e n ti a l l y . Th e n od a l s p an s
3
a l g o r i thm c u t s th e g row th down to n b y me rg i n g i d e n t i c al
" "
th e tw o A n od e s o f F i g u re 2 w o ul d b e me rg e d , g i vi n g th e
t re e s t ru c tu re
-
o f F i g u re 3 , wh e re th e l ink i ndi
c a te s an amb i g uo u s O f f s p r i n g n o d e .
F i gu re 3
F o rm al D e s c r i p t i on .
I n w h a t fo l l ow s , upp e r c a s e l a ti n l e t t e r s n e a r th e
b e g i n n i n g O f th e a l ph ab e t , r e p re s e n t n on - te rmi n a l
or te rm i n a l s ymb o l s o f a g r amm a r ; th e l e t te r S re p re s e n t s
th e ro o t s ymb o l ; l owe r c a s e l a t i n l e t te rs n e a r th e b e g i n n i ng
O f the a l ph ab e t , r e p r e s e n t t e rm i n a l
s ymb o l s ; up p e r c a s e l a t i n l e t te r s n e a r th e e n d o f th e
a l ph ab e t , re p r e s e n t s t r i n g s O f te rm i n a l s an d
n o n - t e rmi n a l s , an d l ow e r c a s e l e t te rs i n th e mi d d l e O f th e
a l ph ab e t , re p re s e n t i n t e g e r s . P rod u c t i on s
" "
o f a g r amm a r w i l l b e i n d i c a te d b y a r i gh t a r row , X Y .
-5 7_
W e w i l l w r i te XY Z XY Z i f an d on l y i f Y Y is a
l Z 1 2
p ro du c t i on o f t h e g r amma r . W e w i l l w r i te X X if
1 n
an d on l y i f th e re a re s t r i n g s s u ch th at
X X l i i n By c on ve n ti on we wi l l s ay
i +1
.
,
i
a 3 a A 5 A
Le t G b e a c on t e x t - f re e g r amma r i n wh i c h e ve ry
p ro du c ti on i s o f t h e fo rm
A X wh e re 0 IX 2 (1 )
Th at i s , th e r i g h t s i d e o f e ve ry p ro d u c t i on ha s e i th e r o n e
c on d i t i o n on G th an th at G i s i n C hom s ky n orma l fo rm , an d
th e p r oo f th a t any co n te x t - f re e g r amma r c an b e p u t i n t o
f o rm ( 1 ) mi m i c s th e p r oo f t h at an y c on t e x t - f re e g r amm a r
1
c an b e p ut i n t o C h oms k y n o rm a l fo rm . Le t
b e a s t r i n g wh i ch i s to b e p a r s e d a c c o rd i n g t o g ramma r G .
Th e n o d a l s p an s p a r s i n g p ro c e s s cons i s ts i n b ui l d i n g
up a l i s t o f wh at a re c a l l e d n od a l s p an s .
D e f i n i ti o n : A n od a l S p an i s a q u ad r up l e
< 3
1 : q D)
wh e re p an d q a re i n t e ge r s , 0 p q n ; A is a n on
t e rmi n a l or te rm i n a l s ymb o l s u ch th a t
"
S e e f o r e xamp l e N o am C homs ky O n C e r t ai n F o rm a l P rop e r t i e s
,
"
o f G r amma r s I n fo rma t i on an d C on t ro l V o l 2 p 1 4 9 o r
, , .
, .
H op c r o f t an d U l l m an F o rma l L an gu a ge s an d th e i r R e l a t i on to
,
A u toma t a Re a d i n g Ma s s
, 19 69 p , 51 .
, , . .
-5 8
A :
a a a
p +l p +2 q
i . e . th e s y mb o l A u l t i ma t e ly d e r i ve s th e s ub s t r i n g
a
q an d D, a p o s s i b l y e mp ty s e t c a l l e d th e
di vi s i on s l i s t o f th e s pan , i s de f i n e d as fo l l ow s
D e fi n i t i on : Th e d i vi s i on s l i s t 0 o f th e S p an (2)
i s th e s e t o f
( a) t rip l e s
wh e re B an d C a re n on te rmi n a l or t e rmi n a l s y mb o l s an d
r i s an i n te g e r , p r q , s u ch th at
A B C
is a p r o du c t i on i n th e g r amm a r ,
B a a
p +l r
an d
C a
r +l
a
q
an d
wh e re D is a n on t e rm i n a l or te rmi n a l s ymb o l s u ch t h a t
A D
i s a p r od u c t i on i n th e g r amma r , an d
D a
p +l
a
q
A l t e rn a t i ve l y , w e may th i nk O f th e d i vi s i o n s l i s t 0
o f s p an (2) a s a l i s t o f p oi n t e r s to th e p o s s i b l e of f p s r i ng
n o de s o f n o de A .
No te th a t the d i v i s i on s l i s t fo r a s p an (2) is e mp t y
-
59_
i f an d on l y i f A is a te rm i n a l s ymb o l .
C l e a rl y th e s t r i n g is an a c c e p t ab l e s en te n ce fo r
g r amma r G i f an d on l y i f th e n od a l S p an
o c c u r s i n th e l i s t o f s p an s .
Th e re a re th re e s t e p s i n th e n od a l s p an s p a rs i n g
a l go ri th m :
S tep ( 1 ) T he i n p u t s ymb o l s a re re a d i n a l e ft - t o
r i gh t m an n e r . W h e n th e i np u t s y mb o l (i . e . te rmi n a l s ymb o l )
a . i s re ad , th e S p an
l
i s fo rm e d an d a d de d to th e l i s t o f n od a l s p an s .
S t ep ( 2 ) F or e ve ry n od a l s p an an d fo r
e ve ry p r o du c t i on A D , the qu a d rup l e
(3)
is fo rme d . I f th e r e i s a n o d a l S p an o f th e f o rm
a l r e a dy o n th e l i s t , the e l e me n t <D> is ad de d t o th e s e t
O t he rw i s e , s p an (3) i s a d de d to th e l i s t o f n od a l s p an s .
S tep ( 3 ) Fo r e ve ry n od a l S p an an d fo r e ve ry
p r od u c t i on A B C s u ch th a t a s p an O f th e f o rm
i s a l re ady on th e l i s t O f n od a l s p an s , th e q u ad rup l e
-6 0
is f o rme d . I f th e re is a n o da l s p an o f t he f o rm
a l re a dy o n the l i s t , th e e l e me n t is ad d e d to th e
s et O th e rw i s e s p an (4) i s ad de d to th e l i s t of n od a l
s p an s .
Th e s p an s m a y b e p r oc e s s e d s eq u en t i a l l y by p l a c i n g
th em on a f i rs t - i n , f i rs t - o u t s t a ck a s t h e y a r e f o rme d , or
r e c ur s i ve l y b y p l a c i n g th e m on a f i r s t - i n , l a s t - o u t s t a ck
a s th e y a re f o rme d .
I t i s e a s i l y s h own th at a q u ad r up l e is ge n e r a te d by
th e ab ove a l g o r i thm i f an d on l y i f i t i s a va l i d n od a l s p an .
A p a r t i c u l a r p a rs e t re e c an b e de t e rm i n e d f rom th e
co l l e c t i o n of n o d a l S p an s a s fo l l ow s : B e g i n w i t h t h e S p an
a s e n te n ce a n d has n o p ar s e t re e . Th e roo t n o de o f th e
p a rs e t re e is l ab e l l e d S an d th e S p a n i s p l a ce d on a to - b e
p ro c e s s e d l i s t . Fo r an y n od a l S p an
<
p r A r q é
I
>
o n the t o - b e - p r o ce s s e d l i s t p i ck an y e l eme n t f r om D .
y
,
I f th i s e l e me n t i s a s i n g l e t on <D>
, th e n g i ve th e n ode
l ab e l l e d A i n th e p a rs e t re e a s i n g l e o f f s p r i n g n o de
l ab e l l e d D
A
a n d p l a c e th e s p an on th e t o— b e - p ro ce s s e d l i s t .
-
61
I f th e s e l e c te d e l eme n t i s a t ri p l e th en g i ve th e
n o de l ab e l l e d A i n the p a rs e t r e e , tw o O f f s p r i n g n o de s
l ab e l l e d B a n d C ,
B C
a n d p l a ce t h e S p an s an d on th e t o - be
p ro c s s s e d list If D is emp ty , A i s a t e rm i n a l n o de an d
y
.
p ro c e s s e d l i s t . C on t i n ue th i s p r o ce d ure un t i l th e to - b e
p roc e s s e d l i s t i s e xh a u s t e d .
It is e a s i l y s h own th at a l l p a r s e t re e s . c an b e fo un d
i n th i s wa y an d th a t a l l t re e s fo un d i n th i s w ay a re v a l i d
p a rs e t re e s . Th e s e n te n ce i s amb i g u ou s i f an d on l y i f
s ome D e n c o un te re d i n th i s p r oc e d u re h as mo re th an one
i
e l e me n t .
T h e p a r ti c u l a r a l g o r i thms us e d fo r t e s t i n g a r e
s p e c i f i e d mo re p re c i s e l y i n th e a l g o r i thm - s pe c i f i c a t i on
l an g u a ge S E TL i n S e c t i on s an d
E x amp l e .
<N S TG > < AP O S > < *N > < *N > < * P RO >
_6 2_
7 .
8 .
p rod uc t i on
H en ce , a c c o rd i n g t o s t e p ( 3) of t he a l g o r i thm we l o ok fo r
f i n d th a t s p an 6 is s u ch a s p an . Th e re fo re we fo rm th e
n ew s p an
9 .
to th e s p an
10
vi a s t e p an d s im i l a r l y s p an 9 g i ve s r i s e t o th e S p an
11 .
I n p r o ce s s i n g s p an 10 i t i s s e e n th at < OB JE C T > i s th e
,
s e c on d e l emen t O f two d i f f e re n t p r o du c t i on s :
an d
<V I N GO > < *V ING> < OB JE CT >
L o ok i n g th e re f o re fo r a s p an wh o s e e ndp o i n t i s 3 an d wh o s e
f o rm th e n ew s p an
12 .
On th e o th e r h a n d , wh i l e p r o c e s s i n g s p an 11 , we l ook f o r a
_ 64_
an d fo rm th e s p an
13 .
S p an 12 g i ve s r i s e vi a s te p (2) t o a s p an w i th s ymb o l
h ave s u c h a S p an , vi z . S p an 11 . Th e re f o re we me re l y ad d
t o th e d i vi s i o n s l i s t o f s p an l l :
11 .
T h i s ch an ge h a s no e f fe c t on th e n ode a l re a dy l y i n g ab o ve
< O B JE C T > i n th e t r e e an d d oe s n o t me an S p an 11 h a s to b e
p r o c e s s e d a ga i n . F i n al ly , S p an 13 is p ro c e s s e d ; < VO > is
f o un d t o b e th e s e c on d e l e me n t i n th e p ro d u c t i on
an d i s c oa l e s c e d w i th S p an 2 t o f o rm th e n ew S p an
14 .
c om p l e t i n g th e p a r s e s u c c e s s f u l l y .
T he s t r u c t u re of th e s p an c o l l e c t i on b u i l t up b y th e
p a r s i n g a l g o r i th m i s s h o wn i n F i g u re 4 .
N ote tha t th e S p an s we re p r o ce s s e d on a fi rs t - in ,
f i r s t - ou t b a s i s . T h e y c ou l d a l s o h a ve b e en p ro c e s s e d on
a f i r s t- in , l a s t - ou t b a s i s i n a re c u r s i ve e n vi ronme n t .
Th e f i n a l p a r s e s o f th e s e n te n ce c an b e f oun d b y
s t a r t i n g a t th e r oo t s p a n ( s p an 1 4 fo r < AS S E RT I ON > ) an d
fo l l ow i n g d own the d i vi s i on s l i s t s as d e s c r i b e d i n th e
p re v i ou s s e c t i on . An y n o de wh i ch h a s a d i vi s i on; lis t
S p an s an amb i g uo u s p o r t i on O f t h e s e n te n c e . Th e amb i g u i ty
-
65
i s re pr e s e n t e d s u c c i n c t l y i n th e s p an c o l l e c ti on ge ne r a t e d
b y th e a l go r i thm .
14 . < AS S E RT I ON >
3 .
< OB JE CT >
2 .
<NS TG > 13 . < VO >
1 .
< *P RO > 4 . < * TV >
9 .
<N S TG > 12 . <V I N GO >
6 .
< AP O S >
5 .
< * VI N G > < OB JE C T >
< NS TG >
7 . < *N >
The an d l i n k s re p r e s e n t c oe l e me n t or
o f f s p r i n g n ode s ; an d th e l i nk s re p re s e n t amb i gu ou s
pa re n t n ode s .
-
66
D . C an d i d a t e s L i s ts
No t a l l th e n od e s ge n e r a te d b y th e a l g o r i thm h ave a
p l a c e i n th e f i n a l p ar s e t re e . I n th e e x amp l e , on l y n ode 3
fo r < O B JE C T > d oe s no t t ak e p a r t i n a f i n a l p a r s e O f th e
s e n t en ce , b u t th i s is b e c au s e th e g r amm a r w e u s e d wa s ve ry
S pa rs e . I n p a r s i n g a s e n te n c e w i th a re as on ab l y f u l l
E n g l i s h g ramma r , th e re w i l l ve ry l i k e l y b e a l a rg e n umb e r
o f i r re l e van t n o d e s ge ne r a t e d b y th e a l g o r i th m b e c au s e o f
th e h i gh d e g r e e o f l o c a l amb i g u i t y i n E n g l i s h .
A me th o d fo r c u t t i n g d ow n on th e n umb e r o f i r re l e v an t
2
n ode s w a s i n t r o du c e d b y J ay B arley an d w i l l b e e xp l a i ne d
h e re a s th e de v i c e o f c an d i d a te s li s ts . N o ti c e i n th e
po r t i on o f a s e n te n c e . T h e re f o re , w e c ou l d h ave avo i d e d
ge n e r a t i n g s p an 3 i f we h a d re s t r i c t e d ou r s e l ve s a t th a t
p o i n t t o s ymb o l s wh i c h c an ap pe a r on th e l e f tmo s t b r an ch o f
g e n e r a te d i n p a r s i n g th e l a t te r p o rt i on s by g e n e r a ti n g on l y
n od e s wh i ch a re con s i s t e n t w i th th e p o r t i on O f th e s e n te n ce
fa ce
i n a s e n ten ce , i t c o u l d b e i n t e rp r e t e d a s a te n s e d ve rb an d
-6 7_
th e ap p r op r i a t e n od e s c ou l d b e g e n e r a te d . I f h ow e ve r th e
" " " "
p re vi ou s w ord w as th e , i t i s imp o s s ib l e fo r f ace to
b e a te n s e d ve rb an d w e c ou l d a vo i d gen e r a t i n g a l l th e s p an s
wh i c h a s s ume i t i s . O f c ou r s e , a l l i r re l e van t s p an s w o u l d
b e e l i mi n a te d in th i s w ay on ly i f th e i n te rp re ta t i on of a
t ok en we re de te rm i n e d un i qu e l y by i t s l e f t c on te x t , an d i t
is h i gh l y un l i k e l y th at s u ch a g r amma r c o u l d b e co n s t r u c te d
fo r En g l i sh .
M o re f o rma l l y , w e c a n de f i n e f o r an y s ymb o l A th e s e t
F (A) {B I ( 3 x) (A B x) }
I n t u i t i ve l y , a s ymb o l B i s i n F ( A ) i f an d on l y i f i t c an
b e f i r s t o r l e f tmo s t s ymb o l i n a t re e de pe n d i n g f r om A .
Th e c an d i d a te s l i s t s a re f o rme d du r i n g th e p a r s i n g
an d th e r e i s o ne f o r e a ch i m p u t s ymb o l . Th e c an d i d a te s
list C f o r a s ymb o l a i n th e i np ut s t r i n g l i s t s al l th e
i i
s ymb o l s wh i ch c o u l d s p an a s ub s t r i n g b e g i n n i n g at a
i
c on s i s t en t w i th th e p a r s i n g o f a a
_
. In pa rt i cul ar ,
l i l
C
i +1
{D I ( th e S p an h a s b e e n g e n e ra te d
an d A B C i s a p r od u c t i on i n th e g r amma r an d
D e
-6 8
W e c an a u gme n t th e b a s i c a l g o r i th m to b u i l d up th e
c an d i d a te s l i s t s d u r i n g th e p a rs i n g by i n s e r t i n g th e
f o l l ow i n g s t e p s :
I n i ti al i ze C to O , 1 i n .
I n s te p s an d ad d a q u ad rup l e
on th e c an d i d a t e s lis t C
p +l
.
S te p ( 4 ) Wh e n an y s p a n i s ge n e r a te d , l ook
for p r o d u c t i on s o f th e fo rm
A B C
an d fo r e a ch s u ch p rod u c t i on p e r f o rm th e O pe r a t i on
€
q 1
C
q
+l
U H Q
Th e e f f e c t of u s i n g c an d i d a t e s l i s t s i n p ar s i n g
E n g l i s h w i l l b e e xa mi n e d i n C h ap t e r 4 .
S p a c e an d T i me R e q u i reme n t s
Th e f o l l ow i n g t e rmi n o l og y i s u s e d i n th i s s e c ti on :
p th e i n i t i a l p o i n t of a s p an ;
q th e e n d p o i n t of a s p an ;
r th e d i vi s i on p o i n t of a S p an ;
A , B , C s ymb o l s i n th e g r amma r , u s u a l l y i n c on n e c ti on
w i th th e p ro du c t i on A B C;
n n umb e r o f s ymb o l s i n th e s e n te n c e O f i np u t s t ri n g
b e i n g p a rs e d ;
_
59_
n umbe r o f p ro d uc t i on s i n th e g ramm ar
" "
( A X X X c o un t s a s th re e p ro d u c t i on s ) ;
l 2 3
P n umb e r O f p r od u c ti on s i n g ramma r i n wh i ch C
app e a r s on r i gh t S i de o f a p ro du c t i on ;
P n umb e r o f p r od u c ti on s i n a g r a mma r i n wh i c h A
ap p e a r s on th e l e f t s i de O f th e p r od u c t i on ;
i n th e g ramma r .
o f s p an s i s l i m i te d b y N . F o r e a ch q , th e re a re q p o s s i b l e
va l ue s o f p . q c an va ry f rom 1 to n . Th u s , th e n umb e r o f
s tri ng is b o un de d by
n q -l
Z Z 11 2
% a
q =1
p
= 0
S pace : S p a ce re q u i reme n t s ar e de t e rm i n e d by th e s i z e
O f t h e d i v i s i on s l i s t s f or e a ch S p an . F o r aa g i v e n p , q , an d
s p an i s b o un de d b y
q
A
P ( -
p )
q
on e o f t he q p p o i n t s b e twe e n a an d a Th e re f o re th e
p +l
.
i npu t s t ri n g is b o un de d by
n ql
-
Z Z Z P
A
( q -
p ) 3
% P n
3
q
= l p= 0 A6 2
-
70
H i s to ry
AS n ot e d b e fo re , th e n o d a l S p an s p a rs i n g a l go ri thm
3
de ve l ope d i n d e pe n d e n t l y by Y oun ge r wh o de s c r i b e s th e
a l go r i thm i n te rms o f a th re e - d i me n s i on a l b i n a ry r e c o gn i
t i on ma t ri x i n wh i ch th e -
th e n t ry i s e q u a l to on e
wh e n e ve r th e k th s ymb o l i n t h e g r amma r s p an s th e s ub s t r i ng
th e d i vi s i on s l i s t s a re re c ap t u r e d f r om th e g ramm a r .
4
K a s am i an d T o r i i g i ve a ve rs i on o f th e a l g o r i thm fo r
5
E arley g i ve s a d e ta i l e d ve rs i on o f th e a l go r i thm tog e t h e r
w i th c omp l e x i ty r e s u l t s . H e d oe s no t re q u i re th e g r amma r
b e g i ve n i n C h o m s k y n o r m a l ik n ml b u t r a th e r t re a ts i t
e s s e n t i a l l y s p e c i fy i n i t i a l an d e n d p o i n ts O f a s p an an d
th em p re d i c to r , wh i ch c o r re s p on ds to th e de vi ce of
c an d i d at e s l i s t s ; c omp l e te r , wh i ch c o r re s p o n d s to s te p (3)
o f th e al go r i th m g i ve n ab ove ; an d s c an n e r , wh i ch c o rre s p on d s
"
Y o un g e r D H , Re . .
, o gn i t i on an d P a r s i n g o f C on te x t - F re e
L an gu ag e s i n T ime n Inf . C on t r o l 1 0 2 , 1 89-2 0 8
, .
4 "
K a s ami T , To ri i K . A S yn t ax - An a l y s i s P r o ce du re f o r
, .
,
—4 3 "
u n am b i gu ou s C on te x t -
F re e G r amma r s J AC M 1 6 3 4 2 3 1 , , , .
5
E a r l ey , Op . Ci t .
6
C ocke J S c hw a rt z J C om p i l e rs C omp i l e r W r i t i n g
q
. .
, , ,
Te ch n i ue s , N ew Y o rk U n i ve rs i ty , 1969 .
-
72 _
CHAP T E R 4 . N O D AL S P AN S P A RS I N G W I T H OU T RE S T R I C T I ON S :
S T A T I S T I CAL RE S UL T S
I n t r odu c t i on
C h ap te r 4 de s c r i b e s s t ud i e s wh i ch w e re made u s i n g on l y
th e c on t e x t f re e c omp on e n t O f th e S t r i n g P ro j e c t s g r amm a r
- '
,
w i t h o u t i n vo k i n g re s t r i c ti on s . Th e f i rs t go a l w a s t o te s t
th e n od a l s p an s a l g o ri thm on a l a r ge c on te x t - f re e g r amma r
i n o rd e r to g a i n i n f orma t i on ab o ut th e p r a c t i c a l e f f i c i en cy
o f th e a l go r i t hm . S e c on d l y , i t w as on ce h op e d th a t a n od a l
s p an s p a r s e m i gh t b e th e f i rs t p a s s i n a p a r s i n g p r o ce s s
wh i ch w ou l d us e th e re s u l t s o f th i s f i r s t p a s s as an
op t im i z a t i o n i n a t o p - down b a c k - u p s e c on d p a s s du ri n g wh i ch
th e re s t r i c t i on s w o u l d b e c a l l e d . Th i s d i d n o t t u rn ou t t o
be p rac ti c a l , an d i n f a c t , the p r i n c i p a l re s u l t of th e s e
s t ud i e s is to p o i n t o u t th e i mp o r t an c e o f th e re s t r i c t i on s
i n th e g r amma r .
i . e . i n wh i ch the re a re p ro du c ti on s wh o s e r i gh t s i de s a re
l on ge r th an tw o s ymb o l s , as i n th e r e a re two ap p r oa c he s
th a t may b e t ak e n .
A B C D E (1)
Th e g r amm a r m ay b e t re a te d as g i ve n , th u s p ro du c i n g d e ri v a
t i on t re e s as i n F i g u re 1 :
F i g u re l
_ 73
O r th e g ramm a r may b e t re at e d i n t e rn a l l y a s tho u gh i t we re
o f F i g u re 2 .
F i g u re 2
( H e re an d th r ou gh ou t , A i n d i c a te s th at the f i r s t i s ymb ol s
i
O f an e xp an s i on o f A h a ve b e e n m a t ch e d ) . Th e s e c on d app r o a ch
" "
m ay b e c a l l e d me r g i n g . I n th e a l go r i t hm w i th me rg i n g th e
3
g r ow th o f t ime an d S p a c e re q u i reme n t s is b o un de d b y n ,
k +l
wh e re as w i th ou t me rg i n g th e b o un d i s n wh e re k i s th e
l e n g th o f t h e l on g e s t p ro du c t i on .
Th e d i f f i cu l ty w i th th e u s e of me rg i n g i n n a t u r a l
l an g u a ge p a r s i n g is th a t re s t r i c t i on s a r e h a r de r to e xe c u te .
I n the n od a l s p an s a l g o ri thm th e re s t r i c t i on s e i th e r c a nn ot
ca l l e d or e l s e m ay a t s ome t i me h ave t o re s t ru c tu re p a rt s
o f th e s p an c o l l e c t i on al re a dy b u i l t . I n th e a l g o ri thm w i th
me r g i n g, n o n ~ a d j a c e n t co e l e me n t s i n a s t r i n g ap p e ar on
d i f f e re n t l e ve l s o f the t re e . Y e t m any re s t r i c t i on s O p e r a te
on c oe l e me n t s wh i c h a re n o t a d j a ce n t . F o r e x amp l e , i n th e
- 74
th e re i s a re s t r i c ti on re qu i r i n g ag re eme n t b e twe e n th e O b j e c t
" "
an d th e s ub j e c t i f th e ve rb is a fo rm o f to be :
" "
Th a t m an i s a b an k e r .
" "
Th e s e me n ar e b an k e rs .
Y e t w i th me r g i n g , th e s ub j e c t i s n o l on g e r a c c e s s i b l e wh e n
th e O b j e c t i s e n c oun t e re d . An ot he r re s t r i c t i on re q u i r i n g
s t r i n g i s th e o ne i n vo l v i n g re f l e x i ve p ron oun s i n th e f i n a l
s e n te n c e ad j un c t po s i ti on :
" "
I b u i l t th e c ab i n my s e l f .
" "
H e b u i l t th e c ab i n h i ms e l f .
S u ch r e s t r i c ti on s a re e a s i e r to s t at e an d e xe c u te i f n o
me r g i n g t ak e s p l a c e .
T he re f o r e th e q ue s t i on th a t is a s k e d i n th e s e s t u di e s i s ,
"
D oe s th e a l g o ri t hm w i th o u t me r g i n g re a l l y b l ow up d i s as t r o u s
" " "
ly ? Th e an sw e r t u rn s ou t t o b e an emp h a t i c Yes ! an d th i s
"
l e ad s t o a s e c on d q ue s t i on : D oe s th e a l g o r i thm w i th me r g i n g
"
d o an y b e t te r ? " Th e an sw e r is S ub s t an t i a l l y b u t n ot
,
"
e n ou gh . T h e s e re s u l t s d i c t a te th e fo rm of t h e n o d a l S p an s
a l g o r i t hm wh i c h mu s t b e u s e d i n n a t u r a l l an gu a ge p a rs i ng
an d i n f l ue n c e ve ry p ro fo un d l y th e s t ru c tu re O f th e re s tri c
t i on me t a l an g u age d e ve l op e d i n C h ap te r 5 .
The g r amma r u s e d i n th e s e te s t s is l i s t e d i n Ap pe n d i x D
an d i t s fo rm e xp l a i n e d i n S e c t i on 2 . I n S e c t i on s 3 an d 4 th e
n on m e r g i n g an d me r g i n g a l g o r i thms an d as s o c i a te d d a t a
- 75
s t ru c t u r e s a re S pe c i f i e d . I n S e ction 5 th e r s u lt s o f th e
s t a t i s t i c a l te s ts a re p re s e n t e d . C omp a r i s on s a r e ma de
c an d i d at e s l i s t s .
Th e I n ve rs e G r amma r .
to h a ve th e f ol l owi n g f o rm : T h e re i s on e p ro d u c ti on f o r
e ve ry n on te rmi n a l s ymb o l A ,
A X Y Z
whe re a re n on - n u l l s t ri n g s O f n on te rmi n a l an d
te rm i n a l s ymb o l s wh i ch c on s t i t u te p os s i b l e e xp an s i on s o r
a l te rn at i ve s O f the s ymb ol A . Th e s t r i n g s m ay b e o f an y
le n g th g re a t e r th an o r e q u a l to on e ; n o n u l l p r od u c ti on s
a re a l l ow e d . A s t rin g X m ay h ave th e f o rm
[B] C [D]
E ve ry c on te x t - f re e g r amma r c an b e p u t i n t o th i s f o rm .
B ri e f ly , we m ay re w r i te th e p rod u c t i on s
A + B C D
B E F nul l
as
A [B] C D
B E F
I t w i l l b e us e f u l to d i s t i n g u i s h s e ve r a l ty pe s o f e l eme n ts
in a s trin g . An e l eme n t i n a s t ri n g i s p o s s i b l y i n i t i a l i f
i t i s p re c e de d on ly by O p t i on a l e l e me n t s . T h u s i n th e s t ri n g
-
76
[B] [ C] D [E ] (2)
B , C , an d D a re p o s s i b ly i n i t i a l an d E i s n o t . An e l e me n t
i s ne ce s s ari ly i n i t i a l i f i t i s th e f i r s t e l eme n t i n th e
s tring . Th u s on l y B is n e ce s s a r i l y i n i t i a l i n An
e l e me n t i s p o s s i b l y t e rm i n a l i f i t is f o l l ow e d on l y by
O p ti on a l e le me n t s . Th u s , in (2) D an d E a re p o s s ib l y
t e rm i n a l . T h e p o s s ib l e s u c ce s s o r s o f a s ymb o l a re th o s e
e l eme n t s wh i c h f o l l ow i t i n th e s t ri n g , up t o an d i n c l ud i n g
th e f i r s t n on op t i on a l e l eme n t . Th u s i n B h as C an d D
as p o s s i b l e s u c c e s s o r s , C has on ly D , D has E , an d E h a s
n o po s s ib l e s uc ce s s ors .
Th e l o c a t i on of a s ymb o l B i n a p r o du c t i on w i l l b e
i n d i c a te d b y an o r de r e d t ri p l e
wh e re A i s th e n on te rm i n a l s ymb o l i n wh o s e p ro d u c t i on B
is th e j t h e l eme n t o f th e k th a l t e rn a t i ve . F o r e x amp l e ,
i n the p r od u c t i o n
A x y B C D z
th e l o c at i on o f C i s i n d i c at e d b y th e t r i p l e
Of c ou r s e an e l e me n t may o c c u r mo re th an on ce on th e r i g h t
s i de O f th e s ame p ro du c t i on .
I n th e S ET L p r og r am s b e l ow , th e g r amma r is s t o re d i n
in ve r s e f o rm i n an a r r ay c a l l e d re f . Th e e l eme n t re f ( s ymb o l )
is a se t of en trie s , on e f o r e a ch o c c u rr e n ce o f th e s ymb o l
o n th e r i gh t s i d e o f a p r odu c t i on . E a ch e n t ry c on t a i n s , in
a dd i t i on to the l o c a t i on O f th e o c c u r re n c e , f l ag s
_
77
i n d i c a t i n g wh e the r Or n ot th e s ymb o l i s p o s s i b l y i n i t i a l ,
ne c e s s a ri ly in i ti al , an d p os s i b l y t e rm i n a l i n th a t o c c u r re n ce .
p o s s i b l e s u c ce s s o rs ; th i s i s u s e d i n c on s t ru c t i on o f th e
c an d i d a t e s l i s t s . I n p a r t i cu l a r , th e f o l l ow i n g f un c ti on s
e x t ra c t i n fo rm a t i on f r om th e e n t r i e s :
e ta ( e n t ry ) th e A o f th e l o c a t i on t r i p l e ab ove .
k3 y ( n £y ) th e k O f the l o c a t i on t ri p l e ab ove .
the j O f th e l o c a t i on t ri p l e ab ove .
f o th e rw i s e .
t i f th e s y mb o l is ne ce s s ari ly
init i al , f o th e rw i s e .
f o th e rw i s e .
s u c c e s s o r s i n th at o cc u r re n c e .
j a y l ( e n t £y ) th e n umb e r o f e l e me n t s to the l e f t o f
th e s ymb o l up t o an d i n c l u d i n g th e f i rs t
n on op ti on a l e le me n t .
I n th e a l g o ri thm o f th i s s e c t i on , i n c omp l e t e s p an s a re
f orme d a s a c omp u t a t i on a l a i d , b u t n o me rg i n g t ak e s p l a c e
i n th e mi d d l e O f a s t ring . I n c omp l e t e s p an s wh i ch a re
i de n t i c a l e x c ep t th a t th e i r de s c e n d an t s p an s d i f f e r are
l i s te d a s d i f fe re n t i n c omp l e te S p an s . A l th ough c on c a t en a ti on
-
78
s p an s a re p l a c e d on s t a c k . E ve ry s p an on s t a c k i s ad d e d
to CS
p an s i f i t i s n o t a l re ady th e re ; oth e rw i s e th e
d i vi s i on s l i s t o f th e s p an a l re ady th e re i s au gme n te d . If
th e S p an i s n ew , th e n f o r e a ch o f th e o c cur re n ce s O f i ts
s ymb o l i n a p o s s i b ly i n i t i a l p os i t i on i n a s t r i n g , an
i n comp l e te S p an is f orme d , an d f o r e ve ry o c c u r re n ce wh i c h
i s n ot n e ce s s a r i ly i n i t i a l , a l l p os s ib l e c on c at e n a t i on s
n ew i n c omp l e te s p an s a re g e n e r a te d . Fo r e ve ry i n c omp l e te
s p an wh i ch h a s m a tch e d a l l b u t th e O p t i on a l e l e me n t s O f
a p rod u c t i on , a c o mp l te s p an i s ge ne r at e d an d p l a ce d on
s t a ck .
s e n te n c e is an sn
-
t up l e re p re s e n ti n g th e sn wo rd s O f
th e s en te n c e to be p a r s e d . E a ch w o rd i s a s e t o f c a t e go r i e s .
kgy , an d 12 y o f a g r amm a r e n t ry a re e xp l ai n e d i n th e
p re v i o u s s e c t i on . A c omp l e t e S p an i s a tripl e wh e re
p , th e i n i ti a l p oi n t o f th e s p an ,
( c s p an )
'
e ta I
I
th e s p an s s ymb o l ,
an d gu e ( c s p an ) q , th e e n d p o i n t o f the s p an .
An i n comp l e te s p a n i s a t r i p l e wh e re p e e an d
gu e a re as ab ove ,
( i s p an ) th e s p an s s ymb o l
'
e ta A , ,
an d k a y ( i s p an ) k , an d j ay ( i S pan) j , i n d i c a te d u n: the
f i r s t j s ymb o l s i n th e k th a l te rn a t i ve o f A h ave be e n
m a tc h e d .
-
80
Th e de v i c e O f th e c an d i d a t e s l i s t s i s ac t i v a t e d b y th e
sw i t ch c a nd sw i t ch . Th e F - re l a ti on s h i p i s g i ve n by th e
f un c t i on
fi rs t ( s ymb o l ) th e s e t o f a l l s y mb o l s wh i ch can ap pe a r
l e f tm os t on a t re e d e p e n d i n g f r om s ymb o l .
Th e s e t s ,
c a nd l i s t (k) th e se t o f a l l s ymb o l s wh i ch c an s p an a
s ub s t r i n g o f t he i np u t s t r i n g b e g i n n i n g
a t th e ( k +l ) S t w o rd ,
a re au gme n te d e a ch t i me an i n c o mp l t e s p an is fo rme d . B e f o re
a c omp l e t e s p an i s g e n e r at e d , A is ch e ck e d a g a i n s t
c an d l i s t (p) .
de f i n e n on m e r g e p a r s e ;
/ th e f o l l ow i n g v a r i ab l e s
*
, s et s an d f un c t i on s a re as s ume d
j ay l, p os i n i tf lg , n e c i n i t f lg , p o s te r f l g , p os s uc , pee ,
q ue , c a n ds wi t c h , fi r s t
if c and sw i tc h th e n c a nd l i s t ( O) f i rs t ( ro o t ) ;
(l Vi sn ) word s e n te n c e (i) ;
/ S t a ck up a l l me an i n g s
*
O f t h e i th w o rd
( Vc a t 6 wo r d ) if n c and sw i t ch or cat 6 c an d l i s t ( i —l
) th en
s t a ck s t a ck w i th (<i is x) ;
en d V e at ;
/ f o r e ve ry s p an on th e s t a ck
*
, s ee i f i t ha s been
ge n e r a te d a l r e ady
-
8l
( Vc s p a n E s t a ck d oi n g s t a c k= s t a ck l e s s c s p an ; )
if f ( csp ) eg f ( c s p a n ) )
/ if so
*
, mo d i fy th e d i v i s i on s l i s t of th e e x i s t i n g S p an
th e n cd ivl i s ( c s p an ) ;
i f n ot , ad d th e n ew S p an to c s p ans
el se CS p a ns c s p a ns w i th c s p an ;
( Vo c c E
*
/ fo r e ve ry p os s i b ly i n i t i a l o c c u r re n c e o f th e s ymb o l
if p o s i ni t f l g ( o c c ) th en i f n c a n d s wi t ch or e ta ( occ ) e
th e n
if ne c i n i t f l g ( occ ) th e n c on ti n ue Vo c c ;
*
/ f o r e ve ry o c c u r re n c e o f th e s ymb o l i n th e m i d d l e
O f a p ro d u c ti on , s e a r ch f o r a ma t ch i n g i n c omp l e te s p an / *
is e t) gg e ta (iS p ) ap g( k a y ( o c c ) i s k )
-
pg k a y ( isp ) an d (j ay ( occ ) is j ) j ay l ( o c c ) 1e j ay ( i s p )
an d j a y ( i s p ) lg j - l an d pee ( c sp an ) eg q ue (iS p ) )
end V i s p ; en d V o c o ; ;
e n d Vc s p a n ; e n d V i ; e nd n o n me r g e p a r s e ;
ma c ro
i s p ans i s p an s w i th i s p an ;
i d i vl i s ( i S p a n ) div ;
[ c on t i n ue d ]
_ 82
i f app rop r i a t e , f o rm a c omp l e te s p an f r om th e i n c omp l e t e
s p an
if p o s te r f l g ( o cc ) th e n s t a ck s t ac k w i th
e ta ( i s p an ) , q ue ( i s p an ) > is x) ;
if c a nd s w i t ch th en c a nd l i s t (i ) c an d l i s t (i)
e nd m ;
I n th e me r g i n g a l go r i thm , a s p an i s th e t r i p l e
l i k e th e i n c omp l e t e s p an of t h e p re v i o u s
a l go r i t hm . I f j i s th e l e n g th O f th e kt h p o s s i b l e e xp an s i on
of A , i . e . i f th e s t r i n g h as b e e n c omp l e te l y m a t ch e d , k an d j
a re g i ve n the v a l ue s 0 , an d th e s p an i s p l a ce d on s tack as
s oon as i t i s g e n e ra t e d . Th e s p an s w i th k j 0 c o r re s po n d
to t h e c omp l e te s p an s o f th e p r e v i o u s a l go r i thm , th e o th e r s
t o th e i n c omp l e t e s p an s . I f a s p an re p re s e n ts th e ma t ch i n g
o f a l l b u t O p t i on a l e l e me n t s i n a s t r i ng , i t c ou l d b e u s ed
a s a c omp l e t e s p an an d p l a c e d on th e s t a ck o r i t c o u l d b e
op t i on a l e l e me n t s . Th e re f o r e s u ch a s p an c au s e s an o th e r s p an
to b e ge n e r a te d w i th k j 0 an d th e g i ve n s p an as i ts
i mme d i a t e de s ce n d an t . A s p an f o rme d b y th e
c on c a ten a t i on of th e S p an s an d
ha s i n i t s d i v i s i on s l i s t th e o rd e re d p a i r
-
83
T h u s e a ch n o de h a s a t
mo s t two i mme d i a te d e s c e n d an t s .
The s p an s a re s to re d i n th e s e t s p an T he i r d i vi s i on s
l i s t s a re re tu rn e d as th e v a l ue s O f th e fun c ti on di vli s .
O t h e rw i s e th e s e t s an d fun c t i on s o f t h i s a l go r i thm a re th e
s ame a s i n th e p r e vi o u s a l go r i thm .
de f i ne me r g e p a r s e ;
e ta , roo t, ka y , j a y, j a y l, p o s i n i tf lg , n e c i n i tf lg ,
p o s t e r f lg , pos s uc , pee, q ue , c a n d s wi tc h, fi r s t
if c an d s w i t ch the n c an d li s t ( O) f i rs t ( roo t ) ;
(l Vi sn ) w o rd s e n te n c e (i) ;
s ta c k up a l l me an i n g s of th e i th wo r d
( Vc a tE w o r d ) if n c a n d s wi t ch or c a te c an d li s t ( i - l ) the n
s t a c k= s t a c k w i th (< i is x) ;
d i vl i s (x ) n 1; end V o at ;
f or a l l s p an s on s t ack an d a l l o c c u r re n ce s o f s ymb o l
i n g r amm a r
( Vs p a n e s t a ck do i n g s t a ck s t a ck l e s s S p an ; )
( Vo c c E
f o r e ve ry p o s s i b l y i n i t i a l o c c u r re n ce of th e s ymb o l i n
th e g r amm a r , g e n e ra te a n ew s p an
if p o s i ni t f l g ( o c c )
th en i f n c a nd swi t ch or
th en p os s uc ( o cc ) gg nl th e n
else
_
8 4_
d i vl i s ( ne w s p ) ad d S p a n ( ne w s p ) ; t e rmh a n d l ; ;
if ne c i n i t f l g ( oc c ) th e n c on t i n u e
f or e ve ry o c c u r r e n c e o f a s ymb o l i n th e mi dd l e o f a
p r od u c t i on , s e a r ch f o r a m at ch i n g S p an
is e t) pg e ta ( sp ) an d ( k a y ( o c c ) is k)
pg k a y ( s p )
-
an d ( j ay ( o c c ) is j ) j ayl ( o c c ) le j ay ( s p ) an d
j ay ( p)
s 1e j -
l pp g p e e ( s p a n ) pg que ( sp ) )
n ew s p p os s uc ( occ ) pg nl th en else
d i vl i s ( new s p ) a d d s p an ( new s p ) ; t e r mh a n d l ;
e n d Vs p ; e n d V o c o ; ; en d Vs p a n ; en d V i ; end me r ge p a r s e ;
ma c r o t e rmh a n d l ;
i f ( k a y ( ne w s p ) pg 0 an d j a y ( n e w s p ) pg 0) the n
s t ack s t ac k w i th n ew s p ; ;
i f th e n ew s p an is p o s s i b ly te rm i n a l b u t n ot ne c e s s a r i ly
t e rmi n a l ge n e r a te a n e ce s s a r i l y te rmi n a l s p an an d
s tack i t
if p o s te r f l g ( o c c ) an d p os s uc (o cc ) ne n1
the n nu S p
d i vli s ( nu s p ) a d d s p an ( nu S p ) ;
s t a ck s t a c k w i th nu S p ; ;
a u gme n t th e c an d i d a te s l i s t
e ndm ;
-
85
ma c r o a d d s p an ( S pn) :
see i f s p an ha s b e e n g e n e r a te d a l re a dy
if f ( spa ) pg f ( s p n ) )
if so , mo di fy t h e d i v i s i on s l i s t of th e e x i s t i n g 5
i f not , add th e n ew s p an to s p an s
e l s e S p an s s p an s spn ; ;
e ndm ;
86
w i th ou t c an d i d a te s l i s t s . Th us f o u r di f f e re n t te s ts we re
run on th e s e t o f s e n te n c e s . A l l O f th e s e n te n c e s p a rs e d ,
w i th ou t ove r f l ow d i f f i c u l t i e s , w i th the me rg i n g a l g o r i t hm
b o th w i th an d w i th o u t c an d i d at e s l i s ts . W i th t h e n o nm e r g
i n g a l g o r i t hm a l l s e n te n c e s o f s e ve n o r f ew e r w o rd s p a r s e d
b o th w i th a nd w i th ou t c an d i d a t e s l i s t s . O f th e 2 0 e i gh t- wo rd
s e n te n ce s , al l p ar s e d w i th c an d i d at e s l i s t s , 18 p ars ed
-
wi tho u t . Of th e 20 n i n e wo r d s e n te n c e s , l l p a rs e d w i th
c an d i da te s l i s t s , an d on l y 6 w i th o u t .
AS an i n d i c a t i on o f th e d i f f i c u l t i e s th at a r i s e , we
mi gh t l oo k b r i e f l y at th e p a rs e s f o un d fo r t h e s i mp l e s t tw o
w o rd s e n te n ce
I n ad d i t i on to f i n di n g th e c o rre c t p a r s e , th e p a r s e r a l s o
O f th e l e f t ad j un c t o f an oth e r n oun wh i ch i s de l e te d ( o r
I t i s a s i f we s h o r te n e d th e n o un ph ra s e
" " " "
h o us e b o a t to h ou s e j us t as we mi gh t s h o r te n th e n o un
" " " " " "
ph r a s e th e b e s t b o a t to th e b e s t , b o at b e i n g un de rs to od .
O f c ou r s e th e re i s a re s t r i c t i on i n th e f u l l g r amma r wh i ch
p re ve n t s th i s s o r t o f th i n g f rom h ap p e n i n g . I n l on ge r
s e n te n c e s , th e amo un t O f s u ch h i gh l y s p u r i o u s amb i g u i t y
mu l t i p l i e s d r a s t i c a l l y .
M o re ove r , th e e xp l o d in g s p a c e re q ui re me n ts a re
un s u rp r i s i n g whe n on e c on s i de rs th a t w e a re t ak i n g a g r amm a r
wh i c h i n d i c at e s the f u l l b ro a d r an g e o f E n g l i s h c on s t ru c t i on s
- 88
an d s t r i p p i n g i t O f a l l th e con s t r a i n t s wh i ch l i mi t th e
n o n te rm i n a l s ymb o l s r e s t s on a b as e o f on l y ab ou t 20
te rmi n a l s ymb o l s , so th e b a l l o on i n g o f p o s s ib l e i n t e rp re t a
ti on s i n th e mi d d le o f th e s p an co l l e c ti on i s to b e e xp e c te d .
Re s u l t s f o r th e Me r g i n g A l go ri thm : F r om S e c t i on
w e kn ow th a t fo r th e me rg i n g a l g o r i thm th e th e o re t i c a l b o un d
on th e n umb e r o f s p an s i s a whe re K N , N th e
i s t re a t e d as a b i n a ry g r amm a r b y th e a l g o ri thm , th e re a re
a l te rn a t i ve s i n th e g r amma r . T re at e d as b i n a ry , th e
th e r a te o f g r ow th an d i f s o wh a t th e v a l ue o f K
'
is . T ime
3
re q u i re me n t s th e o re t i c a l l y g r ow a s n , an d we wo u l d l i k e t o
k n ow i f th i s i s b ou rn e o ut i n th e te s t s . H e re w e a re n o t
i n t e re s te d i n th e l e ad i n g c on s t an t s i n ce i t i s d e pe n d e n t
on th e ma c h i n e an d va g a ri e s O f th e p r og r amm i n g .
T h e fo l l ow i n g t ab l e , wh i ch re p re s e n t s th e ave ra ge s o ve r
a l l n i ne - w o r d s e n te n c e s , sh o u l d g i ve s ome i de a O f th e ty p i c a l
- 89
ra t e s o f g row th :
W O RD :
l 2 3 4 5 6 7 8
N umb e r o f S p an s : w i t h o u t C an d i d a te s L i s t s :
w i th C an d i d at e s L i s t s :
N um b e r o f D i v i s i on s Lis ts : w i th o u t C an d i d a te s L i s t s :
w i th C an d i d at e s L i s t s :
T i me R eq ui re me n t s : w i th o u t C an d i d a te s L i s t s :
w i t h C an d i d a t e s L i s t s :
L e a s t s q u a re s an a l y s i s w a s d on e on th e s e re s u l t s . On th e
2
W i th C an d i d a t e s Lis ts : n
Th i s s u gg e s t s th at w i th o u t c an d i d a te s l i s t s , ab ou t 22% of
th e th e o re t i c a l l y p o s s i b l e S p an s a re a c t u a l l y g e n e r a te d .
W i t h c an d i d a t e s l i s t s , on l y ab o u t Wh i l e n i n e va l ue s
a re to o few fo r ad e q u a t e re g re s s i o n an a l y s i s , th e re a re
s e ve r al i n d i c a t i on s th at t h e g r ow th i s i n f a c t q u a d r a t i c .
O f p arti cul a r in te res t i s th e c omp a r a t i ve b e h avi o r
r ati o o f the n um b e r O f s p an s ge ne r a te d w i th c an d i d a te s
l i s t s t o th e n umb e r ge n e r a te d w i t h o u t a re as f o l low s :
Wo r d : 1 2 3 4 5 6 7 8 9
(3)
Ra t i o : . 4 70 455 . 458 . 4 73 . 496 . 523 5 46 . 567 . 587
T h e r a ti o s O f th e n umb e r O f d i vi s i on s l i s t s ge n e r a t e d w i t h
c an d i d a te s l i s t t o the n umb e r w i th ou t a re as f o l l ow s :
Wo r d : 1 2 3 4 5 6 7 8 9
I n b o th l i s ts we n o t e a di p n e ar th e b e g i n n i n g , i n di c a t i n g
the f a i r l y s t r on g c on s t r a i n t s th e f i r s t f ew w o rds o f a
s e n te n ce i mp o s e on the p os s i b l e i n te rp re t a t i o n s . To o m any
s p an s a re g en e r at e d how e ve r , re s u l t i ng i n a ve ry g r ad u a l
l o s s i n e f f e c t i ve n e s s i n th e de v i c e o f c an d i da t e s l i s t s .
Th e c o rr e s p on d i n g ra ti o s f o r t im e re q ui re me n ts a re
Wo r d : 1 2 3 4 5 6 7 8 9
H e re we n o t i c e a s i mi l a r d i p a t f i r s t f o l l ow e d by a g ra du a l
ri s e . Th a t th e p e r c e n t a ge s h e re ar e h i gh e r re f l e c t s th e
ove rh e a d i n u s i n g c an d i d a te s l i s t s , an d th e p a r ti c u l a r l y
h i gh r a ti o fo r the f i r s t w o rd re f l e c ts th e co s t o f
i n i t i al i z at i on .
It is t r a d i t i on a l to p re s e n t f i g ur e s on th e n umb e r
-9 2
O f p a r s e s p r od u c e d for th e s e n te n c e s , b u t h e re th a t i s n o t
te rrib l y pe r t in en t . Th e n umb e r o f p a r s e s n e c e s s a r i l y g r ow s
e xp one n t i a l l y , but to s ay th i s i s to s ay n o th i n g ab o u t th e
a l go r i t hm , wh i c h l o c a l i z e s th e amb i g u i ty .
I t i s o f g re a t e r i n t e r e s t to n o t e h ow m an y O f th e s p an s
a re re l e v an t , i . e . t ak e p a r t i n a f i n a l p a r s e o f th e
s e n te n ce . T h i s c an b e de te rmi n e d s i mp l y by f o l l ow i n g th e
d i v i s i on s l i s t s d own th e l i s t of s p an s f rom a r o o t n o de
s p an n i n g t h e e n t i re s e n te n c e . Th i s i s o f pa rt i cu l ar i n te re s t
s i n c e w e h ave n o th e o re t i c a l b o un ds to g u i de o u r i n t u i t i on .
2
D oe s the n umb e r of re l e v an t s p an s k e e p p a c e w i th th e n r ate
O f g r ow th O f th e n umb e r of a l l s p an s , o r d o e s th e e a r l i e r
p a r t o f a s e n te n c e i mp os e e n ou gh con s t r a i n t s on th e p o s s i b l e
i n te rp r e t at i o n s O f l a t e r p a r t s t o S l ow th i s r at e d own
s i gn i f i c an t l y , or a re e n ou gh s p an s ge n e r a t e d i n th e e a r l y
p a r t s o f a s e n te n c e t o p e rm i t a l mo s t an y t h i n g to b e re l e v an t
i n th e l a t te r p a r t s , t hu s S p e e d i n g up the r a te o f g r ow th
o f re l e v an t S p an s ?
s e n te n ce s we re
Wo r d : 1 2 3 4 5 6 7 8 9
Of c ou r s e th e n u mb e r O f re l e v an t s p an s i s th e s ame for
th e a l g o r i t hm w i t h an d w i th o u t c an d i d a te s l i s t s . I t wo u l d
b e d i s t u rb i n g i n d e e d i f th e c an d i d a te s l i s t s w e re to
e l i mi n a te v a l i d p a r s e s .
-
93
T h e q u a d r a t i c l e a s t S q ua re s ap p ro x i ma t i on h a s a le a d i n g
2
te rm O f n . S i n c e th e c ub i c ap p r o x i mat i on h a s a
n e g a t i ve l e ad i n g t e rm , i t s e em s l i k e l y th a t th e g r ow th is
mo re n e a r l y q u a d r a t i c .
A l s o o f i n t e re s t i s th e r a t i o o f th e n umb e r of re l e v an t
s p an s to th e t o t a l n umb e r O f S p an s , b o t h w i t h an d w i th o u t
c an d i d a te s l i s t s .
W or d : 1 2 3 4 5 6 7 8 9
W i th o u t Ca n d i d a te s u Li s ts :
W i th C an d i d a t e s Li s ts :
W i tho u t c an d i d a t e s l i s t s , a l i t t l e o ve r 30% o f th e S p an s
ge n e r a te d t u rn o u t to b e re l e v an t . W i th c an d i d a t e s l i s ts ,
s h a rp d r op n e a r th e e n d o f th e s e n te n c e , r e f l e c ti n g the
de g r a d a t i on i n e f fe c t i ve n e s s O f c an d i d a te s l i s t s S h own i n
th e f i gu r e s o f T he re i t i s s e e n th a t c an d i d at e s l i s t s
to H e re i t i s s e e n th at th e n umb e r of n on — r e l e v an t
s p an s a re ge n e r a l l y re d u c e d b y b e twe e n 70% an d an d
e ve n a f te r n i n e w or ds , th e n umb e r o f n on - re l e van t S p an s
i s re d u c e d by n e a r l y
Re s u l t s fo r th e N on - Me r g i n g A l go r i thm : F o r the n on
me r g i n g a l g o r i th m w e h a ve nO s u ch c l e an th e o re t i c a l re s u l t s
_
94
T h e g row th i n th e n umb e r o f c omp l e t e s p an s i s th e o re t i
c a l l y q u ad r a t i c . Le a s t s q u a re s an a l y s i s g i ve s th e f o l l ow i ng
l e ad i n g c o e f f i c i e n t s :
2
W i th ou t C a n d i d a t e s Li s ts : n
2
W i th C an d i d a te s Li s ts : n
A g a i n th e c ub i c ap p rox i m at i on g i ve s an a s ymp t ot i c a l l y g re at e r
r a te o f g row th for th e c an d i d a te s l i s t s th a n fo r th e no n
c a nd i d a te s l i s t s ( l e a d i n g c oe f f i c i e n t s o f . 497 an d . 34 4
re s p e c t i ve l y ) ; th i s i n d i c at e s th a t th e r a te O f g row t h i s i n
f a c t q u ad r a t i c .
Th e l e a d i n g c oe f f i c i e n t s o f th e c ub i c an d q u a r t i c a p p ro x i
m a t i on s fo r n umb e r o f d i vi s i on s l i s t s an d t i me re q u i reme n t s
b o th w i th ou t and w i th c an d i d at e s l i s t s a r e a s fo l l ow s :
N umb e r o f D i vi s i on s Li s ts : C ub i c Q u a r ti c
W i th ou t C an d i d a t e s Lis ts :
W i t h C an d i d a te s Li s ts :
T i me R e qu i re me n t s :
W i th o u t C an d i d a te s Li s ts : . 067 00 79
T e s t s w e re ma d e o f an e xpon e n t i a l g r ow th hy p oth e s i s as we l l ,
w i t h s im i l a r l y i n c on c l u s i ve re s u l t s . T h e on l y con c l u s i on to
b e d rawn i s th at th e a l go r i thm is so d i s a s t r ou s l y b ad th a t
ab ou t h ow b ad i t i s .
-
9 6_
T he f ol l ow i n g r a t i o s i n di c a te th e c omp a r a t i ve p e r f o rm
an c e o f th e n o n me r g i n g a l g o r i thm w i th o u t an d w i th c an d i d a t e s
lists :
Wo r d : 1 2 3 4 5 6 7 8
R a t i o o f N u mb e r O f C omp l e t e S p an s W i th t o W i th o u t
C and i d ate s Li s ts :
R a t i o o f N umb e r o f D i v i s i on s Li s ts W i th to W i tho u t
C an d i d a t e s Li s ts :
R a t i o o f T i me R e q u i reme n t s W i th t o W i th o u t C an d i d a t e s L i s ts :
AS w i th t h e me r g i n g a l g o r i thm , th e r e i s a de g r ad a t i on i n
th e e f f e c t i ve n e s s O f th e de vi c e o f c an d i d a te s l i s t s w i th
l on ge r s e n te n c e s , a l t h o u gh tfiflj s de g ra d a t i on i s s omewh a t mo re
p r on oun ce d i n th e n o nme r g i n g c as e . A t f i r s t th e r a t i o of
t i me re q u i r e me n t s imp ro ve s s ome wh a t as th e p a r s i n g p ro ce s s o r
re c ove r s f r om t h e i n i t i a l i z at i on c os t s o f c an d i d a t e s l i s t s ,
b u t t h e re a f te r de g r a d a t i on a l s o s e ts i n .
s p an s i s i n d i c a t e d b y th e a ve r a g e s fo r e i gh t wo rd s e n te n ce s :
Wo r d : 1 2 3 4 5 6 7 8
T he q ua d r a t i c le a s t s q u a re s ap p r o x i m a t i on o f th i s ha s a
2
l e ad i n g t e rm O f n
-
97
The r a t i o s o f th e n umb e r o f re l e van t s p an s to th e
to t a l n umb e r o f s p an s g e n e r a te d a re
W o rd : 1 2 3 4 5 6 7 8
W i t h ou t C an d i d a te s Li s ts :
W i th C an d i d a te s Li s ts :
T h e s e f i g u re s a re s l i gh t l y b e t t e r th a n w i th th e me rg i n g
'
a l g o r i thm , a l th o u gh th i s c e r t ai n l y d oe s n t m ak e up f o r
'
th e me rg i n g a l g o r i thm s a d van t age s i n oth e r re g a rd s . H e re
a l s o th e re i s a p e r ce p t i b l e de c l i n e i n th e e f fe c t i ven e s s
o f c an d i d a te s l i s t s fo r l on ge r s e n te n ce s .
B e c au s e O f th e i r d i f f e r e n t d a t a s t r u c t u r e s , th e on l y
d i re c t c omp a r i s on th at c an b e ma de o f th e me r g i n g an d
n o n me r g i n g a l go ri thms is o n the b a s i s o f t i me . Th e f o l l ow
i n g a re th e r a t i o s o f t ime re q ui re me n t s o f th e n o nme r g i n g
a l go r i th m to th e me r g i n g a l go ri thm :
W o rd : 1 2 3 4 5 6 7 8
W i th o u t C an d i d a te s Li s ts :
1 141
W i th C an d i d a te s Lis ts :
I n o th e r w o rd s , th e n o n me r g i n g a l g o r i thm w i th c an d i d a te s
l i s t s re q u i re s ab o ut 70% mo re t ime th an th e me r g i n g
a l go r i th m f o r e i gh t w o r d s e n te n ce s an d i t s re l a ti ve p e r f o rm
an ce on l y b e c ome s wo r s e fo r l on ge r s e n t e n c e s .
_
9 8_
CHAP T E R 5 . A ME T AL AN GU A GE FO R E XP RE S S I N G
GRAMMA T I CA L RE S T R I C T I ON S .
I n t r odu c t i on an d T e rmi n o l o gy .
Th e i mp r a c t i c a l i ty o f n o d a l S p an s p a r s i n g i n th e ab s e n c e
o f re s t r i c ti on s i s c on v i n c i n g ly demon s t r a te d i n C h ap te r 4 .
Th e p r ob l e m o f a c h i e v i n g n od a l s p an s pa rs i n g is th e r e f o re
the p rob l e m O f e xp re s s i n g th e re s t r i c t i on s i n a f o rm
t i on s mu s t b e e xp re s s e d i n s u ch a w ay th at th e y ac t s t r i c t l y
l oc a l l y . B e c a us e d i f f e re n t i n t e rp re t a t i on s O f an amb i g uo u s
p o r t i on o f a s e n te n c e may b e me rg e d un de r o ne S p an , it is
n ot p o s s i b l e to t r ave r s e th e p a r s e t re e e a s i l y as i t is in
mu s t b e an t i c i p a te d an d m ad e re a d i l y a va i l ab l e at th e p o i n t
at wh i c h the re s t r i ct i on i s app l i e d . C h ap t e r 5 de s c r i b e s
an d de f i ne s a l an g u a g e d e ve l op e d for th i s p u rp o s e . C h ap te r 6
an d A pp e n d i x B i l l u s t r a te i ts us e i n e xp re s s i n g the
re s t r i c ti on s o f the S a ge r g ramm a r .
W e w i l l a s s ume th e p a r s e r us e s th e me r g i n g f o rm o f th e
n od a l s p an s a l g o r i thm g i ve n i n S e c ti on Th at i s to s ay ,
th a t w i l l b e u s e f u l i n d i s cu s s i n g th e O p e r a t i on o f th e
a l g o ri th m i s b e s t de f i n e d by me an s o f an e x amp l e . S uppo s e
we h ave th e p r od u c ti on
-
10 0
B + D E F G
S up p o s e th a t th e s ymb o l D de r i ve s a s ub s t r i n g o f th e i n p u t
s t ri n g . A S p an w i l l b e g e n e r a te d i n d i c at i n g th i s f a c t ;
th i s s p an w i l l b e c a l l e d a S p an fo r D . S u p p o s e th a t th e
s ymb o l E d e r i ve s a s u c c e s s i ve s ub s t r i n g o f th e i n p u t s t r i n g .
T h e a l g o r i th m s e e i n g th e s p an fo r D an d th e s p an fo r E wi l l
g e n e r a t e a n ew s p an i n d i c a t i n g th a t th e f i rs t tw o s ymb o l s i n
th e p r od uc t i on for B h a ve b e e n re c o gn i z e d . T h e s p an f o r D
w i l l b e c a l l e d th e f i r s t S p an , th e s p a n for E th e s e c on d s p an ,
an d th e n ew s p an th at i s f o rme d t h e n ew s p an . I t wi l l b e
s a i d th a t th e f i rs t s p an an d th e s e c on d S p an h ave b e e n
c on c a te n a te d to f o rm the n ew s p an , an d th a t th e f i rs t two
s y mb o l s i n the p r od u c t i on fo r B h av e b e e n m a t ch e d . I f th e
f i r s t k s ymb o l s i n a p r od u c t i on f o r B h ave b e e n ma t ch e d , th e
s p an ge n e r a te d w i l l b e c a l l e d a s p an f o r B . T h u s th e S p an s
k
f or D an d E h a ve b e e n con c a te n a te d t o f o rm a s p an fo r B .
Now s up po s e we h a ve th e p ro d u c t i on
A B C
an d s u p p os e th e s ymb o l s B an d C d e r i ve th e s ame s ub s t r i n g . Th e
a l g o r i th m on s e e i n g th e s p an f or B ge n e r a t e s a s p an fo r A
an d on s e e i n g the S p an fo r C a dd s to th e d i v i s i on s l i s t o f
th e s p an f o r A . I n th i s c a s e i t w i l l b e s a i d th a t th e S p an s
f o r B an d C h a v e b e e n me r ge d un de r th e S p an fo r A .
W e a s s ume i n th e re ma i n de r o f th i s w o rk th at th e g r amma r
i s a va i l ab l e t o th e p a r s e r i n th e i n ve r s e f o rm d e s c r i b e d i n
-
101
i s a s e t o f en t ri e s , on e for e a ch o c c u r r e n ce of th e s ymb o l
on th e r i gh t s i de O f a p ro du c ti on . E a ch e n t ry c on t a i n s th e
l o c at i on t r i p l e O f th e oc c u r re n c e , f l ag s i n d i c at i n g
wh e th e r the s ymb o l i s p o s s i b l y i n i t i a l , n e ce s s a r i l y i n i t i a l ,
an d p o s s i b l y te rm i n a l i n th a t o c c u r re n c e , an d a l i s t o f th e
'
s ymb o l s p o s s i b l e s u c ce s s o r s . I n add i ti on , e a ch e n t ry
i n c l u de s t he e n t i re s e t o f r e s t r i c t i on s a c t i n g at th a t p o i n t ,
i . e . the re s t ri c t i on s wh i ch mu s t b e app l i e d b e fo re a n ew s p an
d i c t a t e d b y th a t e n t ry i n th e g r amma r i s fo rme d . T he
a l go ri th m O f S e c ti on is mod i f i e d i n th a t an e x i t i s m ade
b e f o re a n ew S p an i s f o rme d t o ch e ck th e re s t r i c t i on s
app l y i n g a t th a t p o i n t .
I t w i l l b e re c a l l e d f rom S e c t i on th at w o rd s a re
l i s t e d i n th e d i c t i o n a ry a s t re e s t ru c t u re s . Th e e n t ry for
" "
f a ce s , fo r e x amp l e , i s a s i n F i gu re 1 . We w i l l re fe r t o
" "
th i s a s th e d i c t i on a r y e n t r y fo r th e wo r d f ace s . The roo t
n ode o f th e d i c t i on a ry e n t ry w i l l b e c a l l e d i t s l i te ra l .
" "
FAC S
T e n s e d V e rb
S in gu l a r N c o un t l N on hum an OB J L I S T N OTN S U B J
D P l PN N S T GO N T I ME l N S EN T 2
D P VAL P VA L
ll II II ll
F i g u re l
-
102
g r amm a t i c a l re l a t i on s h i p c an b e i n vok e d wh en th e s p an s f o r
th e s e ad j a c en t e l eme n t s a re to b e c on c a te n a te d . Re s t r i c t i on s
" "
u s u a l l y d e p e n d on th e a t t ri b u te s o f th e c o re w o rd s of
ad j ac e n t e l e me n t s . Th e re f o re , i t ou gh t to b e s u f f i c i e n t to
" "
a s s o c i a t e w i th e a ch s p an a l e x i c a l i te m as i t s c o re wo rd
an d e x p re s s re s t r i c t i on s i n te rms O f th e l i t e r a l s , c a te go r i e s
an d at t r ib u t e s o f th e s e l e x i c a l i t e ms .
F o r e x amp l e , i n b o th th e s e n te n ce s
" "
D e s c a r te s th ou gh t .
"
Th e b r i l l i an t D e s c a r te s th o u gh t de e p ly on f un d ame n t a l
"
q ue s t i on s .
wh e n th e s ub j e c t an d th e ve rb ph r as e are to b e c on c a te n a te d
" "
to f o rm an a s s e r t i on , th e c ore w o r d of th e s ub j e c t w i l l b e
" " " "
th e l e x i c a l i t e m f o r D e s c a r te s an d th e c ore wo rd O f th e
ve rb ph r a s e th e l e x i c a l i t e m f o r th e te n s e d ve rb c a te g ory
" " 2
of th o ug h t . Th e s e l e x i c a l i t ems c an b e c omp a re d to s e e
" "
th a t the y h ave c omp a t i b l e a t t r i b u te s , i . e . th a t D e s c a rt e s
i s s ome th i n g tha t c an th i n k . If so , th e re s t r i c ti o n s u c c e e d s
an d th e n ew s p an fo r th e a s s e rt i on i s f o rme d .
U n f o r tun a te l y , th e l i te r a l , c a te g o ry , an d a t t ri b u te s
" "
o f t h e l e x i c a l i t e m de f i n e d a s th e c o re w o rd d o n o t ap pe a r
to s u f f i c e f o r th e e xp re s s i on O f a l l th e re s t r i c t i on s . As
an e x amp l e , c on s i d e r th e f o l l ow i n g tw o s e n t en ce s :
" "
Fo r D e s c a rt e s t o th i n k w as f o r h i m to exi s t .
" "
Fo r D e s c a rt e s to th i n k w a s to e x i s t .
2 " "
T h o ugh t , o f co u r s e , i s a l s o a n oun an d a p a s t P a r t ic i p l e
~
10 4
I n th e f i r s t th e an a l y s i s of th e f i r s t f o u r w o rd s i s
< S UB JE C T >
< F O RT OV O >
" "
For De s c a r t e s t o th i n k
I n th e s e c on d th e an a l y s i s i s
I n a n od a l s p an s p a r s e u s i n g b i n ary me r g i n g , b o th an al y s e s
o th e r mu s t b e re j e c te d .
Two d i f f i c u l t i e s a re s e e n i n th i s e x amp l e . F i rs t
th e me rg i n g o f th e tw o i n te rp re t at i on s o f th e i n i t i a l p a r t
avo i de d or i t w i l l b e n e c e s s a ry l a te r t o re s t r u c t u re th e
s p a n c o l l e c t i on to e l i mi n a t e on e o f th e i n t e rp re t a t i o n s .
S e c on d , wh e n th e re s t r i c t i on is i n vok e d , i n f orm a t i on i s
r e q u i re d wh i c h i s n o t c on t a i n e d i n an y l e x i c a l i t em i n th e
s e n t e n ce , i . e . i n fo rma t i on a s t o wh at k i n d o f s t r i n g i s
tak e n as th e s ub j e c t . B o th d i f f i c ul t i e s c an b e o ve r c ome
" "
by i n c l u d i n g a s p a r t O f th e c o re w o r d a n umb e r of f l ags .
T h e s e f l a g s c an b e s e t a t on e p o i n t i n th e p a r s i n g to s i gn al
-
105
a pa r t i c u l a r s t ru c t u r a l f e a t u re , p a s s e d up to th e l e ve l
at wh i ch th i s i n f orma t i on i s re q u i re d , an d th e n un s e t .
of a l e x i c a l i t em an d a s e t O f f l ag s . W e m ay S p e ak O f th e
l e x i c a l i te m o f a c o re a s th e c o r e l e x i c a l i te m , an d O f
the l i te r a l , c a te go ry or a t tr ib u t e s o f th e c o re l e x i c a l
i t em a s th e l i te r a l , c a t e g ory o r a t t r ib u t e s o f th e c o r e .
Wh e n a f i r s t s p an an d a s e c on d s p an a re c on c a te n a te d to
f o rm a n ew S p an , th e c o re o f th e n ew s p an i s f o rme d a t
th e s ame t i me . T he l e x i c a l i te m o f t h e n ew c o re c an b e
t he l e x i c a l i tem o f th e c o re o f e i th e r th e f i r s t s p a n o r
th e s e c on d s p an . T he i n ve r s e g r amm a r e n t ry wh i c h ge n e r a te s
th e n ew S p a n i n d i c at e s wh e th e r th e c o re l e x i c a l i t e m o f th e
f i r s t s p an or th e s e c on d s p an i s to b e t ak e n a s n ew c o re
l e x i c a l i t em . The set o f f l a g s o f th e n ew c o re i s
c on s t r u c t e d i n a c c or d an c e w i t h e xp l i c i t i n s t ru c t i on s i n th e
re s t r i c t i on s ap p l y i n g a t th a t p o i n t . W he n a f l a g i s ad de d
to th e s e t o f f l a g s o f th e n e w c ore , we say th a t th e f l ag
is set . W h e n i t i s re move d f r om th e s e t O f f l a g s , we s ay
i t i s un s e t . W e s a y a f l a g i s p a s s e d up t o a n ew c ore f rom
th e c o r e o f th e f i r s t or s e c on d s p an wh e n i t i s se t i f an d
on l y i f th e c or e o f th e f i r s t or s e c on d s p an , re s p e c ti ve l y ,
c on t ai n s th a t f l a g . Th e re s t r i c t i on c omp on e n t c on s i s t s o f
i n s t ru c t i on s wh i ch s e t , pas s , an d un s e t f l a g s , an d s t a te
me n t s wh i ch ch e c k th e f l ag s , l i te r a ls , c a t e g o r i e s an d
-
10 6
" "
by a C fo l l ow i n g th a t e l e me n t ) . T h i s e xp l i c i t d e f i n i t i on
is ne c e s s a ry s i n c e th e e le me n t t o b e ch o s en as th e c o re
e l e me n t o f a s t r in g i s d e te rmi n e d b y th e re s t r i c t i on s wh i ch
act on c on s t ru c t i on s i n vo l vi ng th at s t r i n g an d n o de p en da b l e
re g u l a r i t i e s a re ap p a r e n t . T h e f o l l ow i n g g e n e r a l re ma rk s
m ay b e ma de , h ow e ve r : Th e c o re of a s p an f o r a c a t e go ry
s ymb o l is th e l e x i c a l i te m wh i ch g e ne r a t e s th e s p an . I n th e
" "
s i n g l e to n p ro d u c t i on A B th e c o r e l e x i c a l i tem o f th e
s p an fo r B b e c ome s th e c o re l e x i c a l i te m o f th e s p a n f or A .
v a r i a n t f l an k e d by l e f t an d r i gh t ad j un c t s
h av e th e ve rb a s th e c o re e le me n t , a l tho ug h th i s i s s ome
t ime s ove r r i d de n by e xp l i c i t i n s t ru c t i on s i n th e re s t r i c t i on
c omp on e n t , a s e xp l a i n e d i n S e c t i on b e l ow . P re po s i t i on al
ph r a s e s an d othe r c on s t r u c t i on s i n vo lv i n g p re p o s i t i on s
e l eme n t . T h e c o re e l e me n t o f th e l e f t ad j un c t o f th e n oun
i s e xp l a i n e d i n S e c t i on b e l ow . A d j un c t s a re n e ve r t ak e n
as th e co re e l e me n t o f a s t r i n g .
A s an e x amp l e , c on s i d e r t h e s en te n ce
"
Th e b r i l l i an t D e s c a r te s th o ugh t de e p l y
"
on f un dame n t a l q ue s t i on s .
-1
08
" "
T he n oun p h r as e f u n d ame n t a l q ue s t i on s h a s th e n oun
" "
q ue s t i on s a s i t s c o re l e x i c a l i t em . Wh e n i t i s c on c a te n a t e d
" "
w i th on , th e p re po s i t i on b e c ome s th e c o re l e x i c a l i t em o f
" "
th e p r e p os i t i o n a l ph r a s e . The te n s e d ve rb th o u gh t i s th e
"
c o re l e x i c a l i te m o f the s p an fo r <L TVR > s ub s um i n g th o u gh t
" " "
dee p ly an d a l s o O f the e n t i r e ve rb ph r a s e . De s c arte s is
"
th e c o re l e x i c a l i t em of th e n oun ph r a s e Th e b r i l l i an t
"
De s c ar t e s an d wh e n th i s i s c on c a te n a te d w i th th e ve rb p h r as e
" "
th e t en s e d ve rb th o ug h t i s th e c ore l e x i c a l i t em o f th e
e n t i r e a s s e r t i on .
H o u s i n g S p e c i f i c at i on s
T h e re s t r i c t i on s a re i n vok e d up on ap p l i c a t i on O f an
e n t ry i n th e i n ve r s e g r amm a r an d e xe c u t e d b e f o r e th e n ew
S p an i s f o rme d , an d so a re h ou s e d a t th e s e e n t r i e s . Fo r
e x amp l e , a re s t r i c t i on h ou s e d a t D i n th e p ro d u c t i on
A B C D E
i s e x e c u t e d b e f o re a s p an f o r D i s c on c a te n a te d w i th a S p an
for A t o f o rm a S p an f o r A . E a ch r e s t r i c t i on th e re fo re
2 3
b e g i n s w i th a l i s t i n g O f t h e e n t r i e s a t wh i ch i t i s h o u s e d .
Th e b a s i c l i s t i n g i s O f th e f o rm
H O U S E D AT < S YM B O L > :
T h i s me an s th a t th e re s t r i c t i on i s h o u s e d a t th e o c c u r ren c e
g r amm a r , th i s m ay b e i n d i c a te d by th e l i s t i n g
~ 109
H OU S E D AT < S Y MB O L > :
T h e l oc a t i o n t r i p l e s a re s e p a r a te d b y
s emi c o l on s an d th e e n t i r e h o u s i n g s p e c i f i c a t i on e n ds w i th
a c o l on . I f th e re s t r i c t i on i s t o b e app l i e d at s ome
b e c ome s
H O U S E D AT < S Y MB O L 1 > :
< S Y MB O L 2 > :
< S Y MB O L 3 > :
The s p e c i f i c a t i on s o f o c c u r re n c e s f o r e a c h o f th e s ymb o l s
a re s e p a r a te d b y s e mi c o l on s an d th e e n t i re ho u s i n g s pe c i f i c a
t i on e n d s w i th a c o l on .
o c c u r s i n n o mo re th an o ne a l te rn a t i ve O f th e p r od u c t i on
an d th e e l e me n t n umb e r , j , m ay b e omi t te d . Th u s
i s a l s o a v a l i d ho us i n g s pe c i f i c a t i on . F or e x amp l e , th e
h ou s i n g o f a re s t r i c t i on a t D i n th e p r odu c t i on
A B C D E F G
m ay b e i n d i c a te d a s
H OU S E D A T D : A , l , 3 :
or by
H O U S E D AT D : A , 3 :
or by
H O US E D AT D : A:
-
11 0
A B C D E
wh e n c on c a t e n a t i n g a s p an fo r D w i th a s p an for A th e
2
The te rm C O RE 2 i s us e d wh e n a s p an is t o b e m a t ch e d w i th
th e h e ad o f a s t ri n g or w i t h a s i n g l e t on p r od u c t i on . In
s u c h c a s e s we m ay s ay th e re is n o f i rs t s p an an d th e s et of
i n t u i t i ve , b u t a l l ow s f o r re gu l a r i t y i n th e e xp re s s i on of
th e re s t r i c t i on s .
" "
e l t s t r i ng i n th e b a s i c ch e ck i n g s t a te me n t c on s i s ts
o f f l ag s ( l ike T OV O F L G an d F O RT O VO F L G ) , c a te g o r i e s an d
a t t r i b u te s ( l ik e TV or P L URA L or N T I ME l ) , an d l i te r a l s
" "
( l ike IT or j oi n e d by th e l o g i c a l c onn e c ti ve s
AN D , O R an d N O T .
Th e s t a te me n t
C O RE x H AS e l t .
" "
re tu rn s th e v a l ue t rue if C O RE x c on t a i n s th e i n d i c at e d
" "
f l ag , c a te g o ry , a t t r i b u te , or l i te r a l , f al s e oth e rw i s e .
" "
e lt s t g2 . i s i n te rp r e te d a s C ORE x H AS e l t s t g l O R C O RE x HAS
" " " " "
e l ts t . C O RE x HAS NOT e lts t g an d C O RE x HAS N T e l ts tg
"
a re i n te rp re te d a s N OT ( C O RE x HAS
L i s t - a t t r i b u te s l ike OB J L I S T an d N O TN S U B J may b e
t re a t e d a s f un c t i on s t ak i n g c o re s a s a r gume n ts an d y i e l d i n g
f aci l i t a te u s e O f s u ch f un c t i on s , two mo re c he ck i n g s t a te me n t s
-
1 12
a re i n c l u d e d i n th e l an g u a ge s e t - memb e r s h i p an d
e mp ty - i n t e r s e c t i on ch e c k i n g . Th e b a s i c s e t — memb e r s h i p
ch e ck i n g s t a te me n t i s ty p i c a l l y o f th e f orm
e lt ( N ) E L l i s t a t t ri bu te ( C O RE x )
" " "
wh e r e elt is a f l ag , a t t r i b u te , or l i te ra l , an d lis t
"
a t t r i b u te is a l i s t - a t t r i b u te . Th e va l u e o f
i s th e s e t c on t a i n i n g th e i mme d i at e
de s c e n d e n t a t t r i b u t e s , f l ag s , or l i te ra ls O f th e l i s t
" "
at t rib u te . elt EL l i s t a t t r i b u t e ( CO RE x ) r e tu rn s a v a l ue
" "
t u re i f th e f l a g , a t t r i b u te , or l i te r a l i s a me mb e r o f
" " "
th i s s e t , fa l s e o th e rw i s e . e l t NE L l i s t a t t r i b u t e ( C O RE x )
"
( C O RE x ) i s s e ar c h e d for th e l i te r a l o f C oRE l o r C O RE 2
r e s p e c t i ve l y .
T h e e mp ty — i n te r s e c t i o n ch e ck i n g s t a teme n t
t ok s e t l toks e t2 NL .
" "
c omp a re s tw o s e t s o f to k e n s an d re tu rn s true i f t he y h a ve
" "
n o a t t r i b ut e s , f l ag s , or l i te r a l s i n c omm on , fa l s e o th e r
wis e . T h e t ok e n s e t s c an b e as
e x p l a i n e d ab ove , or C oRE l o r C O RE 2 , i n wh i c h c a s e th e
i n c l u d e d t ok e n s a re th e l i te r a l , th e c a t e g o ry , an d th e
top - l e ve l a t t r i b u te s o f th e c o r e le x i c a l i te m .
" "
toks e tl toks e t 2 NL . i s i n t e rp re te d as
"
NO T ( t oks e t l to k s e t 2 A ty p i c a l u s e of th e e mp ty
i n t e r s e c t i on ch e c k i n g s t a teme n t i s th e re s t r i c t i on
~
113
C O RE l N O TN S U B J ( C ORE 2 ) NL .
wh i ch ch e ck s t h e a t t r i b u te s o f th e s ub j e c t f o r on e s wh i ch
c an n ot c o o c cu r w i th th e ve rb .
Bas i c ch e c k i n g s t a te me n t s may b e j oi n e d b y me an s o f
l og i c a l c on n e c t i ve s
IF ch e c k i ng s t a t e me n t l T H EN c he ck i ng s t a t e me n t Z .
c h e c k i ng s t a te me n t l AN D c h e c k i ng s t a te me n t z .
c h e c k i n gs t a t e me n t l OR c he ck i n g s t a t e me n t Z .
N OT c he c k i n gs t a te me n t .
an d n e s t e d by me an s o f p a re n th e s e s
che cks tl AN D ( c h e c k s t Z OR c he ck s t3 )
F o rm i n g th e N ew C o re ; F l a g — S e t t i n g I n s t ru c t i on s .
N o rm a l l y wh e n a n ew s p an i s f o rme d , th e s p an i n he ri t s
a c o re l e x i c a l i te m f r om e i th e r C oRE l or C O RE 2 . T h e e n t ry
l e x i c al i t e m i s t o b e t ak e n a s th e n ew co re l e x i c a l i t em .
I n s o me c i r c ums t an c e s , th e ch o i ce o f c o re e l eme n t d e p e n d s
up on c e r ta i n c on d i ti on s e xp re s s e d b y ch e ck i n g s t a t eme n t s .
Th e n a re s t r i c t i on o f th e f o rm
IF c he ck i n g s t a t e me n t T H E N C O RE H AS AT T R I B U T E S O F CoRE l
E LS E C O RE H AS AT T RI B U T E S OF C O RE 2 .
i s i n vok e d . T h e w o r d C O RE a lw ay s re f e rs to th e co re o f
th e n ew s p an be i n g f o rme d .
F l a g s ma y b e se t i n th e n ew c o re by me an s O f th e
i n s t ru c ti on
-
1 14
f e a tu re , a u toma t i c p a s s i n g a l on g a s t r i n g , i s ad op te d
b e c a u s e a l th o ugh th e p a r s e r ac t s as th o u gh th e g r amm a r we re
b i n a ry , i t s h o u l d n o t b e n e c e s s ary fo r th e re s t r i c ti on w r i t e r
to k e e p th a t i n mi n d .
Th i s a u t om at i c p a s s i n g O f f l a g s may re s u l t i n a f l ag
b e i n g a c t i ve s l i gh t l y l on g e r th an i t is a c tu a l l y n e e de d an d
th u s p r e ve n t i n g me rg in g th at mi gh t o th e rwi s e o c c u r . Th i s
w ou l d h ave n o e f fe c t on th e p a r s e s u l t i mat e ly p ro du ce d ,
an d i t i s n ot e xp e c te d th a t i t w ou l d i n c re a s e s i gn i f i c an t l y
th e n umb e r o f s p an s ge n e r a t e d . I f i t t u rn s o u t to c au s e
d i f f i c u l t i e s on e may i n t ro d uc e a f l a g - un s e t t i n g i ns t r u c
t i on
An i n s t ru c ti on wh i ch i s n o t n e c e s s a ry b u t m ay r e s u l t
i n f ew e r s p an s b e i n g ge n e r a t e d i s
C O RE H AS N T AT T R I B U T E S .
wh i ch e l i m i n a te s re f e re n c e t o th e c o re l e x i c a l i t em , S O th a t
th e co r e c on s i s t s on l y o f a set o f f l ag s . T h i s m ay b e
i n vo k e d at a p o i n t h i gh e n ough i n the S p an c o l l e c t i on th a t
re f e re n ce t o l e x i c a l i te ms i n th e s e n te n ce is no l on ge r
n e e de d to e xe c u te th e re s t r i c t i on s .
F l a g s e t t i n g i n s t r u c t i on s m ay b e ma de co n d i t i on al b y
th e f o rm a t s
IF ch e c k i ng s t a t e me n t TH E N se t t i n g i ns t r l E LS E s e t t i n g i ns t r 2 .
IF c h e c k i ng s t a t e me nt THEN se t t ingi ns t r .
-
116
E n d p o i n t - C he ck i n g S t a t e me n t s ; C omm a R e s t r i c t i on s .
i n ab b r e vi a t i on s ) , an d a re v i ewe d a s e nd m a rk s an d
c o un te d as a w o rd i n th e s e n te n c e . M a te r i a l b e twe e n
p a r e n th e s e s i s i gn o re d , an d th e re a re n o p ro vi s i on s f o r
c o l on s or d a s h e s i n th e g ramma r . Th u s c omm as ar e th e on l y
p un c tu at i on m a rk s wh i ch p l ay a s i gn i f i c an t r o l e i n the
p a r s i n g O f a s e n te n ce . C omma s a re no t c o un t e d as wo r d s b u t
r a th e r a s s i gn e d to i n te r - wo rd p o i n t s . W e s ay a c omm a i s
a s s i gn ed t o th e i t h i n te rw o rd p oi n t i f th e re i s a c omm a
a f t e r th e i t h wo r d i n th e s e n te n c e . Th e c omm a s a re k e p t
i n an a r r ay c a l l e d I N T E R . Th e re th ey c an b e re f e r re d to
i n c omma re s t r i c t i o n s b y me an s o f s t a te me n t s i n v ol v i n g th e
wo rd INTE R , e .
g .
O th e rw i s e the c omm a s a re i gn o re d .
I f o th e r p un c tu a t i on ma rk s a r e e ve r i n c o rpo r a te d i n t o
the g r amm a r th e y c an b e h an d l e d in ga s im i l a r w ay .
" "
An o th e r ope r a t or wh i c h m ay b e c a l l e d i s W O RD , as in
" "
W O RD (i ) s THE
" "
me an i n g th e i th w o r d is n ot TH E .
I n th e c u r re n t i mp l eme n t a t i on th e a rg ume n t i o f b o th
I N T E R an d W O RD m ay t ak e on on l y th e v a l ue s P , P +l , Q , Q +l
P s t an d s for th e i n i t i a l po i n t an d Q the te rm i n a l po i n t o f
th e s e c on d s p an ( t h e S p an c o r re s p on d i n g to C O RE 2 ) . Th e
va l ue s of i a re s o co n s t r a i n e d i n o rde r to k e e p th e
re s t r i c t i on s i n de p e n d e n t o f th e l e n g th O f th e s e n te n c e , b ut
~
117
th i s c on s t r a i n t c ou l d e a s i l y b e l i f te d .
I n th e a pp l i c a t i on t o th e S a ge r g r amm a r , th e O pe r at o r
I NTE R is u s e d on l y i n c omm a re s t r i c ti on s . Th e O p e ra to r W O RD
i s u s e d r a re l y .
An o th e r k i n d o f e n dp o i n t - che ck i n g s t at eme n t i s of th e
f o rm
P i n te g e r . Q i n t e ge r .
P i n te ge r . Q i n te g e r .
Th e on l y u s e ma d e O f th i s c u rre n t l y i s i n on e re s t r i c t i on
wh i ch ch e ck s i f P 0 , i . e . i f th e n ode s p an s an i n i t i a l
p or t i on o f th e s e n te n c e .
Th es e c h e c k i n g s t a te me n t s m ay b e comb i n e d b y l o g i c a l
O pe r a to rs i n th e s ame w ay as th e f l a g an d a t t r i b u te
ch e c k i n g s t a te me n t s o u t l i n e d ab ove .
S p an C h e ck i n g S t a te me n t s .
Re c a l l th a t wh e n a s p an i s t o b e ma t ch e d w i th th e h e a d
o f a p ro du c t i on or w i th a S i n g l e t on p r od u c ti on , it is
c on s i de re d th e s e c on d s p an ( c or re s po n d i n g to C O RE 2 ) . T he
f i rs t s p an i s n u l l . Th e ch e ck i n g s t a te me n t
S P AN l IS NL .
ch e ck i n g s t a teme n t
S P AN l I SN T NL .
i s i n te rp re t e d as N OT ( S P AN l I S NL ) . Th e s e s t a te me n t s m ay
b e c omb i n e d w i th o th e r c h e ck i n g s t a teme n t s b y l o g i c a l
O pe ra t or s i n the u s u a l w ay .
-
118
s i gn fo l l ow e d b y a s t ri n g o f a l ph an ume r i c ch a r a c t e rs , e .
g .
S P UN G . T h e p l a c e O f a c h e ck i n g re s t r i c t i on i n th e s e mi
g r amm a t i c a l i t y h i e r a r c hy i s i n d i c at e d b y app e n d i n g th e
ma rk e r t o th e f r on t of th e r e s t r i c t i on w i th O R :
s gt ag OR ch e c k i ng r e s t r i c ti on .
T he s e m i g r a mm a t i c a l i ty m a rk e rs , de s c r i p t i on s O f th e i r
c o r re s p on d i n g c l a s s e s o f re s t r i c t i on s , an d a re c omme n de d
S yn t a x o f th e Re s t ri c t i on M e t a l an gu a ge
T h e c omp l e t e s y n t a x o f th e re s t r i c t i on me t a l an g u ag e
is g i v en b e l ow . Th e S pe c i f i c a t i on i s i n s t an d a rd BN F
n o t at i on : Th e t r i an g u l a r b r a ck e t s e n c l o s e s ymb o l s O f t he
BN F de s c r i p t i on l an g u a ge . S ymb o l s b e g i nn i n g w i th
" "
are a t omi c s t an d s f or de r i ve s . s ep a
r a t e s a l te rn a t i ve s . S q ua re b r a ck e t s i n d i c a t e th a t
wh a t i s e n c l o s e d is O p t i on a l . A l l o th e r s ymb o l s a re p a r t
O f th e re s t r i c ti on me t al an g u a ge .
s t rin g of a l p h an ume r i c ch a r a c te rs
b e g i n n i n g w i th an a l ph ab e t i c ch a r a c te r an d not endi ng
" "
in PL G .
s t r i n g O f a l ph an ume r i c ch a r a c te rs e n c lo s e d
i n t r i an g u l a r b r a c k e t s .
f o l l owe d b y f o l l ow e d b y a s t ri n g O f
a l ph an ume r i c c h a r a c te rs f o l l ow e d b y
-
12 0
s trin g o f a l ph an ume r i c ch a r ac t e r s e n c l os e d
i n q uo t e s .
an i n t e ge r .
f o l l ow e d b y a s t r i n g o f a l p h an ume r i c
cha ra c te r s .
s t r i n g O f a lph an ume r i c ch a r a c t e r s e n d i n g
" "
in FL G .
< bu lk >
< s ymb o l > < * i n t s ym > < * a tom > < * l i te r a l >
< con d l > IF < c o nd l> TH E N < c ond l > < c on d 2 >
< c on d 3 > < h as s t > < se tm e m > < i n te r s e c t > < i n te r >
-
121
< has s t> < c o re x > < h as n > <b i t s t gl >
<b i t s tgl > <bi t s tg2 > [ AN D <bi ts t gl > ] < bi t s tg 2 >
< bi t> < * fl ag> <a ttr s tg> < * l i te ral >
OF < c o re x > C O RE H AS AT T R I B UT E S
OF < c o re x > C O RE H AS N T AT T RI B U T E S
< s e t me m >
< elt> <* f l ag> <* a t t r i b u te > < *1 i t e r a 1 > / < c o re x >
<e
q >
< in te r > I N TE R
<
p q > P P +1 Q Q +1
< e nd
p tck >
<w o r d ck > W O RD
<S
p an c he k > S P AN l < i s n> NL
< isn> IS I SN T
-
122
< a t t r s t g> <a ttrs tg>
S P AN l I SNT NL N O T S P AN l IS NL
EL S ub s t i t u t i on :
gggé
E EL l i t ( c o re ( EL
< * f l ag >
< * a t t r i b u te > EL
< * l i teral >
< * fl ag>
< c o re x > H AS <a t t r s t g> < * a t t r i b u te >
F un c t i on S ub s ti t u t i on :
gggé
E HAS
<*
a t trs tg >
l i te r a l >
c h e ck a t trs t g> , 2
C O RE H AS < * f l ag > se t
C O RE H AS N T <* f l ag> un s e t
C oRE l 1
C O RE HAS < * f l a g > OF pas s
C O RE 2
C O RE I
C O RE H AS AT T R I B U T E S OF c o re s e t
C O RE HAS N T A TT R I B U T E S c o r e un s e t
S P AN l IS NL i s nl
<a t t rs tg>
c a l l th i s < f c o re l >
C oRE l n1
<a t t rs t g>
c a l l th i s < f c o re 2 >
C O RE 2 n1
-1 24
< f c o re 1 > < f c o re 2 >
i n te r s e c t
P p e e ( s p an 2 ) Q q ue ( sp an 2 )
ne
E x te rn a l s : W h e n th e r e s t r i c t i o n i s c a l l e d , th e re a re
" " "
th re e s p an s i n vo l ve d . s p an l an d s p an 2 a re b e i n g
" "
c on c a te n a te d t o f o rm ne w s p a n .
ne w s p a n
s p an l S p an 2
E a c h s p an i s a 4 - tup le , c on s i s t i n g of an i n i t i a l p o i n t p p p ,
an d e n dp o i n t ggp , a s ymb o l e t a , an d a co re c o re .
Th e f un ct i on s p p p , e ta , gp p , an d c or e e x t r a c t th e s e f o u r
e l e me n t s .
E a c h c o re i s a tri p l e , c on s i s t i n g o f a set o f f l ag s ,
a c a te g o ry n o de o f a wo r d i n th e s e n te n c e , an d a s t r i n g
wh i c h i s the l i te r a l s p e l l i n g of th e w o r d .
The s e th re e e l e me n t s a re e x t r a c te d b y th e f un c t i on s flp gp ,
ca tno de , an d l i t , re s p e c t i ve ly . T he a t t r i b u t e s O f th e c o re
w o rd a re ac c e s s i b l e b y u s i n g th e f un c t i on de s c on th e
c a t e g o ry n o de . The n ame s o f t h e c at e g o ry an d a t t r i b u te s
a re a c c e s s ib l e u s i n g th e f un c t i on n ame .
T h e s ub r ou t i n e re s t r i c t i on te s t : re s t r i c t i o n t e s t is
c a l l e d w i th t h e tw o S p an s b e i n g c on c a t e n a te d , s p ah l an d
-
l2 5
pppp g , a s a rgume n t s t og e th e r w i th th e e n t ry o c c i n th e
i nve r s e g r amma r th a t d i c t at e s th i s c on c a te n a t i on . F i rs t
th e f l ag s o f the n ew c o re a re s e t f r om th e c o re of ppp p l
i f i t i s n ot nu l l , an d th e a t t r i b u t e s an d l i t e r a l a re
d e te rm i n e d f r om an i n d i c at o r i n th e i n ve rs e g r amm a r e n t ry
o c c e xt r a c te d b y th e f un c t i on c o rb i t . co rb i t (occ ) re tu rn s
t i f th e c o re o f pp pp 2 i s to b e t ak e n as th e n ew c o re , f if
t he c ore O f ppp p l . T he n a l l th e re s t r i c t i on s s t o re d a t o c c
ar e e x t r a c te d w i th t he f un c t i on re s t r l i s t an d e xe c u t e d .
A l l o th e r e x te rn a l s i n th e a l g o r i thm h ave b e e n de s c r ib e d
ab o ve .
de f i n e
li t , f la g s , c o r bi t, e ta , d i v li s , re s t r li s t
f o rm th e n ew c o re
if s p an l
pg n1
is kor2 ) , l i t ( ko r 2 ) >
else p as t;
e xe c u t e a l l th e re s t r i c t i on s ho u s e d a t th a t p o i n t
i n th e g ramm a r u n t i l on e f a i l s
( Vr e s t r E re s trli s t ( occ ) wh i l e p a s ) p as p a s an d re s t r ; e n d V ;
newc o re re tu rn ;
en d re s t r i c t i o n te s t ;
Th e F un c t i on s D e f i n e d : Th e f un c t i o n ch e c k e x e cu t e s
th e c h e c k i n g s t a teme n t s a n d r e t u rn s a v a l ue O f t f
’
or
-
12 6
de f ine f
i f fl ag 6 f la gs ( c o r e ( i f x pg 1 th e n s p an l e ls e span2 ) )
th e n ne w f l a g s new f l a g s w i th flag ; ; re t u rn t ; e n d p as s ;
T h e f u n c t i on c o re s e t s e t s th e n ew c ore t o e i t he r C O RE l
or C O RE 2 .
d e f i ne f c o re s e t (x ) ;
ko r c o re ( i f x p g 1 th e n s p an l e l s e s p an 2 ) ;
re tu rn t ; end c o re s e t;
T h e f un c t i on c o re un s e t un s e t s th e c o re l e x i c a l i tem s et
p r e vi ou s l y i n re s t r i c t i o n te s t .
d e f i ne f c o r e un s e t;
T h e f un c t i on i n t e r s e c t e xe c u te s th e emp ty i n t e r
s e c t i on c h e c k i n g s t a te me n t s .
d e f i ne f
(l Vi 2) elt i f i pg 1 th e n e ltl e ls e e l t2 ;
ko r c o re ( i f i pg 1 the n s p an l e l s e s p an 2 ) ;
f l ow (elt) ?
s e tup ? c on t i n ue
re s e t , de s te s t?
(e lt) ? c on t i n ue
re s e t , c on t i n ue
[ c on t i n ue d ]
-12 8
s e t up : < nod
, e lt> elt; x ca tn o d e ( ko r ) ; n a me (x ) pg n o d ) ;
d e s te s t : y
=x
; (3 x 6
pg nod ) ;
re s e t :
<no d , e lt> elt ; to d e s te s t ;
e n d f l ow ; en d V ;
re tu rn e n d i n t e rs e c t ;
d e f i ne f i s nl ;
re tu rn s p an l
pg n1 ; e n d i sn l ;
I NTE R is an a r r ay i n th e m a i n p r og r am , mo s t o f wh o s e
e n t ri e s a re b l an k , b u t wh i ch has a i n e l e me n t s c o r re s
p on d i n g t o i n t e r - w o r d p o i n t s h a vi n g a c omm a .
T h e L an g u age i s S t i l l C on t e x t - F re e .
T h e re s t r i c t i o n me t a l an g u a ge i s p u rp o s e l y l i mi te d i n
p ow e r . A l an g u a ge re c o gn i z e d by a g r amm a r c on s i s t i n g o f
BN F p ro d u c t i on s au gme n t e d b y r e s t r i c t i on s e xp re s s e d i n th e
re s t r i c t i on me t a l an g u a ge is s t i l l a c on t e x t - f r e e l an g u a g e .
Th a t i s , th e re is a c on te x t - f re e g r amma r wh i ch r e c o gn i z e s i t .
T o S h ow th i s w e wi l l i n d i c a t e how to c ons t ru c t a we ak l y
'
e q u i va l e n t p u re l y c on t e x t f re e g r amm a r -
G out of a c on te x t
n on te rm i n a l o r t e rm i n a l s ymb o l of G, th e n th e c o r re s p on d i n g
'
s ymb o l s o f G wi l l be
j
,
i 3 k
wh e re th e a t tr i n c l u d e a l l p o s s i b l e a t t r i b ut e s o r a l l
i
-
12 9
p o s s i b l e b r an ch e s o f a t t ri b u t e t re e s o f c a te g o ri e s th a t
th e c o re w o rd o f A c ou l d h ave an d a l l l i te r a l w o rd s me n t i on e d
i n the re s t r i c ti on s c on s i s t e n t w i th th o s e c a te g o ri e s . flg
j
r an ge s o ve r a l l f l a g s a c t i ve a t th a t n od e . c omk t ak e s on
" " "
th e v a l ue s p re c e di ng c omm a and s u c c e e d i n g c omm a .
S S s may b e e i th e r or de p e n d i n g on wh e th e r
i j k
th e a t t r ib u te or c omm a i s p re s e n t o r the f l ag i s se t at th a t
poi n t . I f th e re a re x p o s s i b l e c o re w o rd a t t r i b u t e s an d
y f l a g s a c t i ve at a n o d e the n c o r re s p on d i n g to th e o ne
X +y +2 '
s y mb o l o f G th e re w i l l b e 2 s ymb o l s i n G .
A p ro du c t i o n o f G t o ge th e r w i t h th e re s t r i c t i oms h o u s e d
'
a t th at p o i n t c an b e t r an s l a t e d i n t o p ro d uc t i on s O f G in a
re a s on ab l y s t r a i gh t f o rw a rd man n e r . Le t A B C b e a p r od u c
t i on O f G, an d l e t b e th e
'
s ymb o l s o f 6 c o r re s p on d i n g to A , B a n d C re s p e c t i ve l y .
B e g i n b y w r i ti n g d own th e p r o d u c ti on s
l
A
i
B
3 ; c l 3 k
F o r e a ch re s t r i c ti on o f G h o us e d i n A B C an d for e ach
p r odu c t i on A
i B
5 iC s ub s t i t u t e th e va l ue s i n d i c a t e d b y
A
i
B
j
C
i i n to th e re s t r i c ti on , e v a l u a te i t as a B o o l e an
e xp re s s i on , an d d i s c a r d th e p r od u c ti o n f rom G
'
i f th e
re s u l t i n g va l ue is FA L S E . Fo r e x amp l e , i f th e re s t r i c t i on i s
IF CO RE l HAS B FL G AN D C O RE 2 H AS C F L G T H E N C O RE H AS AF L C .
an d i f
i
- AFL c on t ai n s +B L F G
A c on t a i n s G, B
3 , an d C
i
c on t a i n s -
C FL G , th e n s ub s t i tu t i on re s u l ts i n th e B oo l e an
e x p re s s i on
-
l3o
the re s t r i c ti on c omp on e n t O f th e g ramm a r . I f th e p re s e n t
g r amm a r i n th i s m an n e r , th e numb e r O f p r od uc t i on s i n th e
r e s u l t i n g g r amm a r w ou l d be s e ve r a l o rd e r s of magn i t u de
g re a te r .
132
CH A P T E R 6 . TH E ME T A L AN G U A GE AP P L I E D T O T H E S A GE R
G RAMMA R FOR E N GL I S H .
I n t rod u c t i on .
F i rs t O f a l l , i n o rd e r to de mon s t r a t e th e u s e fu ln e s s
an d p owe r of th e re s t r i c t i o n me t a l an g u a g e , an d s e con d l y ,
i n o rde r t o p r o d u c e a w o r k i ng , f a s t , b o t t o m - u p p a r a l l e l p a rs e r
Of En gl i s h , t he re s t r i c t i on s o f th e S a ge r g r amma r we re
w r i tt e n i n th e me t al an g u a g e . No a t t e mp t w a s m a d e t o de a l
w i th c on j un c t i on s or c omp a r a t i ve s , b u t o th e rw i s e th e e n t i re
re s t r i c t i on c omp on e n t w a s h an d l e d . Th i s i n c l u de s a g r e e me n t
re s t r i c t i on s b e twe e n th e s ub j e c t an d ve rb ph r a s e an d w i th i n
th e n o Un ph r a s e , s e l e c t i on a l re s t r i c t i o n s b e twe e n the
s ub j e c t an d th e d e e p e s t ve rb , r e s t r i c t i on s g ove rn ing th e
c o o c cu r r e n c e O f d e e p l y n e s t e d s e n te n c e n om i n a l i z a t i on s i n
th e s ub j e c t an d th e p re d i c a te , an d r e s t r i c t i on s go ve rn i n g
th e O mi s s i on o f n o un s f r om d e e p l y emb e d de d wh - s t r i ng s .
NO re s t r i c t i on wa s f o un d wh i ch c ou l d n o t b e e xp re s s e d i n
f o r e ve ry re s t r i c t i on . R e s t ri c t i on s a c t i n g i n th e l ow e r
g en e r a l l y b e e x p re s s e d i n t e rm s O f c o re l e x i c a l i t ems .
M an y p o s i t i on a l , q u an ti f i e r , an d n oun ph r a s e re s t r i c t i on s
f e l l i n t o th i s c l a s s . R e s t r i c ti on s a c t i n g a t h i gh e r l e ve l s
o f th e g r amma r , th e s e n te n c e n om i n a l i z a t i on , a g re e me n t ,
an d wh - s t r i n g re s t r i c t i on s , c o u l d u s u a l l y b e e x p re s s e d b y
-
l3 3
s e t t i n g a f l a g a t a l owe r l e ve l i n th e p a r s e t re e to i nd i c a te
the p re s e n ce o f s ome s t ru c tu r a l fe a tu re , p a s s i n g i t up t o
t he h i ghe r l e ve l , an d e xe c u t i n g th e re s t r i c t i on on th e b a s i s
c od e d i n the me t a l an gu a ge i n c l u d i n g an e xp l an a t o ry comme n t
fo r e a c h re s t r i c t i on i s l i s te d i n i t s en t i re ty i n App e n d i x B .
Th e BN F c omp on e n t a s mod i f i e d f or n od a l s p an s p a r s i n g i s
g i ve n i n A p pe n d i x A a l on g w i th a g u i de to th e mn e mon i c s
an d e x amp l e s o f t he s t r i n g s .
T h e i d a l ma ch i n e g r amm a r f o r s c i e n t i f i c E n g l i s h re c o gn i z e s
‘
g
‘
um a t i c a l s e n te n c e s an d on ly th o s e . W o rk don e at th e
S t ri 3 P ro j e c t i n d i c a te s th a t th e S a ge r g r amm a r c ome s
i mp r e s s i ve ly c l o s e t o th i s i de a l . I n s o f a r a s i t d oe s , th e
re s u l t of S e c t i on S h ow s th a t , th e ore t i c a l l y , s ci enti f i c
E n g l i s h c an b e re c ogn i z e d b y a p u re ly c on t e x t f re e g r amma r .
S e c on d , a me th o d e x i s t s f o r p a r s i n g s c i e n t i f i c E n g l i s h
4
i n t i me n . T he e x t r a p ow e r o f n i s i n t r od u c e d b e c a u s e
i n th e s p an th e c o re l e x i c a l i te m c an re fe r to
an y wo rd b e tw e e n th e ( p +l ) s t an d th e q
th . ( O f c ou r s e , if
s c i e n t i f i c E n g l i s h i s a c on te x t — f re e l an g u a ge , i t c an b e
3
re c ogn i z e d i n t i me K n , b u t wh a t a K I) Th e s e re ma rk s
a re o f th e o r e t i c a l i n t e re s t on l y ; i t i s no t c l a ime d th a t
a c on te x t - f re e g r amma r o f E n g l i s h c o u l d b e e xp l an at o ry .
Th e ne x t tw o s e c t i o n s o f th i s ch ap te r d i s c u s s mod i f i c a
-
l34
A + A E , A + A D , A + B C
3 3 2 2
I n th e c a s e o f th e as s e r t i on s t r i n g h ow e ve r th i s g r oup i n g
is no t fe as ib le .
T h e r e a re th re e br o a d c a te go ri e s o f re s t r i c ti on s
O pe r a t i n g on t h e s ub j e c t , ve rb , an d ob j e c t of th e a s s e r t i on
s tri ng :
1 . C on s t r ai n t s b e twe e n th e v e rb an d th e ob j e c t .
T he s e i n c l ud e the O BJ L I S T re s t r i c t i on s c on s i de re d b e l ow ,
an d the N O TN O B J re s t r i c t i on s wh i ch ve r i fy th a t th e O b j e c t
h as no a t t r i b u t e s wh i ch a re p r oh i b i te d fo r th at ve rb .
Th e s e re s t r i c t i on s re q u i re th a t th e c o re s o f th e V e rb an d
th e O b j e c t b e a va i l ab l e at th e t i me th e tw o e le me n t s a re
c on c a t e n a te d .
2 . C on s t r a i n t s b e tw e e n th e s ub j e c t an d th e ve rb ,
" "
e s p e c i a l l y i f th e ve rb i s s o me th i n g o th e r th an to be or
a b e — re p l a c e r Th e s e i n c l u de n ot on l y
n um b e r ag re eme n t , b u t mo re i mp o r t an t l y th e N OTN S UB J
re s t r i c ti on s wh i ch ch e ck t h a t th e s ub j e c t d oe s n ot h ave
i l l e g a l a t t r i b u te s for th a t ve rb . T h e s e re s t r i c t i on s re q u i re
th at th e c o re s o f th e v w rb an d th e s ub j e c t b e av a i l ab l e a t
th e t i me t h e y a re j o i ne d .
3 . C on s t r a i n ts b e tw e e n the s ub j e c t an d th e O b j e c t - O f - b e
" "
wh e n t he ve rb i s to be or a be - re p l a c e r . E x amp l e s i n c l u de
re s t r i c t i on s go ve rn i n g th e ap p e a r an ce O f c e r t a i n s e n te n c e
n omi n a l i z a t i on s i n th e s ub j e c t an d i n t h e O b j e c t - O f - b e .
-
1 36
s ub j e c t an d ve rb by me an s of a f l ag an d h ave th e c or e o f th e
s ub j e c t an d th e O b j e c t - O f - b e ava i l ab l e a t th e ti me th e tw o
e l e me n t s a re j o i n e d .
Th e s e re q u i re me n ts f o rc e th e ve rb an d th e Ob j e c t to be
th e ve rb i s t ak e n as th e c or e O f th e ve rb ph r a s e an d
re s t r i c t i on s O f t he s e co n d c a t e g o ry a re app l i e d wh e n th e
ve rb ph r a s e an d th e s ub j e c t a re c on c a te n a te d . I f t h e ve rb
" "
is to b e or a be - re p l a c e r , th e O b j e c t - O f — b e i s t ak e n as
th e c o re o f the ve rb p h r a s e , a n um b e r f l a g i s s e t f rom th e
ve rb , an d r e s t r i c t i on s o f th e th i r d c at e g o ry a re e xe c u te d
wh e n th e ve rb ph r a s e an d s ub j e c t a re c on c a te n a te d . Th u s
th e p r od u c t i on f o r th e a s s e r ti on s t r i n g b e c o me s
< AS S E RT I ON VO >
D V OB re s t r i c t i o n s ( s e e Ap p e n d i x B ) g o ve rn th e ch o i c e o f th e
c o re e l e me n t i n < AS S E RT I ON V O > .
1
T h i s an a l y s i s o f th e a s s e r t i on s t r i n g i s so p re v a l e n t
o th e rw i s e .
T he o the r S ub j e c t V e rb Ob j e c t s t r i n g s h ave a l s o
b e e n a l t e re d i n l i n e w i th th e s e c on s i de r a t i on s :
1
L e on a rd B l o om f i e l d , L an gu a ge , N ew Y o rk , 1 9 3 3 , p 161 ; .
N o am C h oms k y , n t a c t i c S t ru c t u r e s , T h e H ag ue , 1 9 5 7 , p 26 .
;
H A G l e a s on ,
. . n d i s h G r amma r , N ew Y o rk ,
19 65 , p . 141 .
-
137
< YE S N OQ >
< YE S N OQ V O >
< TS UB JV O >
R e s t r u c tu r i n g th e L e f t A d j un c t o f th e N oun .
Th e l e f t a d j un c t o f th e n oun to ge th e r w i th th e n oun
va r i an t ,
< LN > < NVA R > , a re a t p r e s e n t s t r u c t u re d as
2
s ug ge s te d b y H a r r i s :
< Q P OS > < AP O S > <NS P OS > < NP OS > ) < N VA R> )
Th e u s u a l b i n a ry s t ru c t u re g i ve n i n I mme d i a t e C on s t i t ue n t
3
an a ly s i s i s i nd i c a t e d by the p a re n th e s i z i n g :
T h e re q ui re me n t s o f th e n od a l S p an s a l g o r i thm an d th e
re s t r i c t i on s s ug g e s t a re s t ru c t ur i n g d i f f e re n t f r om
e i th e r o f th e s e .
Fi rs t o f al l ,
<N S P OS > an d < N P OS > a re s ub s ume d un de r
as i l l us t r a te d b y th e e x amp l e
" "
a n e i ghb o rh oo d f i re m an s b a l l '
Th i s i s a f a i r l y r a re c on s t r u c t i on , s o i t i s m a rk e d a s s u ch
( b y a mi nu s S i gn ) i n th e re vi s e d g r amma r :
Z e l l i g H ar ri s S t r i n g An a l y s i s O f S e n te n ce S t ru c t u re
, ,
T he H a gu e 19 62 p ,36 , .
3
H . A . G l e a s on , op
l
. ci t .
, pp . 1 5 1— 9 .
-
l3 8
e x amp l e i n th e ph r a s e
" "
th e r un n i n g b oy
a s e l e c t i on a l re s t r i c t i o n mu s t ch e ck th at th e n o un i s a
l e g a l s ub j e c t fo r th e ve rb . T h i s i nv o l ve s s e a r ch i n g th e
l i s t o f n o un a t t r ib u t e s un de r th e N O TN S U B J a t t r i b u te O f
th e ve rb an d th e l i s t O f a t tr ib u te s f o r th e n oun t o m ak e
s u re th e y c on t a i n n o a t t r ib u t e i n c ommon . Ag ai n , th i s
c an n o t b e do n e c on v e n i e n t l y w i th f l a g s , S O th e c o re o f
The r e a re n um b e r ag re e me n t an d o th e r re s t r i c t i on s
b e tw e e n th e a rt i c l e p o s i t i on < T P OS > an d th e q u an t i f i e r
p o s i t i on <
Q P OS > . T h e y a re n o t s e l e c t i on a l re s t r i c t i on s
so i t w ou l d b e p o s s i b l e to h an d l e th em w i th f l a g s , yet i t
t o g e th e r . Th e r e f o re , we r ew ri te th e p ro d u c t i on s
< T OP O S >
< L N N VA R >
Th e r e a re s e ve r a l re s t r i c t i on s wh i ch r e q u i re n umb e r ag re eme n t
n umb e r f l a g i s se t i n the a r t i c l e - q u an ti f i e r p os i ti on s so
th at th e n e c e s s a ry c omp a r i s on s c an b e ma de .
I n t h e ph r a s e
-
14 0
" "
th e s e th re e r un n i n g b oy s
" " " "
th e n umb e r O f th e s e an d th re e a re ch e ck e d ag a i n s t e a ch
" "
o the r , th e s e l e c t i on a l re s t r i c t i on b e tw e e n b oy s an d r un n i n g '
i s ch e ck e d , an d f i n a l l y th e n umb e r re s t r i c t i on b e twe e n t h e
a r t i c l e an d / o r q u an t i f i e r an d th e n oun i s ch e ck e d . Th u s th e
s t ru c t u r e o f th e n oun w i th i t s l e f t a d j un c t i s
4
Null O p ti on s a re e x t re me l y i n c on ve n i e n t t o h a n d l e i n a
b e e n e l i mi n a te d b y th e f o l l ow i n g r ew r i t i n g o f th e p r o du c t i on :
< LN 1 >
Th i s a l s o e l i mi n a te s th e n e e d fo r th e re s t r i c t i o n b an n i n g an
A d ve rb i a l P r e p os i t i on P re p os i t i on S trings .
E a ch s p an c on t a i n s a re f e re n c e to on ly o ne c ore l e x i c a l
i tem . T h e re a re s e ve r a l re a s o n s wh y th i s is d e s i rab l e . It
k e e p s th e re s t r i c t i o n me t a l an g u ag e , an d th e re f o re th e
me c h a n i s m s imp l e me n t i n g i t , s i mp l e . T he o r e t i c a l l y mak i n g
3
on e c o re wo r d a de te rm i n e r o f t h e s p an s mak e s t h e n n od a l
4
S p an s a l go r i thm i n t o an n a l go r i thm , an d i n c l u s i on o f
5
an o th e r c o r e wo rd wo u l d mak e i t n . M o re prac ti c al ly , it
c ou l d p re ve n t a c e r t a i n amou n t o f me rg i n g a n d t h u s c au s e
d i f f i c u l t i e s w i th S p a c e . F u r th e rmo re th e re a re ve ry f ew
I t i s i n t e re s t i n g t o n ot e th a t R u l on W e l l s c on cu r s w i th
" "
th i s an a l y s i s i n I mme d i a t e C on s t i tue n t s , L an g u ag e Vol , . 23 ,
pp . 81- 11 7 , 19 4 7 .
-l4
l
p l a c e s i n th e g r amm a r wh e re mo re th an one co re wo rd is
ca l l ed fo r , th a t i s , wh e re a re s t r i c t i on mu s t l o ok a t the
a t t r i b u te s or l i t e r a l O f mo re th an on e l e x i c a l i t em i n
a s t ring .
A s ma l l c l a s s o f e x c e p t i on s i s the c l a s s o f ad ve rb i a l
"
p re p o s i t i on p re p o s i t i on a l s t r i n g s , e .
g . Q DP l PN > : On e
"
mus t f a c e u
p to s e r i o u s p r ob l ems . A g i ve n ve rb wh i ch t ak e s
a < DP 1 PN > ob j e c t m ay do so on ly wh e n th e v a l ue s o f t h e
ad ve rb i a l p re po s i t i on an d th e p re p os i ti on a re p a r t i c u l a r
wo rd s . Th e s e a l l ow e d wo rd s a r e s t o re d i n th e d i c t i on a ry
e n t ry o f th e ve rb . Th u s , wh e n a < DP 1 PN > ob j e c t i s t o b e
c on c a te n a te d w i t h a ve rb t o f o rm a v e rb p h r a s e , a re s t ri c
an d the p re p o s i t i on a re a l l ow e d , i . e . tw o c o re l e x i c a l i t ems
mu s t b e ch e ck e d .
Th e e s c ap e f r om th i s d i f f i c u l ty i s th e f a c t th a t th e
c l as s o f a dve rb i a l p re p o s i t i on s i s s ma l l f o u r t e e n w o rd s
" " " " " " " " " " " "
a c ro s s , a l on g , a r oun d , aw ay , b a ck , d own ,
" " " " " " " " " " " "
in , O ff , on , out , ov e r , th r o u gh , Th us ,
a t ve ry l i t t l e e x t r a c o s t th e re may b e a f l ag c o r re s p on di n g
t o e a c h a dve rb i a l p re p os i t i on . A t a p o i n t i n th e g r amma r
wh e re an ad ve rb i a l p re p o s i t i on o c c u rs i n a D P P s t ri ng ,
th e re a re f o u r te e n re s t r i c t i on s o f th e f o rm
" "
I F C ORE 2 HAS UP T H E N C O RE H AS UP F L G .
Wh e re a DP P s t r i n g ob j e c t i s to b e c on c a te n a te d w i th a
ve rb th e re a re f o ur te e n re s t r i c t i on s O f th e f o rm
-
l4 2
I n th e b o t tom - u p p a r s e r , th e re a re tw o p o s s i b l e me an s
o f i mp l e me n t i n g the OB J L I S T r e s t r i c ti on s th e p r i n c i p l e d
w ay an d th e s e n s i b l e w ay . T h e p r i n c i p l e d w ay i s t o h ave
a f l a g c o r re s pon d i n g t o e ac h O p t i o n for Ob j e c t . W h e n an
d i f f e re n t f l ag s . W he n th e < OB JE C T > s p an s a re to b e
" "
c on c a t e n a te d w i th a v e rb wh o s e c o re wo r d i s see , OB J L I S T
re s t r i c ti on s o f th e fo rm
I F C O RE 2 H AS N S T GO F L G T H EN C O RE l H AS OB J L I S T zN S T G O .
I F C O RE 2 H AS V I N GO F L G T H EN C O RE l H AS OB J L I S T : VI N G O .
a dmi t th e f o rme r an d re j e c t th e l a t te r .
Th e f i rs t d i f f i c u l ty w i th th i s s o l u t i on i s th a t i t
i n c re a s e s th e n umb e r o f f l ag s b y ab ou t f i f ty p e r c e n t , an d
th u s th e s p a c e th a t mu s t b e se t a s i de fo r s t o r i n g th e c o r e s .
Ye t , S in ce on ly o ne of th e s e f l ag s m ay b e set at o ne t i me ,
mo s t O f t h i s e x t ra s p a c e i s w a s t e d . On e c ou l d h ave an o th e r
typ e o f f l a g i n t he me t a l an g u a g e . W h e n a re s t r i c t i on c a l l s
fo r t h i s typ e O f f l ag to be se t , i n s t e ad o f s e t t i n g a b i t ,
a p o i n te r i s s to re d i n th e c o r e t o a l i s t o f th e O b j e c t
a l te rn a t i ve s . Th e n e a r l y s i x ty b i t s th a t wo u l d h a ve b e e n
re q u i re d i s n ow re d u c e d to s i x . T h e d i f f i c u l ty w i th th i s
s o l u t i on i s th a t i t re q ui re s an e x te ns i on o f th e me t a l an g u ag e
to c ove r t h e n ew f l a g typ e an d c o r r e s p on d i n g ad d i ti on a l
me ch a n i s ms i n th e p a rs in g p r og r am . F u r th e rmo re , th e re i s
-
144
s t i l l th e un ae s t h e ti c l i s t i n th e re s t r i c ti on s o f a lmo s t
s i x ty n e a r l y i d e n t i c a l re s t r i c t i on s
T h e s e n s i b l e s o l u ti on i s s i mp l y to h av e a s ub r ou t i ne
a nd to h ave an o th e r ch e ck i n e a ch ve rb a l Ob j e c t s t r i n g t o
see i f th e ob j e c t i s o f th e p r op e r s o r t fo r th e ve rb . Th i s
s o l u t i on i s e a s y e n ou gh , b u t i t i s un p r i n c i p l e d b e c a us e th e
ve ry imp o r t an t O B JL I S T r e s t ri c t i on s wo u l d n o t app e a r i n
th e g r amma r , wh i c h o ugh t to be a t r ue s pe c i f i c a t i on o f
E n g l i s h g r amm a r a s w e l l as a m o d u l e i n a p a rs i n g s y s t e m .
W e me r e l y n o te th a t th e e xp re s s i on of th e O B JL I S T
r e s t ri c t i on s is w i th i n th e s c op e o f t he me t a l an g u a ge ,
an d a d op t th e s e n s i b l e s o l ut i on . Th e a l go r i th m s p e c i f i e d
a l te rn at i ve s i n de p e n d e n t l y o f th e re s t r i c t i on s .
N on e o f th e s e s o l u t i on s c ap t u re s th e t i me - s avi n g p r op
e r ti e s O f th e O BJ L I S T r e s t r i c ti on s i n th e t op - d own
e nv i ronme n t . Th e me ch an i s m i n th e p a r s i n g p r o g ram f o r
b ui l d i n g up th e c an d i d a t e s l i s t s mu s t b e a l te re d . A p ro c e d u re
is i n c l ud e d i n th e a l g o r i th m o f S e c tion wh i ch wh e n
ge n e r a ti n g a c an d i d at e s l i s t , te s t s fo r < OB J EC T > an d i n s t e a d
O f a dd i n g to th e c an d i d a te s l i s t , ad d s on l y F
o f th o s e e l eme n t s i n O B JL I S T ( CO RE 1 ) . I t i s e xp e c t e d th a t
th i s w i l l c u t down s i gn i f i c an t l y on th e n umb e r o f e l e me n t s
i n th e c an d i d a te s l i s t s an d th us on th e n umb e r of s p an s
ge n e r a te d .
-
14 5
Th e re i s a l s o s t o r e d i n th e d i c t i on a ry e n t ry fo r e a ch
v e rb th e a t t r i b u te P OB JL I S T wh i ch l i s t s th e s t r i n g s wh i ch
may ap p e ar a s th e p a s s i ve ob j e c t s o f th e ve rb wh e n i t
ap pe a r s i n th e p a s s i ve fo rm . Th e P OB J L I S T re s t r i c t i on s a r e
h an d l e d i n a w ay s i mi l a r to th e OB JL I S T .
Wri tin g R e s t r i c t i on s .
I n th i s s e c ti on i t w i l l b e s h own h ow s e ve r a l re s tri c
t i o n s o f n on de c re a s i n g c omp l e x i ty c an b e c ode d i n th e
r e s t ri c t i on me t a l a n g u a ge . Th i s s h o 1d at th e s ame t i me
i mp a r t th e f l a v o r of th e re s t r i c t i on s an d d emo n s t r a te
th e u s e o f th e me t a l an g u a ge .
WP OS l A : A dve rb s c an appe a r i n m an y a d j un c t p o s i t i on s ,
b u t e a ch a dve rb m ay ap pe a r i n on l y ce r t a i n p o s i t i on s . Th u s
" " " "
ge n e r a l ly may oc c u r a s a s e n te n c e ad j un c t wh i l e ve ry
r e s t r i c t i on s ch e ck th e a t t ri b u te s o f th e adve rb to s e e i f
b u te s wh i ch co r re s p on d t o th e p o s i t i on s i t m ay o c c u r i n ; th u s
" "
c he c k s th at a n a d ve rb ha s a t t r i b u te DS A b e f o re a c c p e t i ng
i t i n s e n t e n ce a d j un c t p os i t i on .
5
H O U S E D AT < DS TG> : < RE P S A > ;
6
$ P OS 4 OR C O RE 2 H AS DS A .
6
The s e mi g r a mm a t i c a l i t y c l a s s e s a re e xp l ai n e d i n S e c t i on
-
l4 6
" " " " "
n e i th e r , an y , an d e a ch .
DN 5 2 : t he onl y p r on oun s wh i c h c an t ak e an ap p o s i t i ve
" " "
a re you an d '
we , i . e . th os e wh i ch a re p l u r a l an d d e f i n i t e l y
" " "
h uman . Th u s w e may s ay we th e p e op l e b u t n ot h e th e
"
ben e fa c tor . An e x c e p t i on to th i s is i n a p r on o un a s th e
" " "
Ob j e c t o f th e ve rb be ; we may s ay I t w as he , th e be n e
"
f a c to r of a l l m an k i n d . Th e re l e v an t p r od u c t i on s a re
Km p ]
In t o p - d own p a rs i n g , th i s c on s t r ai n t c an b e e x e c u te d
b y a re s t r i c t i on c a l l e d a s < RE P RN > is ab o u t t o t ak e th e
t re e , wh i c h is a l re a dy b ui l t , to s e e i f < RN > is o c c u r ri n g
b o t tom - u p p a r a l l e l p a rs i n g , th e re s t r i c t i on c ann o t b e
n o de s s i nc e b y th e n s eve ra l o th e r s p a n s c ou l d h ave b e e n
me r g e d un d e r < RE P RN > . F i r s t w e mu s t s e t a f l a g t o p re ve n t
w i th < AP P O S >
-
14 8
H O U S E D AT < AP P O S > : < RE P RN > :
C O RE H AS AP P OS F L G .
Th i s i n f o rma t i on mu s t th e n b e p as s e d up t o th e l e ve l a t
wh i c h i t w i l l b e u s e d .
C O RE H AS AP P OS FL G OF C O RE 2 .
Th e f i r s t h a l f o f th e re s t r i c t i on i s t he n ap p l i e d .
T H E N C O RE H AS ON L Y O B F L G .
C O RE H AS ON LYOB F L G OF C O RE 2 .
I f th e ON LY O B FL G is se t , th e n < L P RO R > c an o c c u r on l y a s
" "
ob j e c t o f be . A l l o th e r p a th s a re b l o ck e d .
$ P OS 4 OR C O RE 2 H AS N T ON L Y OB F L G .
WN 9 : A c o un t n oun , at t r ib u te N C OUN T l , re q ui re s a
" " "
p re ce d i n g a r t i c l e ( a b ro om , th e wh - w o r d
" "
( wh i ch q u an ti f i e r ( o ne o r p os s e s s i ve
"
( S aman th a s
'
n o un H ow e ve r c e r t a i n co un t n o un s ,
th o s e w i th a t t r i b u te N COUN T Z , c a n o c c u r i n a p re p o s i t i on al
" "
ph r a s e w i t h s pe c i f i e d p re po s i t i on s . Th u s c ou r s e is a
-
149
c ou n t n oun , b u t i t m ay o c c u r w i th o u t a l e f t ad j un c t f o l l ow
" "
ing of , in an d on T h e s t ru c tu re of th e l e x i c a l i te m
" "
fo r cours e is
" "
C O U RS E
N o un
N ON H U MAN N C O UN T l N CO UN T 2
A s e c on d e x c e p t i on to th e co un t n oun ru l e i s th a t c e r t a i n
c o un t n oun s th o s e w i th a t t r i b u te N C OUN T 3 , c an o c c u r a s an
Ob j e c t o f be w i th o u t a l e f t a d j un c t . T h u s w e may s ay
" " " "
Y o u a re b o s s e ve n th o u gh b os s i s a c o un t n o un . Th e
re l e van t p rod u c t i on s a re
< TP OS > < L T R> < WH LN > < LN S R> < H OW Q S TG >
< T Q P OS >
< LN N VA R >
< LN R >
< PN >
I t i s f i r s t n e c e s s a ry to s e t a f l ag i f a v a l i d l e f t ad j un c t
o c cu r s th a t wi l l n o t b e c a rr i e d up as th e co re o f < T OP O S >
C O RE HAS O K C OUN T F L G .
I F C O RE 2 H AS Q AN D S I N G U L A R AN D Q N UMB E R T H E N C O RE H AS
OK CO UN TFL G .
-1 50
H OU S E D A T < LN R > : A LL O CC U RRE N C E S E X C E P T <NS TG > ;
$ WS OR C O RE 2 HAS N T ON LY O B FL G O R ON LY P N FL G .
" "
an d N COUN T 3 , so th a t i t may o c c u r a s an Ob j e c t o f be or
in a p r e p o s i t i on a l ph r a s e .
$WS OR I F C O RE 2 H AS ON LY OB FL G T H EN C O RE 2 H AS ON LYP N FL G .
ON L Y PN FL G mu s t b e p a s s e d th e re s t o f th e w ay up to th e
p re p os i ti on a l ph r a s e an d u s e d t o b l o ck a l l oth e r co n s t ru c t i on s .
C O RE HAS ON LYPN FL G OF C O RE 2 .
F ur t he rm o re , i n th e p r e p o s i t i o n a l p h r a s e a ch e ck mus t b e ma de
fo r th e p r op e r p re p o s i t i on f o r th e c oun t n oun .
$ P O S S O R I F C O RE 2 HAS ON L Y P N F L G THEN C O RE l E L N C O UN T 2 ( C O RE 2 )
E x amp l e s o f Re s t r i c t i on s i n A c t i on .
I n th i s s e c t i on a l l th e re s t r i c t i on s wh i ch a re ho us e d at
on e p a r t i c u l a r p o i n t i n th e g r amma r a re l i s te d , th e i r i n te n t
i s b r i e f l y e xp l a i n e d an d th e i r O pe r at i on de s c r i b e d . L ike th e
-
152
l as t s e c ti on , th i s sh o u l d i mp a r t th e f l a vo r of th e re s tri c
t i on s an d s he d l i g h t on th e i r O pe r a t i on i n th e c ou rs e o f
pa rs in g . T h e p a r t i c u l a r p o i n t i n th e g r amma r c h o s e n be c aus e
o f i t s i mp o r t an c e i s th e o c c u r re n c e o f th e ve rb p h r a s e
a c t at th i s p o i n t an d mo re f l ag s a re ac t i ve th an a t an y
o th e r p o i n t i n th e g r amma r . T h e re l e v an t p r o du c t i o n s a re
< AS S E RT I ON >
< AS S E RT I ON VO >
W e w i l l b e l o ok i n g a t a l l re s t r i c t i on s h o u s e d a t
< AS S E RT I ON VO > : < AS S E RT I ON > . I f a t an y p oi n t a r e s t r i c t i on
fai l s , an e x i t i s ma de f r om th e te s t i n g ro u ti n e an d th e n ew
S p an is no t f o rme d ( un l e s s i n s e m i g r a mm a t i c a l i ty mo de ,
as e xp l a i n e d i n C h ap te r
" "
A . D e e p e s t V e rb an d O b j e c t o f Be Re s t r i c t i on s .
" "
DV O B S : T he de e p e s t ve rb an d de e p e s t O b j e c t of be
re s t r i c ti on s de t e rmi n e wh e th e r th e de e p e s t ve rb or th e
" "
de ep e s t Ob j e c t o f be is t ak e n as th e c o re , as e xp l a i ne d
S i n c e th e c o re O f th e ve rb ph r as e b e c ome s th e c o re o f th e
a s s e r t i on the s e f l a g s mu s t a l s o b e p a s s e d up to te l l wh i c h
e l e me n t th e c o re i s . I n a d d i t i on , fo r th e s a k e O f c on d e n s a
" "
an d a f l ag i n d i c at i ng th at th e Ob j e c t O f be i s a s t ri n g
o f ad j e c t i ve s AS T G O B FL G a re p a s s e d up i n th e s am e re s t r i c t i on .
-
15 3
C O RE HAS DV B FL G , D OB F L G , AS T G O B FL G , S I N G FL G , P L U RAL FL G OF C O RE 2 .
I f th e s e f l ag s a re s e t i n th e c o re o f < AS S E RT I ON VO > th e n th ey
a re se t i n th e co re O f < AS S E RT I ON > .
B . A g re eme n t Re s t r i c t i on s .
W A G RE E l : B y th e t i me < AS S E RT I ON VO > i s c on c a te n a te d w i th
e i th e r a s an a t t r i b u te i n th e c o re l e x i c a l i te m or as on e of
th e f l a g s S I N G FL G or P LU RAL F L G . Th u s , th e re s t r i c t i on
ch e ck i n g c omp a t i b l e n umb e r s is
$8 8 OR I F C O RE 2 H AS S I N GUL A R O R S I N G FL G T H E N C O RE l H AS N T
P L U RA L O R P L U RALFL G .
" "
( S I NG UL A R O R S I N GF L G ) OR A G GRE G A T E OR I .
W AG RE E Z : Excep t in r a re c a s e s , th e s ub j e c t an d O b j e c t
" "
of be a g re e i n n umb e r :
" "
$ RA RE O R I F C O RE l HAS N T IT AN D C O RE 2 HAS D O B FL G THE N
( I F C O RE 2 H AS ( S I N GU LA R O R S I N GFL G ) AN D N OT AG GRE GA T E
T HE N C O RE l HA S N T ( P L U RAL O R P L U RAL F L G ) AN D ( I F C O RE 2
HAS P L U RA L O R P LU RAL F L G T H E N C O RE l H AS N OT ( S I N G UL A R
O R S I N G FL G ) OR A G GRE G AT E ) .
W AG RE E 3 : I f a c o l l e c t i ve ve rb h a s no ob j e c t the n th e
"
s ub j e c t c an n o t b e s i n g u l a r . Th u s , we may s ay T h e c h em i c a l s
" " "
c omb i n e . but not Th e c h em i c a l c omb i n e s . I f a re c i p ro c a l
ve rb h as n o ob j e c t , th en th e s ub j e c t c an n o t b e s i n g u l a r .
~
15 4
C . C omma R e s t r i c t i on s .
i mme d i a t e l y p re c e d i n g s ub j e c t . Th us i f th e re i s a c omma
b e fo r e t he ve rb , th e re mu s t b e an i n t e rve n i n g ad j un c t . If
th e re i s a s e n t e n c e ad j un c t i n th e p o s i ti on < AS S E RT I ON > ,
3 o r i f t h e s ub j e c t h a s a r i gh t ad j un c t , I N T AD J FL G h as be en
$ P UN C O R I F I N TE R ( P ) T H E N C O RE 1 H AS I N TAD J FL G .
D . S e l e c ti on a l R e s t ri c t i on s .
ve rb i s a c ti ve th e n th e re mu s t b e s e l e c t i on a l a g re e me n t
a t t r i b u te O f th e ve rb wh i ch l i s t s th e a t t r i b u t e s i ts
s ub j e c t may no t h ave
$ S E L 1 O R I F C O RE 1 H AS N OR P RO AN D C O RE 2 H AS D V B FL G
AN D N O TN S UB J AN D N O T DVB VEN P AS S FL G T H E N
N O TN S UB J ( C O RE 2 ) C O RE 1 NL .
" "
F u r th e rmo re , i f th e s ub j e c t i s th e e xp l e t i ve th e re th e
" "
ve rb ph r a s e h as an ob j e c t o f be .
" "
$ S E L 1 O R I F C O RE 1 H AS T H E RE T H E N C O RE 2 H AS D O B FL G .
E . S en ten ce N om i n al i z a t i on R e s t r i c t i on s .
Th e re a re e l e ve n s e n te n ce n omi n a l i z a t i on re s t ri c t i on s
wh i ch a c t at th i s p o i n t i n th e g r amm a r .
" "
DS N l : I f th e ob j e c t O f be i s a s e n te n c e n omi n a l i z a t i on
-
156
Or an a s s e r t i on th e n th e s ub j e c t mu s t b e a s e n te n t i a l n oun ,
" "
NS EN Tl , N S EN T 2 , or N S ENT 3 , ( Th e f a c t i s The
"
e vi d e n ce i s Th e t r oub l e i s or a n on h um an
p r on o un or a n oun s t r i n g w i th a z e r oe d n oun or a
" "
< F O RT O V O > or < T O VO > s t ri n g . I f th e O b j e c t o f be is a
s e n te n c e n omi n a l i z a t i on o r an a s s e r ti on , S N AO B FL G is se t
p h ra s e w i th a z e r oe d n oun , N U LLN FL G i s s e t i n th e s ub j e c t .
FO RT OVO FL G or TO VO FL G is se t , re s p e c t i ve l y .
$ P O S 4 O R I F C O RE 2 H AS S N AO B FL G AN D S P AN l I SNT NL THE N
C O RE 1 H AS N S EN T l O R NS ENT 2 O R N S EN T 3 OR ( P RO AN D N O T
N H UMAN ) O R N U LLN FL G O R F O RT OV O F L G O R T OV O F L G .
DS N 2 : I f a s e n te n c e n om i n a l i z a t i on o r an a s s e r t i on
ap pe a r s as the r i gh t ad j un c t o f an a d j e c t i ve i n th e O b j e c t ,
th en th e s ub j e c t c an n ot b e a s e n t e n t i a l n o un , a s e n te n c e
n omi n a l i z a t i on , a p re s e n t p a r t i c i p i a l s t r i n g o r a n o un s t r i n g
"
b e g i nn i n g wi th a wh -
word . Th u s we c an n ot s ay Th e f a c t is
‘
t ru e t h a t h e c ame . I f a s e n te n ce n omi n a l i z a t i on or an
a s s e r t i on ap pe a rs as th e r i gh t ad j un c t of th e ob j e c t p o s i t i on
I f th e v a l ue o f th e s ub j e c t is a s e n te n c e n omi n a l i z a t i on , a
pre s en t p ar t i c i p i a l s t ri n g , o r a n oun s t r i n g b e g i n n i n g w i th
a w h - w o rd , th e c o re o f th e s ub j e c t wi l l h ave S U B J S N FL G ,
S UBJ V I N G FL G , or S UB JWH F L G , re s p e c t i ve l y .
~
15 7
$ P O S 4 OR I F C ORE 2 HAS S N ARAE L G T H E N C O RE 1 HAS N T S UB J S N F L G
O R S U B JV I N GF L G O R S U B JWH FL G O R N S EN T l O R N S EN T 2 .
DS N 4 : I f a s e n t e n c e n om i n a l i z at i on oc c u r s a s th e r i gh t
ad j un c t o f th e s ub j e c t i n th e p os t — ob j e c t po s i t i on , RN S N FL G
th e c as e , th e s ub j e c t mu s t b e a s e n te n t i a l n oun an d c ann o t
"
F o r e x amp l e , w e may s ay E v i de n c e w a s p re s e n te d th at th e
" "
p re s i de n t w a s gu i l ty . or E v i de n c e th a t th e p re s i d e n t wa s
"
g u i l ty w a s p re s e n t e d . I f th e imme d i at e r i gh t ad j un c t o f
th e s ub j e c t i s a s e n te n c e n o mi n a l i z a t i on , th e RN S N FL G is se t
i n th e c o re o f the s ub j e c t .
$ P O S 4 O R I F C ORE 2 HAS RN S N F L G AN D S P AN l I SN T NL T H EN C O RE 1
HAS ( N S EN T l OR N S EN T 2 ) AN D N O T RN S N FL G .
DS N 5 : S e ve r a l s i tu a t i on s i n the ve rb ph r a s e re q u i re th e
" "
s ub j e c t to b e it an d i n th e s e c a s e s S UB J I T F L G is se t . T he n
the fo l l ow i n g re s t r i ct i on i s ap p l i e d .
" "
$ P O S 4 OR I F C O RE 2 H AS S UBJ I T FL G T H E N C O RE 1 HAS IT .
s ub j e c t i n th e p o s t - ob j e c t p o s i t i o n , th e n the C l S H O ULDFL G is
the s ub j e c t mu s t b e i n th e s ub c l a s s of s e n te n t i a l n oun s
"
w i th the AS H O U LD at tr ib ute . F or e x amp l e , we may s ay Th e
"
p r ay e r i s on the l i p s O f a l l th a t h e b e s a fe an d s o un d .
-
15 8
"
( Th a t h e c ame d r ove me ou t o f my C e r t a i n s e n te n t i a l
ve rb s VS EN T 3 c an h a ve a s e n te n c e n omi n a l i z a t i on as th e
"
s ub j e c t i f the ve rb i s i n th e p a s s i ve ( T h a t h e c ame i s
k n own t o I f th e de e p e s t ve rb is p as s i ve th e c o re o f
$ P O S 4 O R I F C O RE 1 HAS S UB J S N F L G T H EN C O RE 2 H AS DOB FL G
O R VS E N T l O R V S EN T 2 OR VS E N T 3 O R VMO D O R VE X P .
$ P O S 4 O R I F C O RE 1 HAS S UB J S N F L G AN D C O RE 2 H AS V S EN T 3
T H E N C O RE 2 HAS DV BVE N P AS S FL G .
WS N 2 : I f the s ub j e c t i s a s e n te n c e n omi n a l i z a t i on an d
" "
th e de e p e s t ob j e c t o f be is an ad j e c t i ve o r a p re s e n t
p art i c i p l e , th e n th e ad j e c t i ve o r p re s e n t p a r t i c i p l e mu s t b e
s e n te n t i a l , i . e . mu s t h ave the a t t ri b u te s AS EN T l or AS EN T 2
" "
or V S EN T l . Th us we m ay s ay T h a t he c ame h e re is p r ob ab l e .
" "
an d T h at h e c ame he re i s a l a rm i n g .
$ P OS 4 OR I F C O RE 1 H AS S UB J S N F L G AN D C O RE 2 H AS D O BFL G
AN D AS T G O B FL G AN D ( ADJ O R V I N G ) T H EN C ORE 2 H AS
AS E N T l O R AS E N T 2 O R VS EN T l .
" "
WS N 3 : I f th e O b j e c t o f be i s th e < F O RT O V O > s trin g
" "
th e n th e s ub j e c t mu s t b e a l s o . I f th e O b j e c t o f be is th e
F O R T O VO FL G w i l l h ave b e e n se t i n the c o re s o f th e s ub j e c t
an d th e ve rb ph r a s e wh e n the c on c a t e n a t i o n i s ab ou t t o t ak e
p lace .
-
160
$ P O S 3 O R I F C O RE 1 H AS F O RT OV OF L G AN D C O RE 2 HAS D O B FL G
AN D S N AO B F L G T H E N C O RE 2 HAS F O RT O V OF L G .
$ P O S 3 O R I F C O RE 1 HAS T OV O F L G AN D C O RE 2 HAS D O B FL G
AN D S N AO B F L G T H E N C O RE 2 H AS T OV OF L G .
" "
WS N 4 : I f th e ve rb h a s shoul d as i t s te n s e wo rd , th i s
C O RE H AS S H O UL D F L G OF C O RE 2 .
F . V e rb an d C e n t e r R e s t r i c ti on s .
O p t i on a l ,
< AS S E RT I ON VO > m ay h av e on l y th e ve rb . H ow e ve r i n
th i s c a s e , th e ve rb mus t b e i n t ran s i t i ve , i . e . N UL L OB J mu s t
b e on e o f th e p os s i b l e o p t i on s o n i ts OB JL I S T . T h e re fo re
on e ) , i f th e re is n o ob j e c t , OB JL I S T o f th e ve rb mu s t b e
ch e c k e d .
$ P os z OR I F C ORE 2 H AS N U L L O B J FL G THE N N UL L OB J EL
OB J L I S T ( C O RE Z )
Th i s i s the on l y OB J L I S T re s t r i c t i on wh i ch i s i n c l u de d
i n th e b o t tom - u p r e s t r i c t i on c omp on e n t .
-
l61
" "
WV C 8 : I f th e O b j e c t o f be is a p r e p o s i t i on a l ph r a s e
" " "
an d th e p re p o s i t i on i s s i n ce th en th e s ub j e c t mu s t b e it "
"
T h u s w e may s ay I t i s s i n c e S un d ay th a t th e y h ave b e e n
" " "
vi s i t i n g . but not Th e i r v i s i t i s S i n c e S un d ay .
" "
$POS 4 OR I F C O RE 2 HAS D O BF L G AN D S I N CE T H E N C O RE 1
" "
HAS IT .
G . Wh - S t r i n g R e s t r i c t i on s .
WWH Z : Nul l a l te rn at i ve s i n p ro du c ti on s a re ve ry d i f f i c u l t
to h an d l e i n n od a l S p an s p a r s i n g . Th e re f o re th e y h a ve b e e n
i n s tri ng s . T he s ub j e c t o f an a s s e r ti on c an b e omi t te d i n
" "
ce r t a i n wh - s trin gs , as in T h e m an who c ame t o d i n n e r .
"
H e r e th e a s s e r t i on is c ame t o d i n ne r . Th u s ,
< S UB JE C T >
is m a rk e d a s O p t i on a l i n th e p r od u c t i on fo r < AS S E RT I ON > .
B u t a s s e r t i on s w i th omi t t e d s ub j e c t s c an o c c u r on l y i n
c e r t a i n c on s t r u c t i on s . H e n ce th e omi s s i on of th e s ub j e c t
mu s t b e d e te c te d an d a f l a g s e t t o s i gn a l th i s f a c t . Thi s i s
IF S P AN l IS NL T H EN C O RE HAS N U L L S UB J FL G .
"
i n th e s e n te n c e Th i s i s th e b ook wh i ch I re a d Wh e n
-
l6 2
i s don e w i th t he re s t r i c t i on
Th e a s s e r t i on S t r i n g m ay c a u s e d i f f i c u l t i e s i n th i s re g a rd
f o r th e s ub j e c t an d th e O b j e c t c o u l d b o th c on t a i n omi tt e d
e l e me n t s . T h u s th e re mu s t b e a re s t r i c ti on ho u s e d a t
T h i s re s t r i c t i on s t a t e s th a t i f C O RE 1 c on t a i n s an y f l ag
wh i ch i n d i c a te s an omi s s i o n the n C O RE 2 c an n o t , an d c on
ve r s e l y . T h e re s t r i c t i o n w i l l n o t b e w r i t ten out he re as
i t i s b u l k y ; th e re a de r is re fe rre d to A pp e n d i x B .
C O RE H AS VH AVE B E D O FL G O F C O RE 2 .
Th e C omp l e te A l go r i thm
Th e comp l e te p a r s i n g a l g o r i thm i s e s s e n ti a l l y th a t o f
S e c t i on b u t s e ve r a l mod i f i c at i on s d i s c u s s e d ab ove h a ve
b e e n ma de . A n a t omi c n ode i s ge n e r a te d f o r e a c h c a te g o ry
o r me an i n g of a word . B e f o re a n ew S p an i s f o rme d a c a l l to
re s t r i c t i o n te s t ( de f i n e d i n S e c ti on i s ma de to e xe c u t e
-1
64
th e re s t r i c t i on s h ou s e d at th a t p oi n t i n t h e g r amm a r .
re s t r i c t i o n te s t r e tu rn s th e va l ue p p p wh i ch re p o r t s wh e t h e r
or n o t the re s t r i c t i on s h a ve s u c c e e de d . re s t r i c t i o n te s t
also r e t u rn s th e c o re o f th e n ew s p an is new c o re
if the r e s t r i c t i on s s u c c e e d . Th e c o re o f a n o de is i n c l ud e d
i n th e s p an a s o ne o f i t s d e te rm i n e r s an d i s e x t r a c te d w i th
th e f un c t i on c o re . I n f o rmi n g th e new c a n d i d a te s l i s t s th e
op t i m i z a t i on s ug g e s t ed i n S e c t i on is i mp l eme n t e d : W he n
a ve rb i s e n c o un t e r e d , f i rs t o f a l l i t s po s s ib l e s u c ce s s o r s
' '
e xc e p t ob j e c t is ad de d t o th e l i s t t o ge th e r w i th f i r s t
O f e ve ry O p t i o n O f O b j e c t g i ve n i n O B JL I S T of th e ve rb .
O t h e rw i s e t h e a l g o r i thm an d ex te rna l s a re t h os e O f S e c t i on
A w o r d i s s t o re d a s a t re e s t r u c tu r e as de s c r i b e d i n
S e c tion Th i s t re e i s vi ew e d a s a set wo rd t og e th e r
w i th th re e f un c t i on s : l i te r a l wh i ch p i ck s out th e ro o t n o de
O f th e wo rd , d e s c wh i ch re t u rn s th e se t o f de s c e nd e n t s fo r
e a ch n od e i n th e t r e e , an d n ame wh i ch re tu rn s th e n ame o f
a n od e , i . e . th e l i t e r a l s p e l l i n g o f th e r o o t n od e , th e n ame
O f th e a t t r i b u te o r c a te go ry f o r th e o th e r no de s . Th u s to
e xt r a c t th e s e t of c a te g ory n od e s of a w o r d c o r re s po n d i n g
to its d i f f e re n t me an i n g s , w e ap p l y th e f u n c t i on c a t e go r i e s
de f i n e d as :
d e f i ne f c a te g o ri e s ( wo r d ) ;
re t u rn e n d c a te g o r i e s ;
I n the m a i n a l go r i t hm g i ve n b e l ow , i t w i l l b e a s s ume d
th at re s t r i c t i o n te s t r e tu rn s a s th e v a l u e p a s , th e i n te ge r 0
-
165
i f a l l re s t r i c ti on s p as s an d s ome n on z e r o i n te ge r o the rw i s e .
as s ume # s g h i e r is 0 . Th i s c on d i t i on an d a l l th e re f e re n c e s
t o th e f un c t i on s
gv a l a re e xp l a i n e d i n S e c t i on F o r th e
momen t , th e y may b e i gn o re d .
de f in e p ar s e ;
th e fo l l ow i n g a re as s ume d to b e g lob a l : s e n te n c e , s n,
re f , r oo t, e ta , ka y , j a y, j ay l, p o s i n i t f lg , n e c i n i t f lg ,
p o s te e g, p os s ua , pee, q ue , d i v li s , c a n d s wi t c h, fi r s t ,
c ore , ca tn o d e , s g hi e r
if c a n d sw i t ch th en c a nd l i s t ( O) fi rs t ( ro o t ) ;
(l Vi sn ) wo r d s e n te nc e (i) ;
s t a ck up a l l me an i n g s o f i th wo rd
if n c an d s w i t ch or n am e ( ca t) €
c and li s t ( i -
l) th en s t a ck s t a c k w i th
(<i
is x) ; d i vli s (x ) cat ;
s g va l (x ) 0 ; (l)
en d V e a t ;
f o r e ve ry s p an on s t a ck an d e ve ry oc cu r re n c e o f
s ymb o l i n g r amma r
( Vs p a ne s t a c k d o i n g s t ac k s t a ck l e s s S p an ; )
( Vo c c E
f o r e ve ry p o s s i b l y i n i t i a l o c c u r re n ce , g e n e r a te
a n ew s p an
-
l66
mac r o te rm h a nd l;
if ( k a y ( n ew s p ) p g 0 pp p j a y ( n e w s p ) pg 0 ) th en
s t a ck s t a ck w i th ne w s p ; ;
i f t h e n ew s p an i s p o s s i b l y te rmi n a l b u t n o t n e ce s s ar i l y
te rmi n a l , ge ne r a te a n e c e s s a r i ly te rm i n a l s p an an d
s ta ck i t
if p os te rf l g ( o cc ) an d p os s uc (o cc ) ne n1
th e n nu s p
d iv li s ( nu s p )
s gva l ( nu s p ) s gv a l ( new s p ) ;
a d d s p an ( nu S p ) ; s t a ck s t a ck w i th nu S p ; ;
f orm n ew c an d i d a te s l i s t u ti l i z in g Ob j li s t O p t i mi z at i on * /
if c a nd s w i t c h th en c an d li s t ( i ) c a nd li s t (i)
if e ta ( ne w s p ) E vo s tg l i s t an d eta ( s p an) E ve rb a l l i s t
th en fi r s t [ p os s uc (occ )
e lse i f e ta ( ne w s p ) E vp o s t g l i s t an d e ta ( s p a n ) E ve r b a l l i s t
th e n
else e ndm ;
macro a d d s p an ( spn ) ;
s e e i f s p an h a s b e e n g e n e r a te d a l re ady
if (38 p a E
( S pn)
' '
f ( spa ) pg f ( spn) ) an d e ta ( S pn) ne Ob j e c t an d e ta
'
)
'
ne p a s s ob j
if so , mo d i fy th e d i v i s i on s l i s t of th e e x i s t i n g s p an
16 8
th e n d i vli s ( sp a ) d i vl i s ( sp a ) d i vl i s ( S pn) ;
s gv a l ( S p a ) (7)
i f n ot , add th e n ew s p an to s p an s
e l s e s p an s S p an s w i th S pn ; e n dm ;
The r ou t i n e f o r ch e ck i n g OBJ L I S T an d P OB J L I S T
r e s t r i c t i on s i s a s f o l l ow s :
de f in e p as 0 ;
if ( ( s p anl n1 ) an d ( e t a ( s p an 2 ) Ob j e c t )
' '
ne pg
an d ( e t a ( o c c ) E vo s tg li s t ) )
th e n i f
the n p a s = 0 ; e l s e
vp o s t g l i s t ) )
th e n i f E
th e n p a s = 0 ; else re t u rn ;
en d ob j lis t te s t ;
Th e s e t s v o s tg l i s t , V p os tg li s t , ve r b a l l i s t , an d th e
f un c t i on s Ob j l i s t an d p ob j l i s t a re d e f i n e d as f o l l ow s :
'
a s s e r t i o n vo
'
,
'
ye s no q vo
'
,
'
t s ui ovo
'
}
V p os tg l i s t
ve rb a l l i s t
-
169
d e f in e f Ob j li s t ( c a t ) ;
re t u rn an d n ame ( y ) p g
en d Ob j lis t ;
de fi ne f p ob j l i s t ( c a t ) ;
r e t u rn { x e d e s c ( y ) yE d e s c ( c a t ) an d n ame ( y ) p g
e nd p ob j li s t ;
Th e I mp l eme n t at i on .
A n od a l s p an s p a rs i n g s y s t e m b a s e d on th e L i ngui s ti c
'
S t r i ng P ro j e c t s g r amm a r is b e i n g imp l eme n t e d on th e C D C 6600
at N ew Y o rk U n i ve rs i ty . Th e s ys tem h a s th re e ph a s e s :
c omp i l i n g , l o adin g , an d p a rs i n g .
Th e c omp i l i n g i s don e b y R a l p h Gr i s hm a n
'
s v e rs a t i l e
7
c omp i l e r wh i ch emp l oy s a t o p - d own p a rs e r an d is u s e d n ow f o r
an d a l s o f o r top - d own p a rs i n g o f E n g l i s h s e n t e n ce s . Th e
s pe c i f i e d b y me an s o f a BN F g r amma r e x t e n de d by a sm a l l
n umb e r o f l o ok — ahe ad an d ge n e r a to r r ou t i n e s . Th e re s t r i c t i on s
e xp re s s e d i n th e me t a l an g uage a re re ad i n , p a r s e d an d c omp i l e d
b y th e G r i s hm a n comp i l e r a c c o rd i n g t o th i s me t a l a n gu ag e
S p e c i f i c at i on . T h e p r o ce s s i s i l l us t r a te d i n F i g u re 1 .
" "
R a lph G r i s h m a n ,Th e I mp l eme n t a t i on o f the S t r i n g P a r s e r ,
-
170
L i n k e d l i s t s p rod u c e d by th e c omp i l e r i n d i c at e th e ho u s i n g
s pe c i f i c a t i on s . T h e s e s pe c i f i c a t i on s a re p l a c e d i n th e
c or re s p on di n g e n t r i e s o f th e i n ve r s e g r amm a r .
Th e s e f i r s t tw o ph a s e s n e e d b e re p e at e d on l y a f t e r th e
g r amma r has b e e n ch an ge d .
A t th e s t a r t O f th e p a r s i n g p h as e , th e l e x i c a l s c an an d
d i c t i on a ry l o ok up r ou t i n e s o f G r i s hm a n
'
s s y s t e m p ro vi de th e
pa r s e r w i th th e di c ti on a ry e n t ry for e a ch wo rd i n th e
E n g l i s h s e n te n c e to be p ars e d . Th e p a r s e r i t s e l f i s b as e d
on th e me r g i n g p a rs i n g p ro g r am us e d t o ge n e ra te th e s t a t i s t i
c a l re s u l t s o f C h ap t e r 4 . It is e x te n de d as i n d i c a t e d i n
th e p re vi ou s s e c ti on . Th e r ou t i n e s o f th i s p a r s e r a re
o r g an i z e d on th re e l e ve l s :
L e ve l 1 : r ou ti n e s wh i c h g ove r n th e f l ow o f th e al go ri t hm .
L e ve l 2 : r ou t i ne s wh i ch d e al w i th th e d at a s t ru c t u re s .
L e ve l 3 : r o u t i ne s i n vo l ve d w i th how i n fo rm at i on i s
p a ck e d i n t o th e ma ch i n e w o rd s .
Thus , i f th e p a r s e r we re t o b e c on ve rt e d to an ot h e r ma ch i ne ,
on l y L e ve l 3 r ou t i ne s wo u l d h a ve to b e rew r i t t e n . I f i t we re
de s i r ab l e to re vi s e th e d at a s t ru c tu re s , on l y L e ve l 2 an d s ome
L e ve l 3 r ou t i ne s w o u ld n e e d a l te r at i on . D u r i n g th e n od a l s pan s
pa r s i n g , c al l s a re ma de to a r o u ti n e wh i ch e xe c u te s th e
re s t r i c t i on s . Th i s s e gmen t o f th e p r o g r am i s b a s e d on th e
S E TL S pe c i f i c a t i o n s o f S e c t i on T h e o u tp u t o f t h e
pa rs e r i s a con c i s e l i s t i n g o f a l l i n te rp re t a t i on s o f th e
s e n te n c e , s i m i l a r t o th e o ne e xh i b i te d i n S e c ti on
Th e s e mi g r a mm a t i c a l i t y O p t i on s d e s c r ib e d i n th e n e x t
ch ap te r a re a l s o b e i n g imp l e me n te d .
-
l72
CH AP T E R 7 . AN A LGO RI T H M I C AP P ROACH T O S E M I G RAMMAT I C AL I T Y .
I n t ro d u c t i on .
One go a l O f t h e s t u dy o f s y n t ax i s t o i d e n t i fy th e
g r ammat i c a l s e n t e n c e s . B u t th e c l as s of g r amma t i c a l s e n te n c e s
h a s a f u z zy b oun d a ry , no t on e th a t c an b e s h a rp l y d e l i n e a te d .
T h e l e as t a th e o ry o f s y n t a x s h o u l d h op e f o r i s to i de n t i fy
th o s e s e n t e n c e s wh i ch a re un q u e s t i on ab l y g r amma t i c a l an d
tho s e wh i ch a r e un q ue s t i on ab l y un g r amma t i c a l . B e y on d th i s
i t s h ou l d i mp os e a mo re o r l e s s re f i n e d g r ad a t i on up on th e
un g ramma t i c a l . C o r re s p on d i n g l y , a c omp u te r p a r s i n g p r og r am
ou gh t to re p o r t n o t on l y wh e th e r a s e n te n c e is g r amm a t i c a l
" "
but also fo r th o s e s e n te n c e s wh i ch a re nea rly g r amma t i c a l
j u s t h ow f a r f rom th e g r amma t i c a l th ey a re . Th e an a l y s e s
o f the s e s e m i g r a mm a t i c a l s e n t e n ce s sh o u l d p i np o i n t wh e re
an d fo r wh a t re as on th e s e n te n ce f a i l s t o b e g r amma t i c a l .
W e c e rt a i n l y s e n s e th a t s ome p a r t i a l l y g r amm a t i c a l
s e n te n c e s a re c l o s e r t o th e g r amma t i c a l th an o th e r s . Fo r
e x amp l e , th e s t r i n g
" "
Th re e me n f l i e s to L on d on .
s e ems m o re n e a r l y g r amm at i c a l th an th e s t r i n g
" "
T h i n k s f l i e s to L o n don .
an d th e r e a re s ome wh o wo u l d s ay th a t
" "
F a l s e ho od f l i e s to L on d on .
is unq ue s t i on ab l y g r amma t i c a l . O n e w ay to v i ew s e m i g r a mm a ti
- l7 3
ca l i ty i s t o s ay th at a s e mi g r a mm a t i c a l s e n t en c e i s a s t r i n g
o f w o rds wh i ch f a i l s to b e g r ammat i c a l b e c au s e o f i n f r a c t i on s
O f ru l e s o f th e g ramma r , wh i ch h owe ve r a re n o t s e r i ou s
T h e n th e e x i s t e n c e O f de gre e s O f s e m i g r a mm a t i c a l i ty w ou l d
i mp l y th a t s ome ru l e s h a ve mo re fo r ce th an o th e r s . For
e x amp l e , th e ru l e p r oh i b i t i n g a te n s e d ve rb f r om th e s ub j e c t
po s i t i on h a s mo re f o r c e th a n th e ru l e re q u i r i n g n um b e r
a g re eme n t b e tw e e n s ub j e c t an d ve rb , an d b o th h ave mo re f o rc e
th an s e l e c ti on a l c on s t r a i n t s b e twe e n th e s ub j e c t an d ve rb .
Th e r e fo re we o ugh t t o be ab l e to ch a r a c te r i z e th e de g re e s
of s e m i g r a mm a t i c a li ty b y a s s i gn i n g th e ru l e s to d i f f e re n t
c l as s e s i n a h i e r a r ch y c o rre s p on d i n g to th e i r fo r ce .
The d i f f i c u l ty w i th th i s app ro a ch i s th at a go od ma ch i n e
g r amm a r is n ot n e ce s s a ri l y a c og n i t i ve mo de l , an d th e d e gre e s
w i th o u r i n tu i t i ve fe e l i n g s ab o u t th e s e n t e n ce s . Fo r e x amp l e ,
the s e n te n c e
" "
S c i e n t i s t s t r u th th e un i ve r s e .
i s un g r amma t i c a l b e c a us e a n o un i s i n th e ve rb p o s i t i on .
T h e s e n te n ce
" "
S c i e n t i s t s b a l c on y th e un i ve rs e .
an d h e n c e i s mo re a c ce p t ab l e th an th e s e c on d , wh i ch do e s n o t .
The g re a t e r a c c e p t ab i l i ty o f th e f i rs t p rob ab l y c an n ot b e
c ap tu re d i n a n a t u r a l way w i th i n an y th i n g l e s s th an a f a i r l y
-
174
l i k e l y g oe s de e p , i n t o th e l e ve l of t h e me an i n g o f th e w o rd
i ts e l f . F o r e x amp l e , i f on e s ay s
" "
G l y c os i de s l u rk on e ve ry gh e t t o s t re e t c o rn e r .
i t i s p r ob ab l y b e c au s e he h a s mi s un de rs t ood th e me an i n g
" "
of g l y c o s i de
I t w ou l d s e e m th a t a l l th re e typ e s o f s e mi g r a mm a t i c a l i t y
a re w or thy o f s tu d y , S in ce a l l th re e oc c u r i n te xt s th a t a
p a r s i n g s y s t e m may b e re qu i re d t o an a l y z e . I t d oe s n o t s e em
po s s ib l e to s ay th a t on e typ e O f s e m i g r a mm a ti c a l i ty i s mo re
" "
s e r i ou s th an an o th e r . A p un c t u a t i on e rro r c au s e s a s e n te n c e
t o b e l e s s d e vi an t th an a s e l e c t i on a l v i o l a t i on , a n umb e r
e r r or ge n e r a l l y mo re s o . F r a gme n t s c an o c c u r on e ve ry l e ve l .
I n th e n e x t s e c t i o n an a l g o r i t hm d e s i gn e d t o y i e l d
i n f o rmat i o n ab o ut s e mi g r a mm a t i c a l s en te n c e s i s g i ve n , an d
i n th e f o l l ow i n g s e c t i on a c l as s i f i c at i on of th e re s t r i c ti on s
i n to a h i e r a r ch y is s u gg e s t e d .
The A l g o ri thm .
T he s e m i g r a mm a t i c a l i ty h i e r a r c hy may b e se t up i n on e
o f th re e w ay s . Th e u s e r may e mp l oy the h i e r a r ch y s pe c i f i e d
i n the s y s te m ; th i s i s e x p l a i n e d i n th e n e x t s e c ti on . H e m ay
(i . e . $ P UN C , $SEL1 , $W S , b u t re o rd e r th em . F i n a l l y he
may d e f i n e h i s own c l a s s e s o f r e s t r i c t i on s . T he l a s t i s a
g o o d d eb ug g i n g de vi c e f o r he m ay s pe c i fy tho s e re s t r i c ti on s
he s u s pe c t s t o b e c a u s i n g a g r amma t i c a l s e n te n c e n ot t o b e
ac ce p te d an d l i f t them s e ve r a l a t a t ime . I n th e S E TL p r og r am
-
176
b e l ow th e h i e r a r c hy i s c a l l e d s
gh i e r an d i s r e p re s e n te d
as an n — t up l e
As n ot e d i n S e c ti o n a s l i gh t mo d i f i c a t i on i s re q u i re d
in re s t r i c t i o n te s t . I n s t e a d o f re t u rn i n g t or f as th e
va l ue O f p p p , re s t r i c t i o n te s t r e tu rn s a n ume r i c a l va l ue
ze ro i f i t p as s e s , th e l e ve l O f g r amm a t i c a l i ty i f th e
re s t r i c t i on vi o l a te d i s i n th e h i e r a r ch y , an d o ne mo r e th an
the n umb e r o f c l a s s e s i n th e h i e r a r ch y o th e rw i s e . Fo r
e x amp l e , i f th e h i e r a r chy i s
a g r amma t i c a l c on s t r u c t i on wo u l d re c i e ve a v a l ue o f 0 , an d
a c on s t r u c t i o n w i th a p un c t u a t i on e r ro r the va l u e 1 , a
s t ron g s y n t a c t i c e r ro r th e v a l ue 4 , an d a p o s i t i on a l re s tri c
t i on vi o l a t i on 5 . Th e S p an s a re f o rme d fo r g r amm a ti c a l
c on s t ru c ti on s an d th o s e vi o l a t i n g on l y re s t r i c t i on s i n th e
h i e r a r ch y . Th u s , i n th e a l g o r i thm of S e c t i on in l i nes
(3) an d th e c on d i t i on
p as le # s gh i e r
me an s th at an y re s t r i c t i on s vi o l at e d w e re i n th e h i e r a r chy ,
an d a n ew s p an i s f o rme d on l y i f th i s c on d i t i on h o l d s .
A va l ue g i ve n b y th e f un c t i on pgyp l is a s s o c i a t e d w i th
e ve ry s p an an d i n d i c a t e s th a t s p an s l e ve l '
O f g r amm a t i c al i ty .
-1 77
o f s p an s i n e a ch s e t . M o re p re c i s e l y , wh e n a n ew s p an is
f o rme d f r om th e c on c a te n at i on of a f i rs t s p an an d a s e c on d
s p an , th e pgyp l o f th e n ew S p an is th e m ax i mum o f p p p , th e
( of . l i ne ( 5) o f th e a l go ri t hm i n S e c t i on A s p an
c an n o t b e mo re g r amma t i c a l th an i t s imme d i a te d e s c e n d an t s .
b e g r amm at i c a l ; n o re s t r i c t i on s ap p l y a t th a t p oi n t ( c f . l i ne
re s t r i c t i on s b e i n g ap p l i e d , th e pgyp l O f th e n ew s p an i s
t i on ; are me rg e d u n de r th e s a me s p an , t h e pgyp l o f th i s s p an
is th e mi n imum s
gv al O f th e tw o i n t e rp re t a t i on s . Al l of th i s
i s i l l u s t r a te d i n F i g u re 1 .
Two i n te rp re ta t i on s me rge d un d e r on e S p an
s g va l= 2
wh e n me r g i n g
0
t ak e m i n
s gva l= 2 s v a l = 3
g
r e s t r i c t i on a l l re s t r i c wh e n
O f l e ve l 2 t i on s p a s s e d
c on c a te n a ti n g
vi o l at e d y
<
p I B I r > <
p p 8 ' r > t ak e max
l l 2 2
=l =0 l= 3
s g v a l s g v a l s gva l= 0 s g va
-
178
l ook f o r r oo t s ymb o l s S p an n i n g e n t i re s e n te n c e
pg an d s g va l (x ) 1e l e ve l } ; if w ne n1
f i n d t he i r de s c e n d an ts
the n suc ce s s ( l e ve l ) t; ( Vw ) d ow n (x ) ; e n d Vx ; re t u rn ;
i f n on e , f i n d ma x i ma l i n t e re s t i n g s ub s t r i n g s an d
th e i r de s c e n d an ts
else ww an d pg 0
<
, 0>
an d s gv a l (z) 1e l e ve l } ;
w ww - {y gp pee ( z ) an d q ue ( y ) 1e q ue ( z ) ) or
( pee (y ) gp _ p e e ( z ) an d q ue ( y ) 1t
( Vye w ) d own ( y ) ; e n d Vy ; ;
e n d Vl e ve l ; re t u rn ; e n d re a d of f;
d e f in e d o wn (x ) ;
a dd s p an x to p a r s e t re e s
p a r s e t re e s ( l e ve l ) p a r s e t re e s ( l e ve l ) w i th x ;
if d i v li s (x ) pg i s xx ) th en
r e t u rn ; ;
f i n d v a l i d d e s c e n d an ts o f x
if ( Vz E y Is g va l ( z ) 1e l e ve l )
the n wi t h y ;
(s e
y) d ow n ( zz ) ; end s ; ;
e n d Vy ; r e t urn ; e n d d own ;
T he H i e r a r ch y .
W e l l - F o rme d S ub s t r i n g s : W he n th e p a r s e r c an n ot re c ogn i z e
a s e n te n c e i n th e i np u t s t r i n g a t a g i ve n l e ve l of g r amm a t i c a l i ty ,
i t re p o rt s th e m a x i m a l we l l - fo rme d s ub s t r i n g s wh i ch a re
-
180
" "
i n te re s t i n g an d th e i r an a l y s e s .
"
Th e s t r i n g s wh i ch a re con s i de re d i n t e re s t i n g b y th e
p re s e n t i mp l e me n t a t i on a re l i s te d b e l ow . I n g e n e r a l th e y
a re s t r i n gs wh i ch a re c omm on or i mpo r t an t e n o ug h t o b e g i ve n
n ame s i n e l e me n t a ry g r amm a r s , s t r i n g s wh i ch o c c u r f re q ue n t l y
i n the g r amma r , an d s t r i n gs wh i ch a re e as i l y d i s t i n g ui s h e d
an d Op e n to l i t t le amb i g u i ty . S p e c i a l s t ri n g s wh i c h ap p e a r
on l y in the O b j e c t p os i t i on h a ve n o t b e e n i n c l u de d .
T he c e n t e r s t ri n g s wh i c h can b e p a r t o f l a rg e r s t r i n g s :
T he mo s t c ommon or d i s t i n c t i ve s e n te n ce n omi n a l i z at i on s :
Th e ve rb Ob j e c t s t r i n gs : < AS S E RT I ON V O > ( th e V e rb
Ph ras e ) ,
< VE N O > ,
< VE NP AS S > ,
<V I N GO > ,
< VO >
,
< T OVO > .
Th e p re p o s i ti on a l p h r a s e : < PN > .
S ub o r d i n a t e c l a u s e s b e g i n n i n g w i t h s ub o rd i n a t e c on j un c
t i on s : < S UB O > ,
< S UB 1 5 ,
< S UB 2 > ,
< S UB 3 > ,
< S UB 4 > ,
< S UB 5 > ,
< S UB 6 > ,
< S UB 7 > ,
< S UB 8 > .
Th e wh - s t r i n gs : < WH E TH S > ,
< WH E TH T O V O > ,
< WH S - N > ,
< W HN S - N > ,
< PW H S - P N > < P W HN S - PN > < P WH S > < P WH N S > < WHAT S - N > < WH E RE S >
, , , , , ,
< WH EN S > ,
< T H AT S - N > ,
<S AW H I C H S T G > ,
< W H EVE RS -
N> .
~1 8 1
C l as s i f i c at i on o f Re s t r i c t i on s : Th e r e s t r i c t i on s s e e m
t o f a l l i n to th e fo l l ow i n g c l a s s e s °
1 .
$ RA RE : T he s e re s t r i c ti on s p roh i b i t c on s t ru c t i on s
wh i c h a re n o t ne ce s s a r i l y i n c or re c t b ut o ccur i n f r eq ue n t ly .
E x amp l e s O f s e n te n ce s re j e c te d by $ RA RE r e s t ri c t i on s
i n c l ud e
" "
The s e a re p rob l em s I ve s o l ve d ( N o rm a l l y a n o un
'
.
wh o s e r i gh t a d j un c t is an a s s e r ti on w i th a z e roe d n o un
t ak e s an ar t i c l e or q u an t i f i e r i n th e l e f t ad j un c t :
" '
Th e s e a re th e p rob l ems I ve
" "
H e i s a l l th i n gs t o a l l p e op l e . ( N o rm a l l y the
s ub j e c t an d O b j e c t - O f - b e ag re e i n n u mb e r ) .
$ RA RE i s th e on l y s e mi g r a mm a t i c a l i t y c l a s s i n c l u de d i n th e
g r amm a r f o r th e t op — d own p a r s e r , wh e re i t i s a c t i v a te d by
th e RA RE S WI T CH .
I n a d d i ti on to $ RA RE r e s t r i c t i on s th e re a re $ RA RE
c on s t r u c ti on s i n th e BN F c omp on e n t . F o r e x amp l e , th e
un de r l i n e d c on s t ru c t i on ,
"
J ohn j u ggl i n g th re e p l a te s a t on ce is a s i gh t to b e ho l d .
r a re l y o c c u rs i n th e s ub j e c t p o s i t i on . Th e s e c on s t ru c t i on s
a re i n d i c a te d by a mi n u s s i gn j u s t b e f o re th e O p t i on i n th e
g r amm a r . A re a s on ab l e e x te n s i on o f th e s e m i g r a mm a t i c a l i t y
h i e r a r ch y mi gh t b e t o de f i ne th e o th e r c on s t ru c ti on s i n th e
BN F c omp on e n t f o r l e ve l s o f g rammat i c a l i ty o th e r th an $ RA RE .
2 .
$ P UN C : Th e p un c t ua t i on re s t r i c ti ons i nc l ud e r ul e s
~ 1 82
th e p r e s e n t t i me few ve rb s b an i n an im a te s ub j e c t s , a
c on s t r a i n t n e e d e d to d i s amb i gu a te
" "
L e ap i n g fe n c e s c an be d an ge ro u s .
A mo re s i gn i f i c an t e x te n s i on wo u l d b e po s s i b l e i f the
tre e - l i k e s t ru c tu re o f e n ti r e s i n ti ma l e x i c o n w e re m o re f u l l y
de ve l op e d . F o r e x amp l e , a s e l e c ti on a l re s t r i c t i on re qu i re s
" " "
a ti me n ou n in a a go , e .
g . an h o u r a go . L i ft i ng
" "
th i s re s t r i c t i on a l l ow s th e ph r as e a g r i e f ag o , wh i c h h a s
p ow e r as a me t aph o r . T h i s me t aph o r m ay s e e m r a th e r a r e s u l t
"
O f the me an i n g O f gri e f , b ut i n fa ct o ne c an i mag i n e
c an f i t re a s on ab ly we l l i n to th e p h r as e :
"
? " "
Wh e n d i d yo u s t a r t w r i t i n g y ou r d i s s e r t a t i on Th re e
"
ty pe w r i t e r s ag o .
"
On th e o th e r h an d , ma s s n oun s f i t mu ch l e s s we l l c ot t on
" "
a go an d w o rd s o th e r th an n oun s no t at all a th e a g o
I f th e a tt ri b u te s a re s t r u c t u re d a s
N O UN
N COUN T
N T I ME
c on s t r a i n ts in v o l v i n g th e l ow e s t l e ve l a t tr i b u te s c an b e
l i f te d f i r s t , th e n tho s e f o r th e n e x t l e ve l , e tc . Th i s
p roc e du re w o u l d y i e l d a ri ch e r h i e r a r ch y o f s emi g r a mm a t i c a l
s e n t en c e s l .
(I t is fo r th i s p o s s ib l e e xp an s i on th a t w e h a ve
Th i s i s s ub s t an ti a l l y th e p rog r am p r op o s e d by N o am C h oms k y
" "
i n S ome Me th o d o l og i c a l Rema rk s on G e n e r a t i ve G r amm a r ,
W o rd 1 7 P 2 1 9 -
2 39
.
-
184
l ab e l l e d the c l as s $ S E L 1 ) .
An o th e r p o s s i b l e e x te n s i on i n v o l ve s s ub l an g u a g e s s p e c i f i c
to p a r t i c ul a r f i e l d s . C e r t a i n ve ry t i gh t c on s t r a i n t s h o l d i n
s ub f i e l ds o f s c i e n c e s wh i ch d o n o t h o l d i n th e s c i e n c e as a
w ho l e no r i n s c i en t i fi c E n g l i s h o r g en e r a l E n g l i s h as a wh o l e .
F or e x amp l e , i n th e s ub f i e l d o f ph a rm a c o l ogy , th e p h r a s e
" "
ch an ge s i n c e l l s p r od u c e d b y d ru g s
is un amb i g uou s , fo r d r ug s c an p r od u c e ch an g e s b ut n ot c e l l s .
On th e o th e r h an d , on e c an i ma g i n e a p a p e r s omew h e re i n th e
l a r ge r f i e l d o f b i ol ogy wh i c h d i s c u s s e s d ru g s p ro du c i n g c e l l s .
O n e c an c on s t ru c t a h i e r a r chy o f s e l e c ti on a l re s t r i c t i on s
c o r re s p o n di n g t o th e l e ve l O f th e s ub l an g u a ge . I n a d d i t i on
to th e i r i n c r e a s e d d i s amb i g u a ti n g p ow e r th e s e re s t ri c ti on s
an d th e d e v i c e fo r l i f t i n g th e m c ou l d b e u s e d i n an i n f o rma
t i on r e tr i e v a l s y s t em to d i s t i n g u i sh b e tw e e n s e n t e n ce s s t r i c t l y
i n th e s ub l an g u a g e an d s e n te n ce s i n s c i e n t i f i c E n g l i s h a s
a wh o l e , t h u s n a r row i n g i n on th e f i e l d - s p e c i f i c i n f o rma t i on
o r h a rd f a c t s o f th e s c i e n t i f i c a r t i c l e .
4 . $WS : Th e we ak s yn t ac t i c r e s t r i c t i on s a re f ew b ut
i n c l ud e c oun t n o un an d s ome c as e re s t r i c t i on s . Th e c on s t r u o
" " "
t i on re q u i r i n g wh om r at h e r th an wh o
'
b e fo re a wh - s t ri n g
w i th an omi t te d O b j e c t o r ob j e c t - o f - p rop o s i t i on i s i n th i s
cl as s . Th u s , the s e n t en c e
" "
Th e re i s the m an wh o I k n ow yo u s aw y e s t e r d ay .
w i l l n ot b e re c o g n i z e d un t i l th e $ WS c l a s s i s l i f t e d . The
d i s t i n c t i on b e twe e n we ak s y n t a c t i c an d s t r on g s yn t a c t i c
-
185
re s t r i c t i on s i s s omewh at a rb i t r a ry , b u t c o r re s p on ds r o ugh l y
to th e i n t u i t i ve f e e l i n g o ne m i gh t h ave abo u t th e s e ri o us
n e s s o f a vi o l a t i on .
Th i s c l as s co u l d b e b rok e n i n t o s e ve r a l l e ve l s i n a
m an n e r s i mi l a r t o th e s e l e c ti on a l re s t r i c t i on s . F o r e x amp l e ,
th e p h r a s e
"
w as i n j e c te d i n to th e mu s c l e t i s s u e o f gui ne a p i g , r at ,
"
an d m an
i s g r amm at i c a l i n th e s ub l an g u ag e O f ph a rm a c o l ogy , e ve n
" " "
th o u gh gui ne a p i g an d rat a re c oun t n oun s i n ge n e r a l
Eng li sh an d re q u i re a r t i c l e s .
5 . $S S : Amon g th e s t ron g s yn ta c t i c r e s t r i c t i on s a re
b e twe e n a r t i c l e an d q u an t i f i e r , an d b e twe e n a n o un an d i ts
" "
app o s i t i ve , th a t re q u i r i n g th e ob j e c t o f b e twe e n an d
" "
amon g to b e n on s i n g u l ar o r ag g r e g a te , an d th at a l l ow i ng
l i fe Mo s t c a s e re s t r i c t i on s a re i n th i s c l a s s a s
we l l , i n c l ud i n g th o s e p roh i b i t i n g s u ch s e n te n c e s as
" "
H e w a n t s y o u an d I to see h im .
" "
Th at i s th e b oy whom I th i n k b rok e th e v a s e .
6 . $ P OS S : T h i s i s a s pe c i a l c l a s s i f i c a t i on o f
p o s i ti on a l re s t r i c t i on s wh i ch s h o u l d p rob ab l y b e i n c l ude d
i n th e c l a s s $ P O S 4 . I t c on t a i n s c oo c c u r r e n c e c on s tr a i n t s
on t h e p re p o s i t i on s and ad ve rb i a l p re p o s i t i on s wh i ch c an
o c cu r i n ob j e c t s t ri n g s f o l l ow i n g p a r t i c u l a r ve rb s . In
-
186
an a l y s i s th e BN F c omp on e n t w ou l d oth e rw i s e p ro du ce . Th e re
a re no re s t r i c t i on s i n th i s c l a s s at th e p re s en t t ime
an d i t i s h op e d th e y w i l l b e avo i de d .
Th e o r de r i n wh i ch t he s e c l a s s e s a re l i s t e d s e ems t o
b e th e mos t r e a s on ab l e o r d e r i n g o f th e h i e r a r ch y , w i th th e
c l as s e s $ RA RE , $ P UN C , $SEL1 , $ WS , $S S , b e i n g s u c c e s s i ve ly
l i f te d . Th e us e r m ay o ve r r i d e th i s w i t h his ow n o rde ri ng
i f h e w i s h e s o r h e m ay de f i ne his own c l a s s e s e x te n s i on al ly .
O f cour s e th e mo re c l as s e s O f re s t r i c t i on s o ne w an t s to
h ave l i f te d , th e mo re th e S p an s th a t w i l l b e g e ne r a te d ,
b r i n gi n g o ne c l os e r t o th e s i tu a t i on d e s c r i b e d i n C h a p t e r 4 .
~ 188
B I B L I OG RAP H Y
1 . B l o om f i e l d , L e on a r d , L an gu a ge , N ew Y o rk , 19 3 3 .
2 . B ros s , S h ap i r o , P . A .
, an d An de rs o n , B . B .
,
" "
H ow I n f o rma t i o n is C a r r i e d i n S c i e n ti f i c S ub l an g u a ge s ,
S ci enc e , J un e 19 72 , p . 1 30 3- 1 30 9 .
"
C h e a th am , T E . .
, an d S a t t l ey , K .
, S y n t ax - D i re c te d
"
C omp i l i n g , P ro c e e di n gs of E a s t e rn J o i n t C omp u t e r C on f e r
e n ce , AF I P S , Vo l . 25 , 19 6 4 , pp . 3 1- 5 7 .
" "
On C e r t a i n F o rm a l P r op e r t i e s o f G r amma r s ,
I n fo rmat i on an d C on t r o l , Vo l . 2 , 1 9 59 , pp . 1 3 7-16 7 .
"
S ome M e th o d o l o g i c a l R e m a rk s on G e n e ra t i ve
"
G r amma r , W o rd 17 , 1961 , pp . 2 1 9- 2 39 .
A s p e c t s o f th e Th eo ry o f S yn t ax , C amb ri dg e
Ma s s .
, 19 65 .
W r i t i n g T e ch n i ue s q , N ew Y o rk U n i ve r s i ty , 196 9
9 . B a rl ey , J ay , An E f fi ci en t C on te x t - F r e e P ars in g A l g o r i thm ,
Ph . D . The s i s , C a rn e g i e - Me l l o n U n i ve r s i ty , 19 6 8 .
"
10 . F l oy d , R ob e r t W .
, S y n t a c t i c A n a l y s i s an d O pe r a to r
"
P re c e de n ce , Jo u r n a l of th e ACM , Vo l . 10 , Jul y 1 9 6 3 .
pp . 3 16 - 3 3 3 .
"
ll . Th e S y n t a x o f P r o g r amm i n g L an g u ag e s
"
A S ur vey , I E E E T ran s a c t i on s on E l e c t ron i c C omp ute r s ,
Vo l . E C- 1 3 , A ug us t 19 64 , pp . 346- 353 .
12 . G l e a s on , H . A .
, L i n gu i s t i c s an d E n g l i s h G r amma r , N ew Y o rk
19 6 5 .
-1 89
"
13 . G r i s hm a n , R a l ph , Th e I mp l eme n ta ti on o f th e S t ri ng
Parse r
‘
, i n C ou r an t C omp u te r S c i e n c e S ymp o s i um 8 :
N a tu r a l L an g u a ge P r oc e s s i n g , R . Ru s t i n , e d .
, N ew e k ,
19 73 .
" "
14 . H a rr i s , Zel lig , F r om Mo rph e me t o U t te r an ce , L an g u a ge ,
Vo l . 22 , 19 4 6 , pp . 161- 1 8 3 .
" "
15 . Di s c o urs e An a l y s i s , L an g u age , Vol . 28 ,
1952 , pp . 1- 30 .
16 . S t ri n g An a l y s i s o f S e n te n c e S t r u c tu re ,
Th e H a gu e , 19 6 2 .
" -D "
17 . H ay s , D avi d A u t om a ti c L an gu age ata P roce s s i ng ,
i n C omp u te r A p p l i c a t i on s i n th e B e h a vi o r a l S c i e n c e s ,
H ar ol d B or k o , ed .
, E n g l ewoo d C l i f fs , N . J .
, 1962 ,
pp . 4 11- 4 14 .
H op c r o f t , J o hn E . , an d U l lm an , J e f f r ey D .
, F o rma l
Ma s s .
, 19 69 .
"
19 . I ro n s , E . T .
, A S yn t a x - D i re c t e d C omp i l e r fo r A L GO L
C ommun i c a t i on s o f th e A CM , Vo l . 4 , J a n u ar y 1 9 6 1 ,
pp . 51- 55 .
20 . K a s ami , T .
, an d T o r i i , K .
,
"
A S yn t a x —A n a ly s i s P ro ce du re
"
f o r U n amb i g u o us C on te x t F re e G r amma rs -
, J o u rn a l o f th e
A CM , Vo l . 16 , July 19 69 , pp . 4 2 3-4 31 .
21 . K n ob e , B ru c e , An E xp e r i me n t a l C omp a r i s o n o f th e Effici
e n cy of P ar s i n g A l g o r i thms , Ph . D . Thes i s , N ew Y o rk
U n i ve rs i ty , J un e 1 9 7 2 .
-
19 0
" "
We l l s , R u l on I mme d i a t e C on s t i tue n t s , L an gu age ,
Vo l . 23 , 1947 , pp . 8 1-117 .
"
32 . Y o un ge r , D an i e l H .
, Re c ogn i t i on an d P a r s i n g o f
3 "
C on t e x t F re e-
L an g u age s i n T ime n , I n f o rm a t i on an d
C on t r o l , Vo l . 10 , F eb r u a ry 19 6 7 , pp . 189- 2 0 8 .
Zw i ck y , A rn o l d , F r i e dm an , J oy c e , Hall , B a rb a r a C .
,
"
an d W a l k e r , D on a l d , Th e MI T RE S y n t a c t i c An a l y s i s
"
P ro c e d u re f o r T r an s fo rmat i on a l G r amma rs , P ro ce e d i n g s
o f F a l l J o i n t C omp u te r C on f e re n ce , 19 6 5 , pp . 3 1 7- 32 6 .
19 2
AP P E ND I X A
S T RI N G G R A MM A R OF E N G L I S H FDR B O T T O M -UP P A RS I NG
P RO D U C T I O NS WH O S E R I G H T S I D E S A R E S T R I NG S O F S Y MB O L S ARE F O L L O WE D
BY E XA M P L E S .
S Y M B O L S OF TH E GR A MMA R ARE N A M E S E N C L O S E D I N T R I A N G U L A R B R A C K E T S :
<A S S E R T I O N > ; < t V> y W O R D S WI TH cUT T H E B R A C K E T S ARE E NG L I S H W O RD S : AND.
" " "
T HA T ; W H O . N A ME S B E G I N N I N G W I T H I A R E T E R M I NA L S Y M B O L S O R P A RT S
O F S P E E C H" : < A v> . O T H E RS A R E NO N T E R M I N A L S Y MB O L S : <AS S ER T I ON> .
< AS T O> .
I n T H E N A M E S O F THE S Y M B O L S : THE F O L L O W I N G M N E MO N I C S Y S T E M I S U S E D :
N NO U N
NS P OSS ES S I V E N OU N
PRO P RONOUA
w T E AS E W O RD
V UNTENS ED V E R B
TV T ENSED VER B
VI NO P RE S E N T P A RT I C I P L E O F V E R B
VEN P AST PART I C IPLE OF A VER B
A: A DJ A D J E C T I VE
D A D V E RB
0 DUANT I F I ER
T ART ICLE
P P REPOS I T ICN
DP A D V E R B I A L P RE P O S I T I O N
OS O C8 7 V A R I O U S C L A S S E S DE S U B O R D I N A T I NG C O N JU NC T I O N S
WH WH- WO R D ! WP Oo WH I C H : E T C .
I NT I N T E RJ E C T I O N
T H E S E MAY B E C O N C A T E N A T E D . TP US M E A NS A P R E P O S I T I O N F O L L O WE D B Y
A AC U A; I . E. A P R E P O S I T I O N A L P H R A S E ; AND M E A NS A N O U N F O L L O WE D
" " " "
B Y AN A D J E C T I V E ( I N T H E O B JE C T P O S I T I O ) . N 8 T6 S T AN D S FCR S T RI N G
SC M E A NS N O U N S T R I N G AND M E A NS A S T R I NG 0 F A D VE R B S .
" " " " ME A N S T H E P O S S I B L E V A R I A NT S OF
VAR STA NDS F OR VAR IA T N SO
" " S " "
DE A N O U N . ROS T A N D S FOR P OS IT I ON SO M E A NS T H E A RT I C L E
POS I TI CN I N A N O U N P H R A S E .
" "
A S S E R T I O N S A R E S OPETI P ES R E P R E S E NT E D B Y 8 AND Q U E S T I O N S B Y
" "
THUS M E A NS THE WCRD T HA T F O L L O W E D B Y A N A S S E RT I O N . SUBJECT
" " " " " " " "
I S R E P RE S E N T E D B Y 5 CR SUBJ AND OBJECT BY 0 OR OBJ . E XA M P L E S !
" "
< OBJBE> O B J E C T OF THE V E R B TO BE
" "
<T OV O> N R
I NF I N I T I V E C O S T U C T I O : N THE W OR D TO F O L L O WE D
B Y A V E R B F O L L O WE D B Y A N O B J E C T .
" " " "
< S AS OBJBE> SUBJECT T H E WO R D AS O B J E C T OF THE VE RB TO B E
" "
L S T A N D S F O R " L E F T " AND " R " FOR " R I G H T " . E X A MP L E S :
<L N> L E F T A D JU NC T O F A N O U N
( R V) R I G H T A D J U N C T O F A V E RB
<L NR> A N O U N W I T H I T S L E F T AND R I G H T ADJUNCTS p I . E. A N O U N
P HR A S E
< RS UBJ> A D J U N C T OF THE S U B J E C T P L A C E D TO T H E R I G H T O F T H E
OBJECT.
" "
S TA N DS F OR SENTE CE ADJU CT .
N N
-
l93
"I "
i THE M I NUS S I GN I N D I C A T E S T H A T W H A T F O L L O WS HAS B E E N D E L E T E D F R O M
fi T H E S U B J E C T OR O B JE C T P O S I T I O N O F T H E A S S E R T I O N O R Y E S -NO Q U E S T I O N I N T H E
fi S T RI N G . THUS
i < WHNS - N> WH- W O RD NOUN AS ERTI ON W I T H N O U N D E L E T E D F RO M
i S U B J E C T OR O B J E C T P O S I T I O N .
" "
l THE PREF I X REP I S U S E D I N S O M E RE C U R S I V E P RO D U C T I O N S . THE P R E F I X
" "
i NUL I S U S E D I N P R O D U C T I O N S WH O S E O N L Y I N T E N T I S T O S I M P L I F Y A N O T H E R
i PRODUCT I ON.
i A N A L P H A B E T I C A L L I S T I NG C F T H E N O N T E RM I N A L S Y M B O L S T OG E T H E R W I T H
i T H E N U M B E R O F T H E C O R R E S P O ND I NG P R O D U C T I O N A P P E A RS A T THE E N D O F T H E
l BNF GRAMMAR .
"
l A L T E R N A T I V E S A R E S E P A R A T E D BY A S L A S H "
I . S Q UARE B R A C K E T S " I" " J"
“I !
i I ND ICATE THAT WHAT IS ENCLOSED IS OPT I ONAL . A HYPHEN BEFORE A SY MBOL
i I ND I CATES THAT THE ALTERNAT IVE IS RARE .
" "
l A C F OLLOWS T HE S Y MB OL FOR THE C ORE ELE ME NT OF A STR I NG . AS
l M A T C H I N G W I T H T H E S T R I N G P RO C E E D S : T H E F I R S T E L E M E N T I S T A KE N A S C O R E
E L E M E NT U N T I L THE F I R S T S Y M B O L F O L L O W E D B Y A " C " I S E N C O U N T E RE D . THEN THAT
‘
. E L E M E NT I S T A KE N A S C O R E E L E M E N T U N T I L THE N E XT S U C H E L E M E N T I S E N C O U NT E R E D .
i 1 . S E NT E N C E
i
< YES
< YES
NOQ >
NOGVO>
:8 3
~
< VER8
3 . 1A
t D I D H E H I T T H E B A L L S O L I D L Y O R NOT
< ORNCT> :II O R NOT
( WHo-N> I UI < NUL1WHO- N > < N UL 2 WH O - N> O
A WH A T D I D HE H I T S O L I D L Y
< NUL1WHO ~N> : :I WHO W HO M WHICH WHAT WH O S E S . SA
< NUL2 WHO-N> : :I < YES NOQ > < A S S E RT I O N >
<W HO> : :I < NULWHO> < YES NOQ >
HOW D I D HE H I T T H E B A L L
-
194
‘ VI NGOFN> I II ‘ * VI NGP C [ 0 F] [ ‘ RV> J [ ‘ 3 A> I o
A THE L IF T I N G
O F T H E B L O C K A D E ( S U R P R IS E D E V E R Y O N E )
< L N 2> :II [ < OPOS > J 5 . IOA
< S N> I II <THA TS> < FORTOVO> <T O V O> < S V I NGO>
< C lS HOULD> < S NWH> < THATVI NG>
a
I 6 . S EATENCE NCMI AALIZ AT I ON S T R I N G S SN
i
¢T H A T S> :7 8 T H A T < AS S ERTION> C
A T H A T T H I S L E M M A Is T R U E ( IS O B V I O U S )
< FORTOVO> I II F O R < S UBJECT> C < TOVO> C
A F O R Y O U T O P R O V E T H I S L E M M A ( IS TOO M U C H T O E X P E C T )
<S VI NGC> Al l < NULS VI NGO> < VI NGO> C
t ( O B S E R V E ) T H E S T U D E N T B E C O M I N G HO R E I N T E N T
< NULS VI NGO> < NS TG> < VI NGS TG> 6 .3 A
< THATVI NG, I ll < S N> < VINGO> C
A FOR Y O U T O P R O V E T H I S L E M M A B E I N G C O N S I D E R E D U N L I K E L Y
A ( S H O U L D N O T IN S U L T Y O U )
< C lS HOULD> I ll [ T H A T ] « AS S ERTI ON> C
I T H A T W E P R O V E T H I S L E M M A ( IS I M P E R A T I V E )
< S NWH> I t: < WHETHS > c WHETHTOVO> < WH8 - N> < PWHS >
< PWHs- PN> < WHN8 - N> < PWHNS > < P WHNs- P N>
t
t 7. VERB AND VERBAL OBJE CT S T R IN G S
A
< VERB> <LTVR> < LWR> < LVR> C < LVR>
A BAKES W IL L U N D O U B T E D L Y B A K E ( HAVE HER) BAKE ( A CAKE)
< LTVR> I ll [ < Lv> 1 < * TV> C
A NEVER COOKS GU I CKLY
< LNR> I II < t W> c
A N E V E R W IL L
< LVR> t an ( < LV> J < A v> e
< VENO> I II < LVENR>
A BAKED A CAKE
< LVENR> : 3: < A v5 N> c
< VENPAS S ) I II < LVENR> C
a
B ( I WAS) G IV E N A CAKE BY HER
< LVS A> I II < DS TG>
< V IN G O > :II < LVI NGR> C
0
A B A K IN G A CAKE
< LV I NGR> < A VI NG> C
< VO> 3 3‘ < LVR>
BAKE A
CAKE
<T OVO> 8 3' T C < LVR> C
A TO BAKE A CAKE
< V E R B I> [ II < LNR> ( LT VR)
—l 9 6n
< LVR> C
~
<LTVR> <i W>
<* V E N > TO < v c
>
S T R IN G S
< T H A TS> < NS TGO> <T OV O> < P N> < P VI NGS TG>
< PVI NGO> < PS NWH> < P NN> < PNVI NGS TG> < PS TG >
< P NTHATS > < P NS NWH> < P NTHATS VO> I < PS VI NGO>
< DP2 > < DP a> < DP 2 P N> < DP 4 P N> < DPS N>
< DP 1PN> < DP 1 > < OBJECTBE> <V E N O>
< VO> < S AS OBJBES < NPN>
< VI NGS TGP N> < NPV I NGS TG> < AS OBJBE> < NPS VI NGO>
< NPV INGO> < NPS NWH> < DP3 > < DP 3 PN> I
< OBJBE> < V I NGS TG> < S NWH> < WHETHS >
< S VIAGO> < C lS HOULD> < FORTOVO> < NTDVO>
< NN> < S OBJBE> <S V E N> <NA> < ADJN» < NO>
< V IN G O > < S VO> < A S T O > I < NTHATS >
< DS TG> < NS NWH> < A S S E R T IO N > < S TOVO- N>
<T H A T S > < P N> < PVI NGS TG> < PS V I NGO>
< PVI NGO> < PS NWH> < AS DBJBE> < FS TG>
< DP 1> < P I> < OP IF> < DP 1PN>
< V IN G O > < FORTOVO> <T O V O > < A S S E R T IO N >
< NS TGO> I < S NWH> < OBJBE> < VENPAS S > < AS T O>
< DS TG> < VO>
< VENPAS S > < V IN G O > < OBJBE> < S N> < V I NGS TG>
<T O V O> < A S S E R T IO N > < BE I NGO>
< AS TG> < NS TG> < PN> < DS TG>
B E I N G < NULBEI NGO> C
<L A R > ( NS TG> B.S A
( IS ) B E I N G F O O L I S H ( IS ) B E I N G A F O O L
¢ N8 T6 >
< NS TGO> [ < NS TGO> JC
( B U Y ) H IM A B O O K
3 83 <L A R > < LO NR>
( IS ) L O N G ( IS ) 3 0 8 P A G E S L O N G
I I' s AVAR> C ( < RA> J
NGS
~
197
( SUCCEED) IA C O N F U S I N G THE IS S U E
S NWH> I I' < A P> <S NWH>
( I N Q U IR E ) A B O U T W H E T H E R T H E Y A R E H E R E
P N> I II [ < NS TGO> J [ < S AS J
( A T T R I B U T E ) T H E I R D IF F I C U L T I E S T O M I S M A N A G E M E N T
NN> I II < PN> [ < NS TGO> I
( A T T R I B U T E ) T O M IS M A N A G E M E N T T H E I R G R A V E D IF F I C U L T IE S
I NGS TGP N> I II < VI NGS TG> < NULVI NGS TGP N> C
ULVI MGS TGPN> < PN> < PVI KGS TG> < PS VI NGO> < PV I NGO)
( L E A V E ) C A N V A S S I N G T O HIS AIDES I ( A T T R I B U T E ) H IS
L E A V I N G T O H IS B E I N G O V E R W O R K E D
NVI KGS TG) [ ' I < NULVI NGS TGP N) [ ( S AS J < VI NGS TG> C
( L E A V E ) T O H IS S E C R E T A R Y M A K I N G A L L A R R A N G E M E N T S
PVI NGS TG> I II [ < NS TGO> 1 < P VI NGS TG> C
( A S K ) H IM A B O U T T H E IR O F F E R I N G HI M M O R E M O N E Y
PS VI NGC> I I II ( < NS TGO> I ( 4 S A> I < PS VINGO> C
( A S K ) HI M A B O U T N O O N E H A V I N G B E E N T H E R E
PVI NGO> I II ( < NS TGO> 1 < PVINGO> C
( P R E V E N T ) H IM F R O M R U I N I N G H I S H E A L T H
P S AWH> I II [ < NS TGO> 1 < * P> < S NWH>
( A S K ) HI M A B O U T W H E T H E R T H E P A S S P O R T S W I L L B E S T A M P E D
BB. DP S T R IN G S
P I> I I: ( A DP )
( CARRY) ON
P2 > I II < * DPS [ < NULNV> J
( LOOK ) UP THE NUMBER
PS I I ll < ¢ DP> C
( LOOK) THE NUMBER UP
P a> I II < A DP> O F S B. A
( LET ) OUT TH AT A C HA NGE IN GOVER NMENT WOULD BE WELCOME
ULNV> I I! < NS TGO> < VI NGS TG> BB. AA
P S N> I II ( A DP) < S N>
( F IN D ) OUT W H E T H E R H E IS C O M I N G
P 1P N> I I: < t DP>
( MIX) U P T H E L A S T N A M E W I T H T H E F IR S T
P3 PA> I II < DR3 > < NULDPPN> C
( MI X) IT U P W I T H S O M E T H I N G E L S E
P OR N ) I II ( UFO) < NULDPP N> C
( M I X I N G ) U P O F T H E L A S T N A M E W IT H T H E F IR S T
P 1P> I II < A DP> < A P > C
( WAS LOOKED) UP TO
BC . OBJECT N O M IN A L IZ A T IO N S T R IN G S
( M A K E ) M E F A IL
-
l9 8
< OBJBES A> I I: < OBJBE>
A A N IN V E T E R A T E G A M B L E R .
¢ S DBJBES A> I II < NS TG>
< NULS CBJBES A> I II < OBJBES A> < VENPAS S > < V IN G O > I
A T H E W A R H A V I N G E N D E D : ( P E O P L E BEGAN
<S AWH> I II < S AWH ICHS TG> < WHETHS > < WHEVERS ¢ N>
< NVS A) I II < NS TG> < VERB> C
A ( H E W IL L I ) IT S E E M S : ( B E T H E R E A L O N E )
A
I 10 . S U B O R D IN A T E C O N J U N C T IO N ( CS ) S T R IN G S
i
<S U B B> I II < * CS O> < OBJBE> C
A T H O U G H B L IN D
<SU B I> I II < * CS I > < AS S ERTION> C
A B E C A U S E H E H A D I N T IM A T E K N O W L E D G E O F T H E UNDERWORLD
<S U B E> I II < NULS UBE> < VENP AS S > C
< NULS UBZ > I II < I C3 2 > AS THAN
A A L T H O U G H C A P T U R E D B Y T H E S Y N D IC A T E
<S U B S> I II < * CS S > < VI NGO> C
A B E F O R E D R O P P I N G HIS G U N
<S U B A> I II < A C S A> t VI NGS TG> C
A A F T E R HI S R E F U S I N G T O P L E A D F O R H I S L I F E
<S U BS> I II I A CS S > < S VI NGD> C
A W I T H O U T ANYCNE T R Y I N G T O S A V E HIM
< S UB8 > I II < A CS ¢ > < S OBJBE> C
A W IT H HIS G U N O U T O F R E A C H
< S UBT> I II < A CS T> < S V E N > G
A W IT H T H E M Y S T E R Y S T IL L U N S O L V E D
<S UBB> I II < NULS UBB> ( A D> C
< NULS UBB> I II AS I THAN
A AS ALWAYS
i
I 1 1. R N R IG H T A DJU NCTS OF N
A
< RN> I II < REPRN>
< REPRN> I II < VENP AS S > < RNP> < RNWH> H A T S -N>
<T < s-N>
< S N> < V IN G O > <T O V O> < TOVO~ N> < FORTOV0 -N> /
< ADJI NRN> < DS TG> < APP OS > WHATSOEVER
< RNP > I II < P N> < P V I NGS TG> < PS VI NGO> < PS NWH>
< RNWH> I II <W H S - N> ( W HENS> < P WHS > < PWHS - P N>
< WHNS - N> < P WHNS ~ PN> < PWHNS >
<T O V O -N> I II <T O V O>
I ( THE MAN) TC SEE
< FORTOVO ~N> I II < FORTOVO>
A ( T H E M A N ) FCR Y O U T O S E E
< ADJI NRN> I II <L A R > < LD NR)
I ( T H E P E O P L E ) RES P ONS IBLE I ( A L I N E ) T W O I N C H E S L O N G
< APP OS > I II < NS TG>
I ( M Y F R IE N D ) J O H N
t
I 12 . LR LEFT AD JU NCTS OF N
t
<T R OS > I II < LTR> < WHLN> < LNS R> ( HOWQ S TG>
-
2 00
< LT> 1 < A T> ( A D)
( c
ALL THE ) ONLY
< I NS > C Q
'
MY YOUNG S ON S
W H OSE W H IC H WHAT < H OW Q AS T G >
TWO HU NDR ED
< ADJADJ>
( L A R 1> < L O WR >
S IZ E T E N ( D R E S S )
C < NPOS 1> <A NS>O
I P
< N O S I > J
< NPOS 1> < NULNPOS > C
< NULNP OS > C
( A N) < * V IN G >
12 . 2 2 A
F A M IL Y ( T R E E ) ! L E A R N I N G ( T R E E )
I I“ ‘ DS TG’
OR S C E N OUGH
< S NP ‘ A S S E R T IO N > < PN> < P V I NGS TG> I PS VI NGO>
< T O V O -N> < F O RTO V O-N> <T O V O> ENOUGH
ENOUGH
< REPRV> I‘ RV’ ]
< P MS ( ON) 13 .5 A
< DS TG>
ENOUGH
< A o>
< DS TG> I
I DS TG> [VERY] < NULLO> C
<* VEN > 14 . 3 A
I I VI NG>
O
< ONPOS >
-2 01
( A D) 14 0 6
I OS T O>
< A D> < *Q>
< * N>
< * N> < * D> <I ADJ>
< A ADJ» < AQ>
H 15 0 -
WH S T R I N GS
< WHETHS > < NULWHETHS > [ < ORNOT> J < AS S ERTI ON> C
< NULWHETHS > WHETHER WHERE WHEN HOW WHY IF IS . IA
t W H E T H E R O R N O T I W I L L V O T E ( IS A G O O D Q U E S T I O N )
( WHETHTOVO> < NULWHETHS > < TOVO> C
i WHETHER OR NOT T O V O T E ( IS A G O O D Q U E S T IO N )
( HHS -N) < NULWH8 -N> < AS S ERTI ON> C
< NULWHS I N> WHO WHCM W H IC H WHAT WHOSE I THAN AS 1S .S A
t W H O M W E S H O U L D E L E C T ( IS A G O O D Q U E S T I O N )
¢ PWHS > < A H> < NULP WHS > < AS S
ERTION> C
< NULPWHS > WHOM W H IC H WHAT WHOS E WHERE WHEN IS . UA
t W I T H W H A T W E C A N B R IB E T H E O F F I C IA L ( IS A G O O D Q U E S T I O N )
< PWHS -PN> < I P> ¢ NULP WHS ~ P N> < AS S ERTI ON> C
< NULPWHs -PN> WHOM W H IC H I W H A T WHOSE 1S . S A
i O N W H O M W E C A N D E P E N D ( IS A G O O D Q U E S T I O N )
< WHNS -N> < WHN> < AS S ERTI ON’ C
i W H I C H C A N D I D A T E W E S H O U L D E L E C T ( IS A G O O D Q U E S T I O N )
< PWHNS > < A R> < WHN> < AS S ERTI ON> C
i W I T H W H O S E M O N E Y W E C A N B R I B E T H E O F F IC I A L ( IS
( P WHNS I P N> « A P» < WHN> < AS S ERT ION> C
i O N W H I C H C A ND I D A T E W E C A N D E P E N D ( IS A G O O D Q U E S T I O N)
< WHATs -N> W H A T < AS S ERTI ON> C
t W H A T W E P A ID T H E M A N ( W A S T O O M U C H )
<W HERES> W H E R E < AS S ERTION> C
W H E R E W E M E T HI M ( W I L L R E M A I N A S E C R E T )
<W HENS) < AS S ERT I ON> C
< NULWHENS > WHERE WHEN
t ( THE DAY) WHEN WE WON ) ( THE DAY) WE WON
< THATS I N> T H A T < AS S ERTI ON> C
( T H E O F F IC I A L ) T H A T W E B R I B E D
«s -N> < A S S E R T IO N >
t ( T H E O F F IC I A L ) W E B R I B E D
< S AWHI CHS TG> < NULS AWH ICHS TG> < AS S ERTI ON> C
¢ NULS AWH I CHS TG> W H IC H THAN AS
i ( H E S Q UEALEC I ) W H I C H S U R P R I S E D U S
< WHEVER8 -N> < NULWHEVERS - N> < AS S ERT I ON> C
< NULWH EVERS -N> WHOEVER WH OMEVER W H IC H E V E R WHATEVER
WHOS CEVER
W H A T E V E R T H E J U D G E G I V E S U S ( IS W E L L D E S E R V E D )
-
202
< NULOBES > 4 A
.2
< NULP WHQ > S .6 A
< NULP WHS > IS . 4 A
< NULPWH8 -PN> 15 . 5 A
< NULS AS OBJBE> an. “
< NULS AWH I CHS TG) 14 !
< NULS OBJBES A> 9 .9 A
< NULS UBZ > 3A
18 . I
< NULS UBB> 18 . 9 A
< NULS VI NGC> 6 .3A
< NULTS UBJVO> 4 . 1A
< NULVI NGS TGPN> 8 A. 10OA
< NULWHENS > 15 . 1 1‘A
< NULWHETHS > IA
1S . 1
< NULWHEVERS - N) 1S . 15SA‘
< NULWHQ > 3.4A
< NULWHS - N> 15 . 3 A
< NUMBRS TG>
< NVAR> m :
l
c
<A VSA> oo a
< NWHS TO> mo m
< OBES> no m
< OBJBE> mc a
oo 0m
-
< OBJBES A>
:
<O B J E C T> oo
n
< O B J E C T EE > mo H
u
< ORNOT> m
uo N
( P I) mb
( PA) oo
< P AS S DBJ> oo
< P E R M U T A T IO N > mo
< P N> mb c M
< PNN> mb o O
¢ P NS NWH> o H
I
< P NTHATS > m W
< PNTHATS VC> D
( Oo 0
< PNVI NGS TG>
< PROS ENT>
< PS NWH>
< PS TG>
< PS VI NGO>
< PVI NGO>
< PVI NGS TG>
< P WHNQ >
< PWH NQ - P N>
< PWH NS >
< PWHNS - P N>
< RW H O >
< PWHQ - PN>
< P WHS >
204
< VERBZ >
< V I NGO>
< VI NGOFNV
>
< VI NGS TGV
>
T H E R E S T R I C T I O NS E X P R E S S E D I N T H E
B O T T O M -UP R E S T R I C T I O N L A N G U A G E
S ET DOBFLG W H E N OBJBE O C C U R S .
VOB I : H O U S E D A T < OBJBE> ! < PAS S OBJ> T < O B J E C T > ] < AS OBJBE> y < OBJECTBE> 3
C O R E H A S DOBFLG .
C O R E H A S AS TGOBFLG , S I N G EL O . PLURALFLG O F C O R E 2 .
H O U S E D A T < AS OBJBE> 3 < O B J E C T > : < PAS S OBJ> I
< OBJECTBE> 1 <O B J E C T> |
C O R E H A S DOBFLG, AS TGOBFLG o S I NGFLG , P LURALFLG O F
C OREZ.
S ET DVBFLG W H E N A V E R B A L OC C U R S .
DVCBZ I H O U S E D A T < L T V R > ! ( V E R 8 1> T
<V ER B> ! < AS S ERTI ONVO> ;
C O R E H A S DVBFLG .
H O U S E D A T < VER8 1> s « YES NOO> ; < TS UBJVO> 3
C O R E HAS DVBFLG O F C O R E Z .
S ET VBOBJFLG W H E N O B J E C T C R P AS S OBJ H A S A v-o S TG A S I T S V A L U E .
OVCB3 I H O U S E D A T < T O V O > : < VENO> o < V I N G O > : < VO> I < O B J E C T > :
< VENPAS S > , <V I N G O> . <T OV O> : < O B J E C T EE > 1
< V I NG O > ; <T OV O>, < VENP Ass> a < VO> : < P AS S OBJ> I
C O R E H A S VBOBJFLO .
H O U S E D A T < OBJECTBE> I < OBJECT> I
C O R E HAS VBOBJFLG O F C O R E 2 .
I F O B J E C T I S OBJBE P A S S U P DOBFLG A N D C O R E 2 B E C O M E S N E W C O R E . ANY
O T H E R V A L U E E X C E P T V-O S T OS : P A S S U P DVBFLG A N D T A K E C O R E I A S N E W C O R E .
t FOR V-O S T OS T A K E C O R E 2 AND W H I C H E V E R F L A G I T H A S .
OVCBAT H O U S E D A T < O B J E C T > ! < Vo> a < V I N G O > : < VENO> T < T O V O > ; < VI NGOFN> 3
< AS S ERTI ONVO> , < YES NOOVO> y < TS UBJV OVO> 1
< P AS S OBJ> 3 < VENP AS S > I
I F C O R E 2 H A S N O T VBOBJFLO A N D DOBFLG A N D C O R E 1 HAS
N O T V O R VBE O R BEREP T H E N C O R E H A S A T T R I B U T E S
OF C O R E 2 A N D C O R E H A S DOBFLG: AS TGOBFLG :
S I NOLFG a P LURALFLG O F C O R E 2 .
I F C O R E 2 HAS N O T VBOBJFLO A N D ( C O R E 2 H A S N O T DOBFLG
OR C O R E 1 HAS V A N D N O T ( VBE O R BEREP J T H E N
C O R E H A S A T T R I B U T E S O F C O R E 1 AND C O R E H A S
DVBFLG . DVBVENP AS S FLG O F C O R E 1 .
—2 06
AGREEHENT RESTR ICT IONS
t
A WAGREE I : SUBJECT AND VER B AGREE I N NUMBER .
WAGREE I : H OUS ED AT <O B JEC T> : < AS S ERTI ONVO> ;
< LVR> :
I F C O R E I H A S S I N G U L A R O R S I NGFLG T H E N C O R E HA8
S I NGFLG .
I F C OR E 1 HAS PLUR AL OR P LURALFLG THEN CORE HAS
PLURALFLG .
HOUS ED AT < NAHES TG> . < NWHS TG> | < NS TG> ,
< V I NGS TG> ¢ < S N> I <S U B J E C T > !
C O R E H A S S INGFLG .
H OU S ED A T < CP DNUNBR> T < OV A R > I
C O R E H A S P LURALFLG .
HOUS ED AT < GVAR> 3 < LOR> y
< LOR> a < Q P OS > ;
C O R E H A S P LURALFLG O F C O R E 2 .
H OUS ED < QPOS > : < L N 1> 1 < TQ P OS > ; < LN2 ’ I
< TQ P OS > : < LNNVAR> :
I F C O R E Z H A S P L U R A L O R PLURLAFLG T H EN CORE HAS
P LURALFLG .
I F COREa H A S S I N G U L A R T H E N C O R E H A S S I NGFLG ,
H OUS ED AT < LA1> o < LNNVAR> : <L NR> :
<L N R > : < NS TG> ;
< AS TO> ! < S UBJECT’ I
SSS OR I F C O R E Z H A S P L U R A L O R P LURALFLG T H E N C O R E 1 H A S N T
S I N G U L A R OR S I NGFLG .
SSS OR I F C O R E 2 H A S S I N G U L A R O R S I N G EL O T H E N C O R E 1 H A S N T
P L U R A L O R PLURALFLG .
t WAGREES T H O S T A N D A P P O S I T IO N N O U N A G R E E I N N U M B E R
WAGREES I H O U S E D A T < A P P O S > I < REPRN> :
C O R E H A S APPOS FLG.
H O U S E D A T < REPRN> : < RN> :
C O R E H A S APP OS FLG O F C O R E Z .
H O U S E D A T ( RN> : < LPROR> :
I F COREz H A S S I N G U L A R O R S I NGFLG T H E N C O R E H A S
RS S I NGFLG .
-
209
I F C O R E Z H A S P L U R A L O R PLURALFLG T H E N C O R E HAS
RS P LURFLG .
H O U S E D A T < R E P S A > ! < S A> ,
< S A> ! < AS S ERTI ONVO> , 5 1 ‘ TS UBJVOVO> . AT
( c o> , Ty < NULS AS OBJBE> T
< VENFAS S > p 6 3
<T O V O> ! <T OV O- N> y
<V I N G O > : < NULS AS OBJBE> I
C O R E H A S RS S I NGFLG. RS PLURFLG O F C O R E 2 .
H O U S E D A T < S A> I < sOBJBE> , AI
< AS S ERTI cNVO> | <A S S ER T I O N > ;
¢ YES NOOVOVO> I < YES NOQ > :
< TOVO’ I < NTOVO> 3
<T O V O- N> ! < S TOVO- N’ !
< NULS AS OBJBE) T < S AS OBJBE> y
< VENP AS S > I <S V E N > I
SSS OR I F C O R E 2 HAS RS S I NGFLG T H E N CORE! H A S N T P L U R A L
O R P LURALFLG .
SSS OR I F C O R E Z H A S RS PLURFLG T H E N C O R E ! H A S N O T
( S I N G U L A R O R S I NGFLG ) O R A G G R E G A T E .
WAGREEB I I F T H E P R E P O S I T I O N I N RN: PWHN- P N O R PWHN I S !B E T W E E N ! O R !A M O N G !
i T H E N T H E N O U N M U S T B E P L U R A L ( B E T W E E N T H E T R E E S t AMONG T H E T R E E ) .
WAGREEB I H O U S E D A T < VI NGOFN> 3 < WHN> ¢
< NWHS TG> . ( NAMES TG> I < NS TG> !
C O R E H A S S TGFLG .
H O U S E D A T < NS TG> : ¢ NS TGO> T
C O R E H A S S TGFLG O F C O R E 2 .
H O U S E D A T < NS TGC> I < PN> !
< WHN> I < P WHNS - PN> T < PWHNS > , < FWH NO- PN> , < P WHNO> 3
$ 88 OR I F C O R E ! H A S !B E T W E E N ! T H E N C O R E 2 H A S ( N O T
( S I N G U L A R O R S I NGFLG ) O R A G G R E G A T E )
A N D N O T S TGFLG .
SSS OR I F C O R E ! HAS !A M O N G ! T H E N C O R E 2 H A S ( N O T
( S I N G U L A R O R S I N G EL O) O R A G G R E G A T E !
AND N O T S TGFLG A N D N O T !T W O !.
-
2 10
< VO) , 2 T < V E R EZ > I
C O R E HAS INTS AFLG .
C O R E HAS S HORTS AFLG O F C O R E 2 .
HOUSED AT < RV> ! A LVENR> T < L T V R > ; < LVI NGR> , < LVR> !
C O R E H A S I NTRVFLG .
HOUSED AT < LVENR> ! <V E N O> ; < VENP AS S > y
LTVR> ! <VERB> !
<
<V E R B > ! < AS S ERTIONVO> !
C O R E H A S I NTRVFLG O F C O R E 2 .
HOUSED AT < VERBZ ’ ! NOOVO> T < TS UBJVOVO> T
< YES
C O R E H A S LP FLG O F C O R E 2 .
H O U S E D A T < RW> T < YES NOQ > :
C O R E H A S INTRVFLG .
H O U S E D A T < S A> T < YES NOQ > . 5 T < AS S ERTI ONVO> . 2 T < VER8 2 > 8
I F C O R E 2 H A S LP FLG T H E N I NTER ( P ) A !o ! O R C O R E 1
FAS I NTRVFLG .
A WCCMB I I N T H E S T R I NG WFENS I N R N ; I F T H E S T R I N G H E A D I S N U L L . T H E
" "
A P R E V I O U S W O R D C A N NO T BE C O M M A ; A WE K N O W THE DAY. HE A R R I V E D .
A AND I F THE S T R I N G H E A D IS !W H E N ! THE H O S T N O U N M U S T BE A T I HE
A N OU N .
WCCMS I H O U S E D A T IH HEN I I < NULH HENS > I
$ PUNC 0 R I NTER ( P ) X II I .
C UR E H A S WHENFLG .
H O U S E D A T < A S S E R T I O N > ! < WHENS > I
$ PUNC 0 R I NTER ( P ) X
H O U S E D A T < NULWHEBS ) : < W H E N S > ,
-
2 12
< WHENS > T < RNW H> T
< RNHH> I < REPRN> )
-
2 14
HOUSED AT < RNP> I A REPRN> T
< REPRN> : < RN> !
C O R E H A S I NDNAMFLG O F C O R E 2 .
H O U S E D A T < RN> ! < LPROR> .
H O U S E D A T < RN> :
S P O S A O R I F C O R E 2 HAS I NDNAMFLG T H E N C O R E ! H A S N T N TNAME .
A HNI I P E R M I S S I B L E OUANTI FI ER-A R T I C L E C O M B I N A T I O N S I N L T R ( " S U C H A " ;
A " S U CH
F
“ OR NS . B U T I F T H E C O U N T N O U N IS A L S O S U B C L A S S I F I E D NCOUNT2 ;
N I N P N F O R A P P R O P R I A T E P I S E X E M P T E D ; I F NCOUNT3 ; N I N OBJBE
I S EX EMPTED .
E
-
2 16
< LNR> ! <NS TG> :
CORE H A S ONLYOBFLG; ONLYP NFLG O F C O R E 2 .
H O U S E D A T < L N R > : A L L O C C U R R E N C E S E X C E P T < NS TG> !
< NS TG> ! A L L O C C U R R E N C E S E X C E P T < OBJBE> ; < NS TGO> :
$ WS OR C O R E 2 H A S N T ONLYOBFLG O R ONLYP NFLG .
H O U S E D A T < NS TG> : < OBJBE> :
$ WS OR I F C O R E 2 H A S ONLYP NFLG T H E N C O R E 2 H A S ONLYOBFLG .
H O U S E D A T < NS TG> : < NS TGO> I
$ WS OR I F C O R E 2 HAS ONLYOBFLG T H E N C O R E 2 H A S ONLYP NFLG.
H O U S E D A T < NS TG> : < NS TGO> :
C O R E H A S ONLYP NFLG O F C O R E 2 .
H O U S E D A T A NS TGO> I A L L O C C U R R E N C E S E X C E P T < PN> :
$ WS OR C O R E 2 H A S NT ONLYOBFLG .
H O U S E D A T < NS TGO> : < P N> !
S PCS S O R I F C O R E 2 H AS ONLYP NFLG T H E N C O R E ) E L NCOUNT2
( C OR EZ) .
A WN IO I C O N D I T I O N S FOR N O U N C O R E 3 V I N G .
WN IO ! H O U S E D A T < NP OS > : < NNVAR> !
C O R E H A S NP OS FLG .
H O U S E D A T < NVAR> : < NNVAR> !
S P O S A O R I F C O R E 2 H A S V I N G A N D C O R E 1 H A S N T NP OS FLG T H E N
NULLOBJ E L OBJLIS T ( C OREZ ) .
I F C O R E 2 HAS VI NO A N D C O R E 1 H A S N T NP OS FLG T H E N
CCRE H A S LNVINGFLG .
S PCS Q O R I F C O R E Z HAS V I N G A N D C O R E ) H A S NP OS FLO T H E N NS TGC
E L OBJLI S T ( COREZ ) .
H O U S E D A T < NNVAR> ! ( ANNVAR> I
I F C O R E 1 H A S N T AP OS FLG T H E N C O R E H A S LNVI NGFLG O F
COR E2.
H O U S E D A T < ANNVAR> : < LNVAR> I
S P OS U O R I F C O R E ? HAS LNVI NG GFLG T H E N C O R E 1 H A S OP OS FLG O R
" u " " " "
A cR AN OR T H E 0 R TQ UAN 0 R EACHEVERV .
A WNS C T A N A D J E C T I V E O C C U R S T O T H E R I G H T O F N O N L Y I F I T H A S
H M O D I F I E R S ! O R I S I N T H E S U B C L A S S AI NRN; O R T H E H O S T
" A " "
F I S A N I N D E F I N I T E P R O N O U N ( A S T U D E N T G O O D A T M TH ; STUDENTS
A " "
PR ESENT ; S OVETHI NO
WNS O T H O U S E D A T < L A > ; < S A> ! < L A R > I
< ON> I < O NP CS > I
C O R E H A S cKADJ INRNFLG .
H O U S E D A T < ONPCS > : < LONR> y
< LONR> ; <L A R > T < ADJI NRN> T
< ADJ I NRN> T < REPRN> ;
( REPRN> I < RN> !
C O R E H A S OKADJ I NRNFLG O F C O R E 2 .
H O U S E D A T < ADJI NRN> I < REPRN> :
CORE H A S ADJ I NRNFLG .
H O U S E D A T < REPRN> : < RN> :
C O R E H A S ADJ I NRNFLG O F C O R E 2 .
H O U S E D AT < RN> : < LNR> O I I Z I ‘ LNR’ A EA Z T
S P CS A O R I F C O R E 2 H A S ADJ I NRNFLG T H E N C O R E 2 H A S
OKADJI NRNFLG O R AI NRN.
H O U S E D A T < RN> : < LPROR> :
S P O S A O R I F C O R E Z HAS ADJI NRNFLG T H E N C O R E 2 H A S
~ 217
OKADJ I NRNFLG O R AI NRN O R C O R E 1 HAS
P RO TI NDEFI NI TE .
H NS I I R ESTR I CT I O N ON P N A s R I G H T A D J U NC T O F N I
IF P IS " I N T O " T H E N T H E H O S T I S N O T H U M A N ( A "THE
"
CH I LDREN I NT O T HE HOUS E AR E I F P 18 S I NCE" ; THE HOST
"
I
I S A T I ME NOUN ( THE T I ME S I NCE H IS I F T HE HOST I S A
"
* N A M E ; T H E N P IS "
OF . " "
IN ; "
FROM "
OR "
A T ".
H O U S E D A T < PN> ! < RNP> I
C O R E HAS P NFLG.
H O U S E D A T < RNP > I < REPRN> ;
< REPRN> ! < H NAT
CORE HAS P NFLG OF C OR E2.
HOUS ED AT ( R N) : < LPROR> !
" "
S P CS S O R I F C O R E 2 HAS PNFLG AND I NTO T HE N C OR E 1 HAS NT
NHUMAN .
"
S P OS S OR IF C O R E 2 HAS P NFLG AND ( S I N C E " O R "P R I O R T O "
O R " A W A Y ") T H E N C O R E ! HAS NTI ME ) .
S P OS S O R I F C O R E Z H AS PNFLG A N D CORE ! HAS N A M E T H E N
" "
C O R E 2 HAS OF O R " I N " O R " F R O M" O R " A T " .
-2 18
DP CS S : H O U S E D A T !W H I C H !: < NULS AWH ICHS TG> 8
C O R E H A S WH ICHFLG .
H O U S E D A T !T H A N !! < NULS AWH ICHS TG> I
C O R E H A S THANFLG .
H O U S E D A T < NULS AWH I CHS TG> T < S AWH ICHS TG> ;
< S AWH ICHS TG> T <S A W H > 3
< S AWH> I <R EP S A> .
C O R E H A S WH ICHFLG ; THANFLG O F C O R E 2 .
H O U S E D A T < S A> : A L L O C C U R R E N C E S E X C E P T < AS S ERTI ONVO> ; S T
< YES NOOVO> ; AT
< VI NGO> ; 6 T < TOVO) , T T
S P O S A O R C O R E Z H A S N T WHICHFLG .
$ R A R E O R C O R E 2 H A S N T THANFLG .
A OPCS TT C ER T A I N OPT I ONS OF S A OCCUR ONLY I N C ENT ER L I K E S TR I NGS .
DPOS T I H O U S E D A T < S AWH ICHS TG> ! < S AWH> I
< NS TGT> ; < OBJBES A> . AS OBJBES A> ; <V I N G O > ; < VENP AS S > .
< RNS UBJ> ; < CS S TG > I <R EP S A > :
C O R E HAS CENTERFLG .
H O U S E D A T < S AWH> T < R E P S A > ;
<R EP S A > : < S A> !
< S A> : < VENP AS S > ; 3 T < OBJBES A> T
< TOVO> ; TT
C O R E HAS CENTERFLG O F C O R E 2 .
H O U S E D A T < S A> : A L L O C C U R R E N C E S E X C E P T < A S S E R T I O N > ,
< AS S ERTI ONVO> ! < YES NOQ > ; < YES NOOVO> ;
< TS UBJVO> T < TS UBJVOVO> T < OBES > T FORTOVO> T
< NTOVO> T < S OBJBE> T ( S AS OBJBE> T < S TOVO- N> T
< S OBJBES A> 3 < NVS A> , < VENP AS S > 1 < T O V O ) ;
< V I NG O > !
C O R E H A S ORNOTFLG .
H O U S E D A T < YES NOOVO> g < YES NOQ > !
C O R E H A S ORNOTFLG O F C O R E Z .
H O U S E D A T < YES NOQ > : < NUL2 WHO-N> ! < W H O> T < P H RO-P N> , < P WHG> T
< WHNO- N> y < P WHNO- P N> T < P WHNO> I
- 220
$P O S 3 O R C O R E 2 H A S N T ORNOTFLG .
" "
DP C S IB : S E NT E NC E AD JU NC T S TR I NG NV A ( I K NOW ; P E OPLE T H I NK )
S CANNCT
O C C U R A T T H E B E G I N NI N G O F A S E N T E N C E .
DP CS I Z : H O U S E D A T < NVS A> I <R EP S A > :
C O R E H A S S AI NNERFLG .
t DPCS I A : C E R T A I N WH-S T R I N G S A R E R A R E A S RNS UBJ .
DP CS IH : H O U S E D A T < W H E N S > 3 < RNN H > 3
$ P O S S O R C O R E 2 H A S N T I OF I O R IA B O U T I O R IS I NCE I O R
ITHROUGHOUT I O R IT O I O R IDURI NG I ,
t CP CS I b : PCR N HETHS T O B E S E N T E N C E A D J U N C T ; I T M U S T S T A R T N ITH "
WHETHER ."
s p os a O R CCREE HAS OS A,
HP CS IB I H O U S E D A T < DS TG> < REPRN> !
S P O S H O R O C R E Z HAS ORN .
NP OS IC : H O U S E D A T < DS TG> : < RN> :
$ P O S A O R CCREZ HAS ORN .
WPOS ID : H O U S E D A T < DS TG> :
S POS G O R C CREZ H A S D L V .
NP OS lE : H O U S E D A T < DS TG> : < LPRO> 3
S POS Q O R C ER E Z HAS DLTPRO .
NP CS IF : H O U S E D A T < A D> 3 < LCS > z
-
221
HP OS 1 L I H O U S E D A T < DS TG> : < NULTS UBJVO> a
S P O S A O R CCREZ HAS OPERM.
NP CS IH I H O U S E D A T < DS TG> ! < ND> I
S P0 8 4 O R C O R E 2 HAS OUN I V .
NP CS IP I H O U S E D A T < DS TG> ! <O B J EC T > :
S P O S H O R C O R E 2 HAS D E V A L .
t NP CS E I I N R V ; 0 IS DRV. I F O I S A L S O DLOCS : T H E N T H E H O S T IS A V E R B
i O F M O T I O N ( "H E W A L K E D
HPCS Z ! H O U S E D A T < DS TG> ! < REPRV> I
S P OS 4 O R CCREZ HAS ORV.
H O U S E D A T < REPRV> I < RV> !
I F C O R E 2 HAS OL O C 3 T H E N C O R E H A S MOTI ONFLG .
H O U S E D A T < RV> ! < RV> : < NTOVO> y < NTHATS > I < NS NHH> 3 < P NTHATS > u
< P NTH ATS VO> I < P N8 NNH> | < S TOVO- N> y
< NTCVO> o ( NTHATS > p < NS NH H’ : < P NTHAT8 > a < P NTHATS VO> p
< P NS NNH> o < S TOVO-N> : OBJECT> :
<
-
222
"
HP CS IAI V E N A S A D J E C T I V E HAS P A S S I V E O B J E C T L I S T ( T H E Y H A V E H I R E D
" " " " " "
I NSTRUCT ORS ( H I R E D A S L N ) .
* T H E Y H A V E B E E N I N S T R U C T O R S ( B E E N"
AS
HP CS I AI H O U S E D A T < * V E N > I < NULAVAR> I
S P O S A O R CCREZ H A5 POBJLIS T
WP CS I S I P I N P O B J E C T S T R IN G M U S T B E T H E O N E N A M E D AS ATTR I BUTE V ER B
t S A ME F OR DP OBJECT STR I NGS .
NP OS IS I H OU S E D ‘ PN> ' ‘ PVI NGS TG’ I < P8 VI NGO> I ( PV I NGU’ o < PS NH H> 0
< NPS VINGO> , < NPVI NGO> i < NPS NWH> . < DP2 P N> .
< DP2 > . < DP 3 > . ‘ OP4 > 0 < DPS N> , < DP 2 P N> , < DP 3 P N> O
< DP4 P N> T <OB JEC T> ;
< OP IP > I ( P AS S OBJ> I
C O R E H A S DP OBJFLG .
H OUS ED A T < NULDPPN> : < DP 1P N> : < DP2 P N> v ‘ DP BPN’ ; < DPUPN> I
< R P> I < DP 1P> I
C OR E 1
IF HAS lABOUT l T H E N C O R E HAS ABOUTFLG .
COR E 1
IF HAS ( A C R O S S ! T H E N C O R E HAS ACROS S FLG .
C OR E 1
IF HAS ) A L O N G I T H E N C O R E HAS ALONGFLG ,
C OR E 1
IF HAS IAROUND I T H E N C O R E HAS AROUNDFLG ,
C OR E 1
IF HAS IAWAYI T H E N C O R E HAs AWAYFLG ,
C OR E 1
IF HAS lBACK I T H E N C O R E HAS BACKFLC.
C OR E 1
IF HAS ( D O W N ! T H E N C O R E HAs DOWNFLG .
C OR E 1
IF H AS II N I T H E N C O R E HAS I N F L O .
IF C O R E 1 HA8 I O F F I T H E N C O R E HAS OFFFLG .
I F C OR E 1 HAS I O N I T H E N C O R E HAS O HEL O .
I F C OR E 1 HAS IO U T I T H E N C O R E HAS OUTFLG .
I F C OR E 1 HAS IOVERI T H E N C O R E HAS OVERFLG .
I F C OR E 1 HAS TTHROUOH T T H E N C O R E HAs THROUGHFLG .
I F COR E 1 HAS 1UP ) T H E N C O R E HAS UPFLG .
HOUSED A T <OBJECT> ! < YES NOOVOVO> | < TS UBJVOVO> T < AS S ERTI ONVO> ,
< VENO> T < V I N G O > : < VO> 1 < T O V O > : < V I NCOFN> T
S P OS S 0R I F C OR E2
~ HAS P OBJFLG T H E N C O R E 1 HAS CBJLIS T I PN
AND C O R E 2 EL
S P OS S OR I F C OR E2 HAS DP OBJFLG AND NOT P OBJFLG T H E N C O R E 1
HAS OBJLIS T I DP Z A N D C O R E 2 E L OBJLIS T I DPZ I DPVAL
( C O R E 1) .
S P OS S OR I F C O R E 2 H A S DP OBJFLG ANO P OBJFLG A N D ABOUTFLO
T H E N C O R E 1 HAS OBJLIS T I DP Z AND IA B O U T I
E L OBJLIS T :DP2 TDPVAL( CORE 1 J.
S P OS S OR I F C O R E E HAS DP OBJFLG A N D POBJFLG A N D ACROS S FLG
T H E N C O R E 1 H A S OBJLI S T I DP Z A N D IACROS S I
E L OBJLIS T I DPZ I DPVAL( CORE I ) o
S P OS S OR I F C O R E 2 H A S DP OBJFLG A N D POBJFLG A N D ALONGFLG
T H E N C O R E 1 H A S OBJLI S T TDP Z A N D ( A L O N G !
EL
S P OS S OR I F C O R E 2 H A S DPOBJFLG AND POBJFLG ANO AROUNDFLG
-
224
THEN CORE 1 HAS OBJLI S T TDPZ AND IAROUNO I
EL
S POS S OR C OR E2 HAS DP OBJFLG AND P OBJFLG AND AWAYFLG
THEN C O R E I HAS OBJL IS T ( DP Z AND IAWAYI
EL
39 035 OR I F C O R E 2 HAS DPOBJFLG AND P OBJFLG AND BACKFLG
THEN C O R E 1 HAS OBJLIS T I DP2 AND TEA C H :
EL
sp oss OR I F C OR E2 HAS DP OBJFLG AND P OS JFLG AND DOWNFLG
T H E N C O R E 1 HAS OBJLIS T TDP Z AND IOOWN I
EL OBJLIS T I DP Z I OPVAL( CORE1 ) .
sp oss OR I F C O R E 2 HAS DP OBJFLG AND P OBJFLG AND I NFLG
T H E N C O R E I HAs OBJLI S T ( DPZ AND I I N I
EL CBJLI S T I DP Z I DPVALCCORE I J.
S POS S OR IF C O R E 2 HAS OP OBJFLG AND P OBJFLG AND O PPEL O
T H E N C O R E 1 HAS OBJLI S T TDPZ AND I OFF I
EL CBJL IS T I DP E I DPVAL( CORE I ) o
5 9 0 3 5 OR I F C O R E 2 H AS DP OBJFLG AND P OBJFLG AND ONFLG
T H E N C O R E 1 HAS OBJLI S T zDPB AND TO N I
EL CBJLIS T TDP Z TDPVALCCORE I ) .
sp oss OR I F C O R E 2 HAS DP OBJFLG AND POBJFLG AND OUTFLG
T H E N C O R E 1 HAS OBJLIS T TOPZ AND ( OUT )
EL CBJLIS T I DPB I DPVAL ( CORE 1 J.
sp oss OR IF C O R E 2 HAs DP OBJFLG AND POBJFLG AND OVERFLG
T H E N C O R E 1 HAs OBJLIS T TDP Z AND TO V E R :
EL OBJLI S TI OP Z I DP VAL( CORE1 ) .
S POS S OR IF C O R E 2 HAS DPOBJFLG AND P OBJFLG AND THROUGHFLG
T H E N C O R E 1 HAS OBJLIS T TDPZ AND lTHROUGH l
EL CBJLI S T I DPZ I DPVAL ( CORE1 ) .
$ P O S S OR I F C O R E 2 HAs DP OBJFLG AND P OBJFLG AND UPFLG
T H E N C O R E 1 HAS OBJLI S T I DPZ AND ( UP )
EL OBJLIS T I DPE TDP VAL( CORE 1 ) .
H O U S E D AT < P AS S OBJ> 3 < VENP AS S > I
-
225
S P OS S OR I F C O R E 2 H A S DP OBJFLG A N D P OBJFLG A N D BACKFLG
T H E N C O R E 1 H A S P OBJLIS TTDPZ A N D IS ACK I
E L P OBJLIS TTDPZ TDP VAL( CORE 1) .
S P OS S O R I F C O R E 2 H A S DPOBJFLG A N D POBJFLG A N D DOWNFLG
T H E N C O R E 1 H A S P OBJLIS T I DPZ A N D IDOWN I
E L P OBJLIS T I DPZ I DPVAL( CORE I ) .
S P OS S O R I F COREz H A S DPOBJFLG A N D P OBJFLG A N D I NFLG
T H E N C O R E 1 H A S P OBJLIS TI DPZ A N D I I NI
EL
S POS S O R I F C O R E 2 H A S DPOBJFLG A N D P OBJFLG A N D OFFFLG
T H E N C O R E 1 H A S POBJLI S T I DPZ A N D IOFFI
EL
S POS S O R I F C O R E 2 HAS DP OBJFLG A N D POBJFLG A N D ONFLG
T H E N C O R E 1 HAS P OBJLIS TTDPZ A N D ( O N )
E L POBJLIS TI DP2 3 0 PVAL<CORE 1I .
S POS S O R I F C O R E 2 HAS DPOBJFLG A N D P OBJFLG A N D OUTFLG
T H E N C O R E 1 H A S P OBJLIS TI DP Z A N D IO U T I
E L POBJLIS T I DP Z TDP VALICORE I J.
S P OS S O R I F C O R E 2 HAS DP OBJFLG A N D P OBJFLG A N D OVERFLG
T H E N C O R E 1 HAS P OBJLIS T TDPz A N D IOVER I
EL
S P OS S O R I F C O R E 2 HAS DPOBJFLG A N D POBJFLG A N D THROUGHFLG
T H E N C O R E 1 HAS OBJLIS T TDPz A N D ITHROUGH I
E L P OBJLIS TI DPZ I PPVAL( CORE 1 ) .
S POS S O R C O R E 2 H A S DPOBJFLG A N D P OBJFLG A N D UP FLG
T H E N C O R E 1 HAS P OBJLIS T S DPZ A N D 1UP !
E L P OBJLIS TI OP Z I DPVAL( CORE 1 ) .
A WP OS IS T P N F O L L O W I N G V E R B IS N O T T A K E N A S R V I F I T I S E L I G I B L E F O R PN
O B J E C T DF V E R B U N L E S S R A R E S W I T C H I S O N . ( " H E I D E N T I F I E D W I T H
I MMED I ACY W ITH S I M I L A R L Y F O R P O S T O B J E C T R V A N D NPN
“H E CONP AR
( ED T H E S A M P L E S W I T H T H E P R E V I O U S
WP DS IB I H O U S E D A T < P N> ! < REPRV> I
C O R E HAS P NFLG .
H O U S E D A T < REPRV> I « RV> I
C O R E H A S P NFLG O F C O R E 2 .
H O U S E D A T < RV> ! < VENP AS S > I
$ R A R E O R I F C O R E 2 HAS PNFLG A N D C O R E 1 H A S DVBFLG A N D N O T
NULLOBJFLG T H E N C O R E 2 N E L
P OBJLIS TTNP N TPVAL( CORE 1 ) .
$ R AR E OR IF C O R E 2 HAS PNFLC A N D C O R E 1 HAS NULLOBJFLG THEN
CORE2 NEL
HOUSED AT < RV> : < ASS ERT IONVO> : < TS UBJVOVO> T < VINGOFN> T < VEND> T
<V I N G O> ; < VO> T < T O V O > ; < YES NOOVO> T
$ R A R E O R I F C O R E 2 H A S P NFLG A N D C O R E 1 HAS NULLOBJFLG THEN
C O R E B N E L OBJLIS T I P N I P VAL( CORE 1 ) .
$ R A R E O R I F C O R E 2 H A S PNFLG A N D C O R E 1 HAS DVBFLG A N D NOT
NULLOBJFLG T H E N C O R E 2 N E L
OBJLIS T I NP NI PVAL( CORE 1 ) .
HOUSE D A T < RY> : < L T V R > ; < LVR> : < LVENR> , < LV I NGR> :
$R A R E O R I F C O R E 2 HAS P NFLG T H E N C O R E 2 N E L
-
226
S POS S OR CCREZ H A S N T LPFLG A N D lOF l .
H O U S E D A T < PN> ! ‘ REPRV> I
S P OS S DR CCREZ H A S N T LPFLG A N D ( IOF I O R I A B O U T I O R lS I NCE l
DR lTHROUG HDUT l O R lTD l O R IDURI NG I J.
228
Q U A N T IT IE S R E S T R I C T I O N S
A
0 0 1! T HE D I MENS I ONAL SEQUENCE OES N OT OC CUR AS A R I GHT A DJU NC T OF
ON D
"
i N U NLESS THERE I S A N A I N ON ( A P O R T I C O IDO F EE T L O N G WAS
O R PN
" "A
SEEN : * P O R T I C O 12 0 F E E T W A S S E
DO I I H O U S E D A T t S CALES TC> I < ON> I
C O R E HAS OKADJ I NRNFLG .
H O U S E D A T < Q NS | < Q NP OS > y
< Q NP OS > 1 <LO NR> I
C O R E H A S OKADJ I NRNFLG O F C O R E Z .
H O U S E D A T < LD NR> I < ADJI NRN> T
S P OS S O R C O R E 2 HAS OKADJI NRNFLG .
t D0 2 : Q N D O E S N O T C O N T A I N PN I F I T IS O C C URRI NG I N L N T H R E E IN C H
I N LE NGTH
DOE : H O U S E D A T < P N> : < S CALES TG> I
C O R E HAS PNFLG .
H O U S E D A T < S CALES TG> I < Q N> T
< ON> I < Q NPOS > T
< D NPOS > I <L ONR> I
C O R E HAS PNFLG O F C O R E 2 .
H O U S E D A T < LQ NR> | <A DJ A D J> I
BROS S O R C O R E 2 H A S N T P NFLG .
DO} ! T H E QN S T R I N G I N A D J E C T I V A L P O S I T I O N C A N B E F O L L O W E D B Y A D J
" " "A T W O
O N L Y I F N I N ON I S NUN I TS ( A T W O I N C H L O N G L I N E . *
C O R E HAS PLURALFLG O F C O R E 2 .
HOUSED AT ( O N) :
-
229
HOUS ED AT ( ON) ! ALL O C C U R R E N C E S E X C E P T < ONPOS > T
< ONP OS > I A L L O C C U R R E N C E S E X C E P T < LONR> ,
< L ON R > I A L L O C C U R R E N C E S E X C E P T < ADJADJ» :
SSS OR C O R E Z H A S N T ONLYAPOS FLG.
H O U S E D A T < L ON R > I < A P O S > :
$88 OR C O R E 2 H A S N T NOAP OS FLG .
t W0 2 ! I N ON. I F S CALES TG I s A . T H E N A IS A S C A L E ( L O N G . W I D E ) O R
C O M P A R A T I V E ( L A R G ER ) ( “T W O I N C H E S L O N G O R W I D E ! . " A S H A D E D A R K ER
t OR
WOZ ! HOUS ED AT « S CALES TG> I
$ P O S A O R C O R E 2 H A S A S C A L E O R C O M P A R A T IV E .
t WOBI I N P N O P T I O N C F S CALES TG I N IS NS CALE ( T W O I N C H E S I N L E N G T H " )
"
S P O S A OR C O R E 2 HAS Q ROV I NG .
H O U S E D A T < PN> ! < NUL2 RS UBJ> I
S P OS S O R C O R E 2 HAS !OF I .
WOT! ON O P T I O N O F L P C A N B E C H O S E N O N L Y W I T H A P P R O P R I A T E P R E P O S I T I O N .
WOT ! H O U S E D A T < ONP OS > 8 < LP > !
C O R E H A S ONPOS FLQ .
H O U S E D A T < LP> I < P N> !
C O R E HAS ONPOS FLG O F C O R E 2 .
H O U S E D A T <t p> | < PN> ;
-
2 30
S ENT ENCE NOP I NALI Z ATI ON RESTR I CT I ONS
t
DS N I I C O R R E C T S U B J E C T P CR S N O R A S S E R T I O N O B J E C T O F lBE l
t ( "T H E TR UT H IS W E NEED
US NI I H O U S E D A T < S N> , < A S S ER T I O N > | < OBJECTB E> :
CCRE H A S S NAOBFLG .
H O U S E D A T < FORTOVO> 3 < S N> 3
CCRE H A S FORTOVOFLG .
H O U S E D A T < T O V O > : < S N> I
CCRE H A S TOVOFLG .
H O U S E D A T < S N> a < S U B J E C T > ! < OBJECTBE> I
C O R E HAS FORTOVOFLG : TOVOFLG O F C O R E 2 .
H O U S E D A T < OBJECTBE> 3 < O B J E C T > ,
<OBJ EC T> : < AS S ERTI ONVO> ] < VES NOOVO> 3 < TS UBJVOVO>
y
< V I N G O > : < V E N O > 1 < T O V O > , < VO> 1
< P AS S OBJ> 3 < VENPAS S > ,
< V I NGO>: ‘ V EN O>, < VO> , < VENPAS S > . < T OVO> : < OBJECT>;
< PAS S OBJ> y
< T OV O> : < T O V 0 -N> I
< VENP AS S > I « NULOBES > ,
< NULOBES > I < OBES> £
CCRE H A S S NAOBFLG : FORTOVOFLG ' TOVOFLG O F C O R E 2 .
HOUSED AT < L N 1> 3
CCRE HAS NULLNFLG .
HOUSED AT < LNR> : < NS TG> ]
< NS TG> : < SUBJECT> :
CCRE HAS NULLNFLG OF C OR E2.
HOUSE D AT ‘ SUBJECT> : TS UBJVO> y
< A S S E R T I O N > , < YES NOQ > ; <
S P O S A O R I F C O R E 2 H A S S NAOBFLG A N D S P A N I I S N T NL T H E N
C O R E I H A S NS ENTI O R NS ENT2 O R NS ENT3 O R ( P R C
A N D N O T NHUHAN) O R NULLNFLG O R FORTOVOFLG
C R TOVOFLG ,
H O U S E D A T <S U B J E C T > : « O B E S > I
S P O S A O R I F C O R E 1 H A S S NAOBFLG T H E N C O R E 2 H A S NS ENT I O R
NS ENT2 O R NS ENT3 O R ( P R O A N D N O T NHUMAN) O R
NULLNFLG O R FORTOVOFLG DR TOVOFLG .
DS NE I A N S N S T R I N G OR A S S E R T I O N O C C U R S A S T H E R I G H T A D J U N C T O F A N
ADJECT I V E ONLY F OR CER T A I N
" " "
S U B C L A S S E S O F A D J E C T I V E S ( I T I S T R U E T H A T H E C NE .
A * I T IS
R OUND THAT HE
DS NZ I H O U S E D A T < S N> ; < A S S E R T I O N > : < RA> I
C O R E H A S S NARAFLG .
S P U N G O R I NTER( P ) X
-
2 32
H O U S E D A T < RA> u < L A R > 1
S P O S H O R I F C O R E 2 H A S S NARAFLG T H E N C O R E I H A S AS ENT 1 O R
AS ENT3 O R VS E NT I .
I F C O R E 2 H A S S NARAFLG A N D C O R E 1 H A S AS ENT 1 A N D NCT
AS E NT3 T H E N C O R E H A S S UBJ I TFLG ,
CCRE HAS S NARAFLG O F C O R E 2 .
H O U S E D A T < LAR> 3 ( ADJ I NRN> :
S P0 8 3 O R CCREZ H A S N T S NARAFLG ,
HO U S E D A T < L A R > 1 < N A > : < NULBE I NGc> , < AS TG> ,
< NULBE I NG O> : < BEI NG O> ;
< AS TG> 8 < ADJN> 1 < OBJBE> ; < P AS S OBJ> 1 < NULOBES > y
< CBJECT> 3
< OBJBE> : < OBJECTBE> , < O B J E C T > , < AS OBJBE> y < P AS S OBJ> y
C O R E H A S S UBJWHFLG .
HOUS ED AT < NS TG> : <S U B J E C T > :
- 233
H DS NO I A S T R I N G O F S N C A N B E A P O S T -O B J E C T A D J U N C T O F T H E S U B J E C T CNLV
t I F T H E S U B J E C T I S A NO U N O F S U B C L A S S NS ENTI O R HS ENT2 A N D T H E
t S U B J E C T D O E S N ' T H A V E AN S N R I G H T A D J U N C T ( " E V I D E N C E IS P R E S E NT E D
i T HAT GLUC AGON IS A
ES NH I H O U S E D A T < S N> t ( RNS UBJ) , < RN> I
C O R E HAS RNS NFLG.
H O U S E D A T < RN> : < LPROR> ,
-
2 34
A OS NAI A STR I NG OF SN CA N BE A POS T OBJECT
'
A D J U N C T O F T H E S U B J E C T CNL ‘
I F T H E S U B J E C T I S A NO U N O F S U B C L A S S NS ENT I O R NS ENT2 A N D T H E
S U B J E C T D O E S N ' T H A V E A N S N R I G H T A D J U N C T ( " E V I D E N C E I S P R E S E NT E
T HAT GLUC AGON I S A
H O U S E D A T < S N> 3 ( RNS UBJ)
; < RN> !
C O R E H A S RNS NFLG.
H O U S E D A T < RN> : < LPROR> ,
<L N R > ; < LPROR> : < NS TG> :
< NS TG> : <S U B J E C T> :
< RNS UBJ> | <R E P S A > ;
<R E P S A > ! < S A> :
<S A> : < YES NOOVO> p a i < TS UBJVOVO> o 4 1
‘ VENP AS S > 0 6
, ‘ V I N G O " 6 ) ‘ TOVO’ I T I < S OBJBE> , Ay
< NULS AS OBJBE> I
S P O S A O R I F C O R E 2 H A S RNS NFLG A N D S P A N I I S N T NL T H E N
C O R E 1 H A S ( NS ENT I O R NS ENT2 ) AND N O T RNS NFLG .
OS NS I A N S N S T R I N G I S A C C E P T A B L E AS R I G H T A D J U N C T O F N O N L Y I F N IS
F NS ENT I : NS ENT2 O R NS ENTP . I F N I S NS ENTP : N I S I N P N W I T H
" "
R
APP CPRI ATE P A N D T H E U L T I M A T E S U B J E C T I S IT .
DS NS I H O U S E D A T < RN> ! < LNR> 1 0 2 I < LNR> Z p Z I
S P O S A O R I F C O R E 2 H A S RNS NFLG T H E N C O R E 1 H A S NS ENTI O R
NS ENT2 O R NS ENTP .
I F C O R E 2 H A S RNS NF LG A N D C O R E 1 H A S NS ENTP T H E N CCRE
H A S NS ENTPFLG.
H O U S E D A T < L N R > : A L L O C C U R R E N C E S E X C E P T < NS TG> ;
< NS TG> ! A L L O C C U R R E N C E S E X C E P T < NS TGO> :
< NS TG O> I A L L O C C U R R E N C E S E X C E P T < PN> !
S P OS A O R C CREZ H A S N T NS ENTP FLG .
H O U S E D A T < L N R > ! < NS TG> !
< NS TG> ! < NS TG O> |
C O R E H A S NS ENTPFLG O F C O R E 2 .
H O U S E D A T < NS T GO> : < P N> !
I F C O R E 2 H A S NS ENTP FLG T H E N C O R E H A S S UBJ I TFLG .
S POS S O R I F C O R E 2 H A S NS ENTPFLG T H E N C O R E 1 NS ENTP I PVAL
( C O R E 2 ) X NL.
H O U S E D A T < P N> ! < NULTS UBJVO> 1 ( NOLOBES > , < NPN> y < P NN> y
< P NTHATS VO> | < NULV I NGS TGP N> y < O B J E C T > ;
< NU DPP N> 1 < OBJBE>
L , < P NS NHH> 1 < P AS S OBJ> g
< NULTS UBJVC> : < TS UBJVO) ,
—2 34
< NULV I NGS TGP N> 3 TGP N> 1 < P NV I NGS TG> 3
< VI NGS
< NULDPP N> 3 < DP 2 P N> p < DP 3 P N> 3 ¢ DP 4 P N> y < DP 1 P N> !
< OBJBE> ! < O B J E C T > , < OBJECTBE> 3 < NULS AS OBJBE> y
< DP 2 P N> . < cP 3 P N> , < DP AP N> , < DP 1P N> . < P NS NNH> I
< OBJECT> :
< AS OBJBE> . < DP 1P N> . < P NS NH H> I < P AS S OBJ> 3
<V I N G O>: ( V E N O > . < VO> o < VENPAS S > o <T OV O> : < OBJECT> :
< P AS S OBJ> ,
<T OV O> : < T O V 0-N> !
< VENP AS S> 3 < NULOBES > 1
< NULOBES > I ¢ O B ES> 3
C O R E H A S TOVO~NFLG.
H O U S E D A T < RA> | s LAR> z
SP OSA OR I F C OR E2 HAS ToVo-NFLG THEN CORE 1 HAS VS ENT 1 OR
AS ENl AFORTO .
DS N7 : I F S N I S I N R N T H E N H O S T N O U N I S NS ENT I O R NS ENTP sAS HOULD.
I F S N I S I N RNS UBJ T H E N T H E S U B J E C T I S NS ENTI I AS HOULD .
DS N7 : H O U S E D A T < ClS HOULD> : < S N> I
CCRE H A S C IS HOULDFLG .
H O U S E D A T ( S N ) : < REPRN> : < RNS UBJ> 1
< REPRN> : < RN> ;
< RNS UBJ> : < REPS A> ,
< R EPS A> : A> :<S
< S A> : < AS S ERTI ONVO> ; ¢ VES NOOVO> 3 < TS UBJVOVO> 1
t TOVO> y < NULS AS OBJBE> y < V I N G O > , < VENP AS S > y
C O R E H A S NT C lS HOULDFLG .
HOUSED AT < RH> I
2 35
SP OSA OR I F C O R E 2 HAS C lS HOULDFLG T H E N C O R E 1 H A S NS ENT I :
AS H OULD O R NS ENTP I AS HOULD.
H O U S E D A T < AS S ERTIONVO> : < A S S E R T I O N > ,
< YES NOOVO> g < YES NOQ > ;
< TS UBJVOVO> u < TS UBJVO> 1
<V I N G O> ! « S VI NG O> ,
<T O V O > : < FORTOVO> 3 < NTOVO> 3
<T OV O- N> l < S TOVO- N> y
< VENP AS S > | < S vEN> g
< OBJBE> : ¢ S OBJBE> 1
< NULS AS OBJBE> 3 < S AS OBJBE> I
S P O S A O R I F C O R E Z HAS C IS H OULDFLG A N D S P A N : I S N T NL T H E N
C O R E I HAS NS ENTI I AS HDULD.
H O U S E D A T < OBJBE> : < S OBJBE> I
I F C O R E HAS NS ENTI I AS HOULD T H E N C O R E H A S
GKC IS HOULDFLG .
H O U S E D A T < S A> ! « OBJBE> . AI
S P O S A O R I F C O R E 2 H A S C IS HOULDFLG T H E N C O R E I H A S
OKC IS HOULDFLG o
t DS NB I A S TR I N G I N SN R A R EL Y I F EV ER OC CUR S AS T H E V A LU E O F T H E S U B JECT OF
H A STR I NG I N SN OR RELATED STR I NGS .
OS NB I H O U S E D A T < S N> 3 ( S U B J E C T ) !
C O R E H A S S UBJS NFLG.
H O U S E D A T <S U B J E C T > : <A S S E R T I O N > :
<ASS ER T I ON> : < HHETHS > | < H H8 -N> ; < P NHS > ; < P H H3 -P N> 3
-N> 1
( H HNs < PNHNS > y < PHHN8 -PN> :
CORE HAS S UBJS NFLG O F C O R E 2 .
H O U S E D A T <S U B J E C T > : < FORTOVO> y < NTOVO> 1 < S OBJBE> 1 < S V E N > I
< S AS OBJBE> y < S TOVOv N> 8
<ASS ER T I O N> ! <S- N> ; < T H A T S > 1 < CIS HOULD> 1 < S vO> y
< NHETHS > , < H HS - N> , < PWHS > , < PNHS - P N> . < H HNS -N> .
< P HHNS > o < P NH NS - PN> I < S NH H> I
S RARE O R C O R E 2 H A S N T S UBJS NFLG .
t DS N9 : TOVC AS N O N -S E N T E N T I A L R A A D J O I N S O N L Y ADJ I AAS P O R
" " " "
i A S E N TI I A O O ( H E I S A P T T O D O I T :
F RT H E IS N O B L E T O D O I T )
A AND H A S A H U M A N S U B J E C T .
OS N9 I H O U S E D A T < T O V O > : < RA> I
CCRE H A S RATOVOFLG.
H O U S E D A T < RA> I < L A R > 3
S P O S A O R I F C O R E 2 HAS RATOVOFLG T H E N C O R E 1 H A S AAS P O R
AS ENT I I AFORTO.
H O U S E D A T ( L A R > 8 < NA> p < NULBEI NGC> , < AS TG> ,
< NULBEI NGO> 3 < BE I NGO> 3
< AS TG> 3 < ADJN> ; < OBJBE> : < P AS S OBJ> 1 ( NULOBES > 7
( OBJECT> I
< OBJBE> ! < OBJECTBE> 1 < O B J E C T > ] < AS OBJBE> y < P AS S OBJ> I
<O B J E C T > : < AS S ERTI ONVO> , < YES NOOVO> 1 < TS UBJVOVO> ;
-
2 36
< NULOBES > z < OBES> I
CCRE H A S DVBVENP AS S FLG O F C O R E 2 ,
H O U S E D A T < S U BJ E C T > : < FORTOVO> , < NTOVO> y < S OBJBE> 1 < S VEN> y
< S AS OBJBE> g < S TOVO-N> : < YES NOQ > :
< TS UBJVO> I
C O R E H A S S UBJS NFLG O F C O R E 2 .
H O U S E D A T < AS S ERTIONVO> : < A S S E R T I O N > ,
< YES NOOVO> g < YES NOQ > ;
-
238
S P OS 3 OR I F C OR E 1 H A S FORTOVOFLG A N D C O R E 2 H A S DOBFLG
AND S NAOBFLG T H E N C O R E 2 H A S FORTOVOFLG .
S P0 8 3 O R I F C O R E 1 H A S TOVOFLG A N D C O R E Z H A S DOBFLG
A ND S NAOBFLG T H E N C O R E 2 H A S TOVOFLG .
H O U S E D A T <S U B J E C T > : « OB ES> :
$ P OS3 OR I F C ORE2 H A S FORTOVOFLG A N D C O R E 1 H AS DOBFLG
AND S NACBFLG T H E N C O R E 1 H A S FORTOV OFLG ,
S POS S O R I F C O R E 2 H AS TOVOFLG A N D C O R E 1 H A S DOBFLG
AND S NAOBFLG T H E N C O R E 1 H A S TOVOFLG .
A HS NA: I F V E R B HAS LHR AND I S E L E ME N T O F C lS HOULD T H E N LNR I S
" " " " "
F SHOULD ( I N S I S T T H A T H E S HO U L D D O I T I NS IST HE S HOULD DO
H S NA I H O U S E D A T < LHR> I < V E R B > :
I F C O R E 2 H A S [ S H O U L D I T H E N C O R E HAS S H OULDFLG .
H O U S E D A T < V E R B > : < AS S ERTI ONVO> :
< AS S ERTI ONVO> : <AS S ER T I ON> !
CCRE H A S S H OULDFLG O F C O R E Z .
H O U S E D A T < V E R B > : A L L O C C U R R E N C E S E X C E P T < AS S ERTI ONVO> ;
<ASS ER T I O N> : A L L O C C U R R E N C E S E X C E P T < C lS HOULD> :
S P O S A O R C O R E 2 H A S N T S H OULDFLG .
H O U S E D A T < A S S E R T I O N > : < C lS HOULD’ I
S P O S A O R CCREE HAS S HOULDFLG .
t HS NS I C IS HOULD S T R I N G H I THOUT " T H A T " I S N O T T A K E N A S S U B J E C T ( " T H A T
" A"
HE SHOULD LEAVE H A S TO BE EXPECTED HE S H O U L D L E A V E HAS T O B E
t E X P E C T E D ")
H S NS : H O U S E D A T ITHAT I : < C IS HOULD> 3
C O R E HAS THATFLG .
H O U S E D A T < C lS H OULD> : < S N> I
C O R E H A S TH ATFLG O F C O R E 2 .
H O U S E D A T < S N> 1 < S U B J E C T > :
$ P O S S O R C O R E 2 HAS TH ATFLG .
" "
HS NS I IF H HETHS B E G I N S H IT H IF T H E N I T IS N O T O C C U R R I N G As T H E
SUBJECT .
HS NS I H O U S E D A T ( I E I I < NULH HETHS > 2
C O R E H A S I FFLG .
H O U S E D A T < NULH HETHS > a ( H HETHS ) !
< H HETHS > z <S NHH> 1
<S NHH> 8 < sN> :
CORE HAS I FFLG O F C OR E2.
H O U S E D A T < S N> x < S U B J E C T > !
$ R A R E O R CCREZ H A S N T IFFLG .
" " "
HS N7 : H H EN H HETHS O C C U R S AS A N S A . I T C O N T A I N S A N OR . ( H HETHER
" "
N OT Y OU G O . I H ILL G D . * HHETHER Y O U G0 ; I HI L L
HS NT I H O U S E D A T ( ORNOT> : ( H HETHS > : 2 T
C O R E HAS ORNOTFLG .
H O U S E D A T < ORNOT> a < H HETHS > o 4 3
S P 0 5 3 O R C O R E 1 H A S N T ORNOTFLG .
C O R E H A S ORNOTFLG .
H O U S E D A T ( H HETHS ) ! < S A H H > 3
$ P O S S O R C O R E 2 H AS CRNOTFLG .
HS NB s I N S AH H I ICHS TG T H E D E E P E S T V E R B I S S E N T E N C E O P E R A T O R V E R B .
VS ENT I ( S U R P R I S E . A M A Z E ) OR VS ENT2 ( P R O V E . R E S U L T ) OR VS ENT3
"
( P R E D I C T . KNOH ) C R E V E N T V E R B ( H A P P E N ' O C C U R ) . ( H E R E C O V E R E D .
" "
HR I C H S U R P R I S E D I F S T R I N G H E A D IS HH I CH DEEPES T V ERB
-
2 39
IS VS ENT I .
HS NB I H O U S E D A T < A S S E R T I O N > ! < S AWHICHS TG> !
S P O S A O R ( C O R E 2 H A S DVBFLG A N D ( VS ENT I O R VS ENT2 O R VS ENT3
C R VEVENT) A N D ( I F C O R E 1 H A S H H I C HFLG T H E N
C O R E 2 H A S VS ENT I JI O R ( C O R E 2 H A S DOBFLG A N D
( A D J A N D ( AS ENTI O R AS ENT3 ) ) O R ( V I N G A N D
VS EHT I ) ) O
C O R E H A S NS TARTFLG .
H O U S E D A T < AS TG> I < C BJBE> 3
I F C O R E 2 HAS V I N G T H E N coae HAS NS TARTFLG .
H O U S E D A T < OBJBE> ! ( OBJECTBE) ! < O B J E C T > ,
< OBJECTBE> 3 <O B J E C T > !
CCRE H A S NS TARTFLG O F C O R E E.
H O U S E D A T < O B J E C T > : < VI NG OFN> 8
I F C O R E 2 H A S DP AFLG T H E N C O R E H A S N T CFDP AFLG .
I F C O R E 1 H AS OFFLG T H E N C O R E 2 H AS NS TARTFLG ,
H O U S E D A T < V I NGOFN> 1 ALL OCCURRENCES !
S P O S A O R C O R E Z H A S N T OFDP AFLG .
-2 40
c zz H O U S E D AT < LVR> :
S p csa OR I F C O R E 2 HAS VBE T H E N C O R E 1 H A S N T VDO.
t H VCB I V E N O I S NOT AN A C C E P T A B L E V A L U E OF O B J E C T I N s o NOR I N V INGO
A AFTER "
BE "
H AS HAD H AD G O O D
c ss H O U S E D AT < V E N C > I < O B J E C T > !
C O R E HAS VENOFLG .
H O U S E D AT < O B J E C T > : < VEND> T
S POS S OR C O R E 2 H A S N T VENOFLG .
H O U S E D AT ¢ OBJECT> I < V I N G O > !
C O R E HAS VENOFLG OF C O R E 2 .
H O U S E D AT < V I N G O > ! < OBJECTBE> I
S P CS S OR C O R E 2 H A S NT VENOFLG .
A c a n THE C O R E OF LVENR IS NOT VNOP AS S H AS
c a n H O U S E D AT < LVENR> : < VENP AS S > I
S P O S A OR C O R E 2 HAS POBJLIS T .
A HVCS I " " " "
I N YE S N O O A NO T S U BJVO: O N L Y BE : HAVE OR H CAN O C C U R I N
A vE R B I P C S I T I ON . ( "
I S H E H ORK I N G O N THE B O O K ? " A " NCRKS HE ON
A THE
c s: H O U S E D AT < L T V R > : < VERB I> I
S P CS A OR C O R E 2 HAS VH AVE OR VBE.
A H VCO I IN O B E S U L T I M A T E V E R B IS VBE OR BE R E P L A C E R .
c es H O U S E D AT < V E R B 3 > I ¢ O B E S > I
S P O S A OR C O R E 2 HAS VEE OR VHAVE OR BEREP .
H O U S E D AT < V E R B A> T < OBES > T
S RCS A OR I F C O R E 1 HAS VHAVE T H E N C O R E 2 HAS VBE.
A c " "
as P N AS THE O B J E C T OF BE C A N N O T H A V E R a S I NCE U N L E S S THE ULT I NATE
A " " " "
S U B J E C T 18 IT . ( IT I S S I NCE TUESDAY THAT THEY HAV E BEE N V IS I T I NG
A A " THEI R V I S I T IS S I N C E
HVCS I H O U S E D AT < AS S ERTI ONVC> I < A S S E R T I O N > ,
< YES NOOVO> I < YES NOQ > :
< T8 UBJVOVO> I < TS UBJVO> I
< TOVO> : < FORTOVO> T
S P CS A OR I F C O R E 2 HAS DOBFLG AND TS I NCE I THE N CORE 1 HAS TI T I.
H O U S E D AT < HNA T « NULCBES > T
3 9 0 3 4 OR C O R E 2 H A S NT IS I NCE I .
-
2 42
H H' S TR I NG RESTR I CT I ONS
< H HETHS > : < S NH H> . < NP S NH H> : < NTHATS > : <T HA TS> ,
<T OV O- N> :
< S N> T A L L O C C U R R E N C E S E X C E P T < S U B J E C T > ! < OBJECTBE> T
( REP RN> ; < RA> g
< ASS ERT I ON> : A L L O C C U R R E N C E S E X C E P T < NULNTHATS > T
( HH ETHS ) ! < T H A T S > : < C lS HOULD> : < O B J E C T > :
< NUL2 H HO -N> T < P H HS -P N> ; < P H H NS -P N> ,
< H HS -N> ; < H H NS -N> ; < H HATs -N> ; < T H A T S -N> T
<S-N> T ( H HEVERS -N> :
< FORTOVC> I ALL OCCURRENCES EXCEPT < OBJECT> ; < S N’ I
< P AS OBJ> T < FORTOVO -N> y
< H HETHS > T A L L O C C U R R E N C E S E X C E P T < O B J E C T > : < S NH H> T
<S NHH> I A L L O C C U R R E N C E S E X C E P T < P AS S OBJ> T < O B J E C T > ;
( S N) ; < NP S NHH> ,
~
243
< SUBJECT>: A L L O C C U R R E N C E S E X C E P T < AS S ERTI ON> T
< YES NOQ > ! A L L O C C U R R E N C E S E X C E P T < NUL2 HH0 -N> T
< P H HO -P N> T -RN> T
< P WHNO
< PN> : < OBJBE> : < P S TG> T < NP VI NGS TG> T < P NN> T < NP N> I
< NN> : 3 T
< P N> ! A L L O C C U R R E N C E S E X C E P T < O B J E C T > : < P AS S OBJ> T
< PS TG> T < OBJBE> ; < PNTHATS VO> ; < NP V I NGS TG> y
-
2 44
NULLOBJBEFLG O R S OMI TFLG O R OOMI TFLG O R P OMI TFLG
O R S OFITR I FLG O R OOMITRIFLG O R P OMITRIFLG O R
S CFI TRZ FLG O R OOH I TRZ FLG O R P OMITRZ FLG
S P O S E O R I F C O R E 1 HAS NULLS UBJFLG O R NULLHHNOFLG O R
NULLHHP OFLG O R POS TOBJFLG O R ADJOMITFLG O R
NULLOBJBEFLG O R S OMITFLG O R OOMI TFLG O R POMITFLG
O R S OF I TR IFLG O R OOMITRIFLG OR P OMITRIFLG O R
S OF ITRZ FLG O R OOMITRZ FLG O R POMITRZ FLG
T H E N COREa H A S N T NULLS UBJFLG O R NULLHHNOFLG O R
NULLHHP OFLG O R P OS TOBJFLG O R ADJOMI TFLG O R
NULLOBJBEFLG O R S OMITFLG O R OOMITFLG O R P O NI T E L O
O R S OFITRIFLG O R OOMITR IFLG O R POMITR IFLG O R
S CF ITRZ FLG O R OOMITRZ FLG O R POMITRZ FLG
HHHZ I D E T E C T A Z E R O E D S U B J E C T AND S ET U P F O R T E S T I N G C O N D I T I O N S F O R I TS
" " "
t ACCEP TAB I LI TYI A BOOK H HI C H I S I N T E R E S T I N G A BOOK THEY SAY IS
"
N
I NTER EST I G .
HH HZ I H O U S E D A T < S A> : < S AS OBJBE> : 2 T < S OBJBE> : 2 1
IA S I T < S AS OBJBE> T
C O R E H A S NULLS UBJFLG O F C O R E 2 .
H O U S E D A T < C lS HOULD> : < S N> I < PNTHATS VO> T
< C lS HOULD> . < NTHATS > : < S VO> . < A S S E R T I O N > : < S AS OBJBE> :
C O R E H A S NULLHHNOFLG .
-
246
HOUS ED A T < V ER B> : < AS S ERTI ONVO> !
< VERBZ > I « YES NOOVO> T
< LVENR> : C VENO> T
< LVI NGRH I V I NG O> :
<
SP OS E O R C O R E 2 H A S N T NULLH HNOFLG .
HOUSED A T < NN> : ( E NTHATS > : < PNN> : < ADJN> : < NP N> : < NPVI NGS TG> :
< NPVI NGC> . < NPS VI NGO> . < NPS NH H> , < NT HATS > . < NS NH H> :
< NA> I ‘ ND’ , < DP 2 > O < DP 3 ’ 0 < DP H> : ‘ VO’ I
- 247
" " "
COPY OF : T HE P AP ER I HA V E A C OP Y OF A C OPY OF .
H HH3 B I H O U S E D A T < P N> : < REPRV> I
I F C O R E 2 H A S NULLHHNOFLG T H E N C O R E HAS P OS TOBJFLG .
H O U S E D A T < REPRV> I < RV> !
C O R E H A S P OS TOBJFLG O F C O R E 2 .
H O U S E D A T < RV> ! A L L O C C U R R E N C E S E X C E P T < AS S ERTI ONVO> : < V E N O > :
< YES NOOVO> T < VENP AS S > : < V I N G O > ; < VO> , < TOVC> I
S P OS Z O R C O R E 2 H A S N T P OS TOBJFLG .
H O U S E D A T < P N> ! < RNP> I
I F C O R E 2 HAS NULLHHNOFLG T H E N C O R E 2 H A S IOF I O R
IFOR I .
I F C O R E 2 H A S NULLHHNOFLG T H E N C O R E HAS ADJOMI TFLG .
H O U S E D A T < RNP > I < REPRN> ,
< REPRN> : « RN> ,
( RN) ! ‘ LNR’ : I I 2 I
<L N R > : < NS TG> !
CCRE H A S NULLOBJBEFLG .
H O U S E D A T < S A> ! < S UBJBE> : AI
I F S P A N 1 I S NL T H E N C O R E H A S NULLOBJFLG .
H O U S E D A T < O B J E C T > : < AS S ERTI ONVO> :
< OBJBE> : « S OBJBE> T < AS OBJBE> T
< NULS AS OBJBE> T < S AS OBJBE> I
CCRE H A S NT NULLOBJBEFLG .
H O U S E D A T < AS S ERTIONVO> : < A S S E R T I O N > :
< S OBJBE> : < S AS OBJBE> : < AS OBJBE> I <O BJE CT> )
< AS OBJBE> I < P AS S OBJ> I
248
HOUSED AT INH I CH I I < NULHHS -N> , < NULP WHS > | < NULP NHS -P N> |
CCRE PAS NONHUMFLG .
H O U S E D A T < NULNHS -Nz ;
< NULPHHS » : < P WHS > ,
< NULPNHS - P N> : < PWHS - P N> I
<W HS- N> : ‘ P NHS D , < PNHS - P N> I < RNNH> 3
< RNNH> I < RN> !
CCRE H A S WHATFLG O F C O R E Z .
H O U S E D A T ( H HS -N> o < P NHS - RN> , < PNHS > I < RNWH> 1
t O N L Y I F TP OS IS O C C U R R I NG I N A NH OUES TI ON O R - W - "
H S T R IN G ( W H IC H B O O K
" "
DI D Y O U C H O O S E . O N NHCS E B R A N C H E S T H E L E A V E S A R E
NNPS Z I H O U S E D A T < WHLN> : < TP OS > ;
CCRE H A S NHLNFLG .
H O U S E D A T < TP OS > : < TQ POS > ; < L N 1> , < LN2 > y
< TQ P OS > : < LNVAR> |
C O R E H A S NHLNFLG O F C O R E 2 .
H O U S E D A T < TP OS > ! A L L O C C U R R E N C E S E X C E P T « T OP O S > ! < LN 1> I < LN2 > T
< L N R > : < VI NGOFN> I ALL O C C U R R E N C E S E X C E P T < NHN> t
S POS S O R O C R E E H A S N T NHLNFLG .
H O U S E D A T < L N R > , ‘ VIAGOFN> 3 < N HN> a
$ P O S S OR O C R E P AS N HLNFLG .
NNPS S I 1 N NHO-N I F V E R B IS H A V E : S E. D O T H E N YES NOO O P T I O N M U S T B E U S E D .
HH P5 3 I H O U S E D A T <V E R B > ! < AS S ERTI ONVO> :
C O R E P AS VH AVEBEDOFLG O F C O R E 2 .
H O U S E D A T < A S S E R T IO N > : < NUL2 N HO- N> I
S P OS U OR CCRE2 H A S N T VHAVEBEDOFLG .
t NNHS A: T H E A S S E R T I O N OP TIcN D O E S N O T FoLLOw W H O M .
NWHS O I H O U S E D A T < YES N OQ > : < NUL2 WHo- N> I
INH CN I I < NUL1H HO- N> i
C OR E H A S WH OMFLG .
H O U S E D A T < NUL1NHO- N> a < WHQ - N> l
-
250
CCRE P AS HH OH FLG O F C O R E E.
H O U S E D A T « NULZ WHO- N> : « WHO-N) :
I
IN D E X OF FLA GS
T H E F L A G S U S E D I N T H E R E S T R I C T I O N S OP A P P E N D I X B A R E L I S T E D H E R E I N
A L P H A B E T IC A L O R D E R . F O L L O W I N G E A C H F L A G IS A B R I E F E X P L A N A T I O N O F
I TS I N T E N D E D NEAN I NG A N D A L I S T O F T H E R E S T R I C T I O N S I N W H I C H I T
APP EARS . ’
" "
ABOUTFLG I DP P S T R IN G HAS DP ABOUT
WP CS IS
" "
ACROS S PLG I DP P STR I NG PAS DP A CR OSS
WP CS IS
" "
ALCNGFLG I DP P S T R IN G HAS DP ALONG
WPCS IS
" "
AWAYFLG I DP P S T R IN G HAS DP AWAY
WP CS I S
CENTERFLG ! SA CA N CNLY A P P E A R IN C E N T E R -L I K E S T R IN G S
DP CS T
-
252
LPFLG ! P R E P O S IT I O N H A S LEFT ADJUNC T
WCCMT: WP OS ES
NONHUMFLG I N O N -H U M A N HP-WCRD
WWHbB
'
NOPROFLG I C E R T A IN SA S C A NN O T APPEAR IN PROS ENT
WPCS I9
NP OS FLG I N OU N P O S IT I O N O F L E F T ADJUNCT OF N O U N IS F IL L E D
WCCME' WNI O; WP CS Z I
" "
NS TARTFLG I OB JECT S TARTS W I T H N O U N A N D IS V A L I D A F T E R OF IN
VI NGOFN
WS N1 1
NULLNFLG ! NOU N P H R A S E W IT H Z E R O E D N O U N
OS NI
NULLOBJBEFLG ! OBJEC T OF BE O M IT T E D PR OM S T R IN G
NNP ICI NWH4
-
254
NULLWHPOFLG : P R E P O S IT IO N A L -PHRASE OBJECT O M IT T E D FROM S T R IN G
WWH IB: WWHIC ' WWH3 B: WWHS
A
CFDP FLG I
"
OF "
OR D P “ O B J E C T R E Q U IR E D I N VI NGOFN
WS N I I
P AS "O "
OFFFLG I DP P S T R IN G DP FF
WPCS IS
" "
CFFLG I OF O C C U R S I N V I NGOFN
WS NI I : DVC I
" "
CNFLG I DP P S T R I NG HAS DP ON
WP CS IS
" "
CUTFLG I DP P S T R IN G PAS DP OUT
WP OS IS
" "
OVERFLG I DP P S T R IN G HAS DP OVER
WPOS IS
P OS TOBJFLG ! PN W I T H O M I T T E D N O U N S T R I N G C A N N O T O C C U R I N P O S T -O B J E C T
P O S IT IO N OF S T R IN G
WHPICI HH HS B
Q P CS FLG I Q U A N T I F I E R P O S I T I O N O F L E F T A D J U N C T O F N O U N IS F I L L E D
WCCMZ I DN I I DNS G y ONS I p WNIOI HS N I I
Q UES TI ONFLG I CE N T E R IS Q U E S T I O N
WP C8 2 3
- 256
S UBJWHFLG ! SUBJECT HAS AS V A L U E N S T S B E G IN N I N G H I TH WH' NORD
DS NZ
"
THANFLG ! S AWH I CHS TG B E G IN S H ITH THAN"
DP CS S
" "
THATFLG ! C IS HOULD B E G IN S W ITH THAT
WS NS I HH HZ
" "
THROUGHFLG I DP I
P S T R IN G HAS DP THR OUGH
WPCS IS
TOVC NFLG I
'
RA TAKES VALUE T O V OO H
DS NS
TP OS FLG ! A R T I C L E P O S IT IO N O F L E F T A DJU NC T OF N O U N IS F IL L E D
WCCMZ : ON I ! DN5 2 : DNS I
" "
UPFLG ! DP P S T R IN G HAS DP UP
WP CS IS
-
258
WFLG ! VERB I HAS VALUE LNR
DVC3
WWHS I
" "
WHENFLG I W H E N S B E G I N S W IT H WHEN
WCCMB
" "
WH I CHFLG I S AWHI CHS TG B E G I NS W I T H W H IC H
DP OS S a WS NB
WHOMFLG ! Q U E S T IO N B E G IN S "
WHOM"
WWHS A
259
A P P E N D IX D
S T R IN G G R A M M A R O F E N G L IS H U S E D IN C H A P T E R 4
PER S T A T I S T I C A L TESTS OF B NF C OMP ONENT
A 1. S E N T E N C E
t
<S ENTENCE> TIP [
INTRODUCER> J < C
< CEENTER> < ENDMARK> ‘
D
< R W H O> < t P> < NULPWHG> < YES NOQ >
< NULPWHO> :38 WHOM W H IC H I W H A T W H OSE
< WHNO -N> as! < NULWH NQ > < YES NOQ >
< PWHNO -P N> s un < A P> < NULWHNQ > < YES NOQ >
< P WHNG> < A R> < NULWHNG> < YES NOQ >
< NULWHNO> a n: < L N R > ‘ VI NGOF N>
a. PERNUTATI ON C E NTERS
i
< TS UBJVO> I t: < NULTS UBJVO> < V E R 8 1> < SUB JEC T>
[ ¢ S A> J
< NULTS UBJVO> I I: N E IT H E R NOR < DS TG> < P N>
<O BES> :18 ( NULCBES > < V E R B S > [ < VERS A> J < SUBJECT>
—2 6 0
t
<O BJECT> 8 l3 <T HAT8> ‘ h S TGO> <T OV O> < P N> I < PV I NGS TG>
< P V I h GO> I « PS NNH> I < PNN> I < P NVI NGS TG> I
< P NTHATS > < P NS NNH> I < P NTHATS VO> I < P8 VI NGO> I
< DP 2 > I < DP a> I < DP 2 P N> I < DP 4 P N> I < DP S N> I
< DP 1P N> I < DP 1> I < O B J E C T EE > I <VENO> I
< vo> I < S AS OBJBE) I < NP N> I < NANDN> I
< VI NGS TGPN> I < NPVI LGS TG> I < AS OBJBE> I < NPS V I NG O>
i 88 . D P S T R IN G S
a
-
2 62
<* DP>
:3 ! < * DP> [ < hULh ANDL> J
S IB DP>
( *
t¢ RV> J ‘ Tovo>
8 83
i t: <A S S E R T IO N >
< NULNTHATS >
[ < NS TGO> J
I 33 <T H A T S > I < AS S E R T I O N >
:3 8
< VENP AS S >
:l'
< LAR>
:38 [ < NS TGO> J ao. u
8 83 ‘ AS TG> [ < NS TGO> 1
[ < NS TGO> J « DS TG>
LS AS OBJBE>1
:I=
AS [ < NU
8 0 .6A
s ax < OBJBE> I < V IN G O >
AS
E A D J U N C T S T R IN G S
0 .
. a
I N S TG T
< P A>>I < 0 H
< * IN T > I < D S T O > RO> J I I < P N> 0
:8 8
< C S S T G> I < O B JBES A> I
< RS UBJ> I < RNS UBJ> I
< S UBJEES A> < V IN G O > I < VENP AS S > I < S A wH >
-
263
< NULS CBJBES A> :1: < OBJBES A> I ( VENPAS S ) I < V IN G O >
< S AWH ICHS TG> I < NHETHS > I < WHEV ERS -N>
< SAWH> I I:
:3 : < NS TG> <VER B>
<N V$ A>
t
i 10 . S U B O R D IN A T E C O N J U N C T IO N ( CS) S T R IN G S
t
< S UBZ > :1: <t csz> [ ¢ OBJBE> 1 [ ¢ S A> J
< S U8 1> '
< RNP > < P N> I < PV I NGS TG> I < P S VI NGO> I < PS NwH>
-
< NH8 N> I < W HE NS > I < P W HS > I < P N HS -P N> I
< RNNH> I83
< NHNS - N> I < PW H N S -P N > I < PwH NS >
t
12 . LN L E FT AD JU NC TS OF N
t
<L N > :1:
< TPOS > : 3! <L TR > I « NHLN> I ‘ LNS R> I < HOWQ S TG)
< LTR> :38
< LNS R> :33 NS > <*
-
264
< THATs -N> I ts T H A T < A S S E R T IO N >
<S -N> < CENAS F>
‘ S AWHI CHS TG> < NLLS ANH ICHS TG> < A S S E R T I O N >
G A Y LO RD p n m t co m u s A
-
266