Grammar Writing System (GRADE) of Mu-Machtne Translation Project 
and its Characteristics 
Jun-tcht NAKAMURA. Jun-tcht TSUJII. Makoto NAGAO 
Department of Electrical Engineering 
Kyoto University 
Sakyo. Kyoto. Japan 
ABSTRACT 
A powerful grammar writing system has been 
developed. Thts grammar wrtttng system ts called 
GRADE (GRAmmar DEscriber). GRADE allows a grammar 
writer to write grammars Including analysts, 
transfer, and generation using the same expression. 
GRADE has powerful grammar writing facility. GRADE 
allows a grammar writer to control the process of a 
machine translation. GRADE also has a function to 
use grammatical rules written tn a word dictionary. 
GRADE has been used for more than a year as the 
software of the machine translation project from 
Japanese Into Engltsh. which ts supported by the 
Japanese Government and called Nu-proJect. 
1. Objectives 
Vhen we develop a machine translation 
system, the intention of a grammar writer should be 
accurately stated tn the form of grammatical rules. 
Otherwise, a good grammar system cannot be 
achieved. A programming language to write a 
grammar, which ts composed of a grammar writing 
language, and a software system to execute tt. ts 
necessary for the development of a machine 
translation system (Bottet 82). 
If a grammar writing language for a machine 
translation system is to have a powerful writing 
facility, tt must fulfill the following needs. 
A grammar wrttlng language must be able to 
manipulate linguistic characteristics tn Japanese 
and other languages. The 11ngulstlc structure of 
Jcpanese tS largely different from that of Engltsh, 
for instance. Japanese does not restrict the word 
order strongly, and allows the omission of some 
syntactic components. Vhen a machine translation 
system translates sentences between Japanese and 
English, a grammar writer must be able to express 
such characteristics. 
A grammar writing language should have a 
framework to write grammars tn analysis, transfer, 
and generation phase using the same expression. It 
Is undeslrable for the grammar writer to learn 
several different expressions for different stages 
of a machine translation. 
There are many word specific linguistic 
phenomena tn a natural language. A grammar writer 
must be able to add word specific rules to a 
machine translation system one after another to 
deal wtth word specific linguistic phenomena, and 
improve hts machine translation system over a long 
period. Therefore. a grammar writing language must 
be able to handle grammatical rules written tn word 
dictionaries. 
There ts a natural sequence tn a 
translation process. For example, a parstng of 
noun phrases which do not contain sententtal forms 
is executed before a parsing of more complex noun 
phrases. An approximate parsing of compound 
sentences is executed before a parsing of complex 
sentences. Also. when an application sequence of 
grammatical rules are written explicitly, a grammar 
writing system can execute the rules efficiently. 
because the system Just needs to test the 
applicability of a restricted number of grammatical 
rules. So. a grammar writing language must be able 
to express several phases of a translation process 
in the expression explicitly. 
A grammar writing language must be able to 
treat the syntactic and semantic ambiguities tn 
natural languages. But tt must have some 
mechanisms to avoid a combinatorial explosion. 
Keeping these points in mind, we developed 
a new programming system, which ts composed of the 
grammar writing language and its executing system. 
Ve wtll call it GRADE (Grammar Describer). 
2. Expression of the data for a processing 
The form of data to express the structure 
of a sentence during an analysis, a transfer, and a 
generation process has a strong effect on the 
framework of a grammar wrtttng language. GRADE 
uses an annotated tree structure for expressing a 
sentence. Grammatical rules tn GRADE are described 
tn the form of tree-to-tree transformation wtth 
annotation to each node. 
338 
The annotated tree tn GRADE ts a tree 
structure whose nodes have ltsts of property names 
and their values. Figure 1 shows an example of the 
annotated tree. 
~ -CAT - S~ 
-NUMBER - SINGULAI LE-NUMBER - 
-SEM = HUMAN 
E-CAT : Engllsh Category Symbol 
E-NUMBER: English Number (SINGULAR or PLURAL) 
E-SEM :Engltsh Semantic Marker 
Ftgure 1 An example of the annotated tree tn GRADE 
The annotated tree can express a lot of 
Information such as syntactic category, number. 
semantic marker, and other thtngs. The annotated 
tree can also express a flag tn tts node. whlch ts 
stmtlar to a flag tn a conventional programming 
language, to control the process of a translation. 
For example, in a grammar of a generation, a 
grammatical rule ts applled to all nodes tn the 
annotated tree, whose processtngs are not finished. 
In such a case, a grammatical rule checks the DONE 
flag whether ttts processed or not. end sets T to 
the newly processed ones. 
3. Rewriting Rule tn GRADE 
The bastc component of a grammar wrtttng 
language is a rewriting rule. The rewriting rule 
In GRADE transforms one annotated tree tnto anoti~er 
annotated tree. The rewriting rule can be used In 
the grammars of analysts, transfer and generation 
phase in a machtne translation system, because the 
tree-to-tree transformation by thts rewriting rule 
ts very powerful. 
A rewriting rule tn GRADE conststs of a 
declaration part and amatn part. The declaration 
part has the following four components. (1) 
Directory Entry part, whtch contains a grammar 
writer's name, a verston number of the rewrttin 9 
rule, and the last date of the revision. Thts part 
ts not used at the execution ttme of the rewriting 
rule. A grammar wrtter ts able to see the 
information by ustng the help factltty of the GRADE 
system. (2) Property Definition part, where a 
grammar writer declares the property names and 
thetr values. (3) Vartable Intt. part, where a 
grammar wrtter declares the names of variables. 
(4) Matchtng Instruction part, where a grammar 
wrtter specifies the mode to apply the rewriting 
rule to an annotated tree. 
The matn pant specifies the transformation 
tn the rewriting rule. and has the following three 
parts. (1) Matchtng Condition part. where the 
condition of a structure and the property values of 
an annotated tree ts described. (2) Substructure 
Operation part, whtch specifies operations for the 
annotated tree that has matched wtth the condition 
wrttten tn the matching condition pant. (3) 
Creatton part, whtch spec|ftes the structure and 
the property values of the transformed annotated 
tree. 
3.1. Matching Condition part 
The matchtng condition part specifies the 
condition of the structure and the property values 
of the annotated tree. The matchtng condition part 
allows a grammar writer to spectfy not only a rtgtd 
structure of the annotated tree, but also 
structures whtch may repeat several ttmes, 
structures which may be omttted, and structures tn 
which the order of thetn sub-structures ts not 
restricted. 
For example, the structure tn whtch 
adjectives (ADJ) repeat arbitrary ttmes and a noun 
(N) follows them tn Engllsh ts expressed as 
follows. 
ADJ ... ADJ N 
---> 
matching_condition: 
• (ADJS N): 
AOJS: anyC~(ADJ)): 
The structure 11ke a combination of a verb (V) and 
an adverbial parttcle (ADVPART) tn thts sequence 
wtth or without a pronoun (PRON) tn between tn 
Engltsh tswrttten as follows. 
V (PRON) ADVPART 
---> 
matching_condition: 
• (V PRON ADVPART): 
PRON: optional: 
Atyptcal Japanese sententtal structure tn whtch 
three adverbial phrases (ADVP). each composed of a 
noun phrase (NP) and a case particle (GA, WO. or 
NI) proceed an verb (V) tn no particular order ts 
expressed as follows. 
matching_condition; 
~(A1 A2 A3 Y); 
A1. A3: disorder; 
ADVP1 ADVP2 ADVP3 V ---> Al: ~((ADVP1NP1GA)): 
A A A A2:zCCADVP2 NP2 WO)): 
NPl GA NP2 we NPa NZ A3: zCCAOVPa Ne3 .X)): 
The matchtng condition part allows a 
grammar wrtter to spectfy conditions about property 
names and property values for the nodes of the 
annotated tree. A grammar wrtter can compare not 
only a property value of a node wttha constant 
value, but also values between two nodes tn a tree. 
339 
For example, the number agreement between a subject 
noun and a verb Is written as follows. 
matching_condition: 
~(NP UP): 
NP.NUNBER " VP.NUNBE~; 
3.2. Substructure Operation part 
The substructure operation part spec'tftes 
operations for the annotated tree which has matched 
wtth the matchtng condition part. The substructure 
operation part allows a grammar writer to set a 
property value to a node. and to assign a tree or a 
property value to a variable, whtch is declared tn 
the variable tntt. part. It also allows htm to 
call a subgnammar, a subgnammar network, a 
dictlonary rule. a bullt-ln functlon, and a LISP 
function. The subgrammar, the subgramman network. 
the dicttonany rule, and the butlt-tn function w111 
be discussed tn sectton 4.. 5., and 6. In 
addition, a grammar wntter can write a conditional 
operation by using the IF-THEN-ELSE form. An 
operaLion to set 'A' to the lextcal untt of the 
determiner node (DET.LEX). tf the number of the NP 
node |S SINGULAR. Is wrttten as follows. 
substnuctune_operatton: 
tf NP.NUMBER - 'SINGULAR': 
then DET.LEX <- "A': 
else DET.LEX <- "NIL'; 
end_tf: 
Transformation of matn part tn a newntttng rule: 
A A /b,, I 
B C O ---> E /t,,, 
B C D 
Transformation of a whole annotated tree: 
A A 
ABCD ---> A E /t,, I /b,, 
BCD E BCD /t,,, 
BCD 
Figure 2 An example of an application of the main 
part 
The matching tnstnuctton pant specifies the 
travense path of the annotated tree. There are 
four types of the traverse pathes, whtch are the 
combinations of <left-to-right or night-to-left> 
and <bottom-to-top on top-to-bottom>. When a 
grammar writer specifies left-to-right and 
bottom-to-top mode, the annotated tree w111 be 
traversed as follows. 
5 
3 / 
3.3. Creation part 
The structure and the property values of 
the transformed annotated tree ts written tn the 
creation part. The transformed tree ts described 
by node names such as NP and VP, whtch are used in 
the matchtng condition part on the substructure 
operation part. A cneatton part to create the tree 
whose top node ts S and whtch has a NP sub-tree and 
a VP sub-tree ts wnttten as follows. 
creation: 
Z((S NP VP)): 
3.4. Matching Instruction part 
The maln part of a rewrltlng rule In GRADE 
(the matching condition part, the substructure 
operation part. and the creatlon part) can be 
applied not only to a whole tree, but also to 
sub-trees. Figure 2 shows an example of the 
application of a maln part. 
4. Control of the grammatical rule applications 
A grammar writing language must be able to 
express detailed phases of a translation process tn 
the expression expltctt\]y. GRADE allows a grammar 
writer to divide a whole grammar into several 
parts. Each part of the grammar ts called a 
subgnammar. A subgrammar may correspond to a 
grammatical unit such as the parstng of a stmple 
noun phrase and the partng of a compound sentence. 
A whole grammar ts then described by a network of 
subgrammars. Thts network ts called a subgnammar 
network. A subgrammar network allows a grammar 
writer to control the process of a translation tn 
detatl. When • subgrammar network tn the analysts 
phase consists of a subgrammar for a noun-phrase 
(SG1) and a subgrammar for a verb-phrase (SG2) tn 
this sequence, the executor of GRADE first appltes 
SG1 to an input sentence, then appltes SG2 to the 
result of an application of SG1. 
4.1. Subgrammar 
A subgrammar conststs of a set of rewriting 
rules. Rewriting rules tn a subgrammar have a 
prtontty ondertng tn their application. The n-th 
340 
rewriting rule tn a subgrammar tstrted before the 
(n+l)-th rule. 
A grammar wrtter can spectfy four types of 
application sequence of rewriting rules tn a 
subgrammar. Let us assume the situation that a set 
or rewriting rules tn the subgrammar ts composed of 
RR1. RR2 ..... and RRn. that RR1 ..... and RR|-I 
cannot be applied to an tnput tree. and that RRt 
can be applted to tt. When a grammar wrtter 
specifies the ftrst type. whtch ts called ORDER(I). 
the effect of the subgrammar execution ts the 
application of RRt to the tnput tree. When a 
grammar wrtter specifies the second type. which |s 
called ORDER(2). the executor of GRADE trtes to 
apply RRt+I ..... RRn to the result of the 
application of RRt. So. ORDER(2) means that 
rewriting rui~s tn the subgrammsr are sequentially 
applted to an tnput tree. 
The thtrd and fourth type. whtch are called 
ORDER(3) and ORDER(4). are the Iteration type of 
ORDER(l) end ORDER(2) respectively. So, the 
executor of GRADE trtes to apply rewriting rules 
untt1 no rewriting rule Is applicable to the 
annotated tree. 
SEARCH-CANDIDATE-OF-HOUNS.sg: 
sg_mode: order(Z): 
rr_tn_sg: 
CANDIDATE-OF-NOUNS-t: 
UP-NP-TO-PNP: 
CANDIDATE-OF-NOUNS-Z; 
end_sg.SEARCH-CANDIDATE-OF-NOUNS: 
Ftgure 3 An example of a subgrammar 
Ftgure 3 shows an example of a subgrammsr. 
When thts subgrammar is applted to an annotated 
tree. the executor of GRADE ftrst trtes to apply 
the rewriting rule CANDIDATE-OF-NOUNS-1 to the 
tnput tree. If the appl|catton of thts rule 
succeeds, the tnput tree ts transformed to the 
result of the application of the rewriting rule 
CANDIDATE-OF-NOUNS-1. Otherwise. the tnput tree ts 
not modified. In etther case. the executor of 
GRADE next tr|es to apply the rewrtt|ng rule 
UP-NP-TO-PNP to the tnput tree. The executor 
continues such a process untt1 the application of 
the last rewriting rule CANDIDATE-OF-NOUNS-2 ts 
finished. 
4.2. Subgramar Network 
A subgrammar network descr|bes the 
application sequence of subgrauars. The 
specification of a subgrammar network conststs of 
the following ftve parts. (1) Directory Entry 
part. whtch ts as the same as the one tn a 
rewriting rule. (2) Property Definition part. 
whtch Is the same as the one tn a rewriting rule. 
This part ts used as the default declaration tn 
rewriting rules. (3) Vsrtable \]ntt. part. which ts 
the same as the one tn a rewriting rule. The 
variables are used to control the transition of the 
subgrammar network. The variables are referred to 
and asstgned tn the substructure operation part of 
the rewriting rule. The variables are also 
referred tne 11nk specification part. whtch wtll 
be described later. (4) Entry part. whtch 
specifies a start node of the network. (5) Network 
part. whtch specifies a network of subgrammars, 
The network part spec|f\]es the network 
structure of subgrammars, and conststs of node 
specifications and 11nk spectftcat|ons. The node 
specification has a label and a subgrammer or s 
subgnammar network name. whlch ts called when the 
node gets the control of the processing. The 11nk 
specification specifies the transit|on among nodes 
tn a subgramman network. The 11nk specification 
checks the value of a verteble whtch |s set tn • 
rewriting rule. and dectdes the label of a node 
whtch wtll be processed next. 
PRE.sgn; 
directory_entry: 
owner(J.NAKAHURA): verston(VO2L05): 
last_update(83/12/25): 
var_tntt; 
OPRE-FLAG tntt(T): 
entry: 
START: 
network: 
START: PRE-STEP-|osg; 
LOOP : PRE-STEP-2.sg; 
A: PRE-STEP-3.sg: 
B: PRE-END-CHECK.sg: 
|f OPRE-FLAG: then goto LOOP: 
else goto LAST: 
LAST: PRE-STEP-4.s9: 
extt: 
end_sgn.PRE; 
Ftgure 4 An example of a subgrammar network. 
Ftgure 4 shows an example of a subgrammar 
network. When the executor of GRADE appltes thts 
subgranunar network to an tnput tree. the executor 
checks the var-tntt part. then puts a new vartable 
OPRE-FLAG on a stack, and sets T to OPRE-FLAG as an 
tntttal value. After that. the executor checks the 
entry part and find the label of the start node 
START tn the network. Then the executor searches 
the node START and applles the subgrammar 
PRE-STEP-1 to the tnput tree. After the 
application, the executor appltes the subgrammer 
PRE-STEP-2 (node name: LOOP) and PRE-STEP-3 (node 
name: A) to the annotated tree tn thts sequence. 
Next. the executor applles the subgrammar 
PRE-END-CHECK (node name: B) to the tree. 
341 
Rewriting rules in PRE-END-CHECK examine the tree 
and set T or NIL to the variable ePRE-FLAG. The 
executor checks the link spectf|catJon part, which 
is started by IF. and examines the value of the 
variable @PRE-FLAG. The node in the network which 
will be activated next is the node LOOP if 
@PRE-FLAG is not NZL, otherwlse, the node LAST. 
Thus, while @FRE-FLAG ts not NIL, the executor 
repeats the applications of three subgrammars, 
PRE-STEP-2. PRE-STEP-3. and PRE-END-CHECK. to the 
annotated tree. When @PRE-FLAG becomes NIL. the 
subgrammar PRE-STEP-4 tn the node LAST ts applted 
to the tree. and the application of thls subgrammar 
network PRE Is terminated. 
5. Handling the grannaatlcal rule tn the word 
dictionaries 
GRADE allows a grammar wrtter to write word 
specific grammatical rules as a subgramman In an 
entry of word dictionaries of a machine translation 
system. A subgramman written in a dictionary entry 
is called a dictionary rule. The dictionary rule 
is specific to a particular word In the dictionary. 
The dictionary rule is retrieved wttha 
entry word and a rule identifier as the key. and is 
applied to the annotated tree which is specified by 
a grammar writer, when CALL-DIC operation In the 
substructure operation part Is executed. Figure 5 
shows an example of a rewriting rule which calls a 
dictionary rule. In thts case. a dictionary rule 
which ts written in an entry of a word as indicated 
by V.LEX (the value of the lextcal untt of verb). 
and whose name ts ANALYSIS. ts epplted to the 
sequence of NP1. V. NP2. and PP (noun phrase 1. 
verb phrase, noun phrase 2. and prepositional 
phrase). Then the result of the application of the 
dictionary rule Is assigned to the vartable aS. 
CASE-FRANE.rr: 
var_tntt: aS; 
matching_condition: 
Z(NPZ v Me2 PP): 
substructure_operation: 
@S <- ca11-dtc(V.LEX 
ANALYSIS Z(NP1V NP2 PP)): 
creation: 
~(es): 
end_Pr.CASE-FRAME: 
Ftgure S An example of a rewriting rule which calls 
a dictionary rule 
6. Treatment of Ambiguities 
A grammar wrtttng language must be able to 
treat the syntactic end semantic ambiguities in 
natural languages. GRADE allows a grammar writer 
to collect all the result of possible tree-to-tree 
transformations by a subgrammar. However, It must 
avoid a combinatorial explosion, when tt encounters 
the ambiguities. 
For instance, let us assume that a grammar 
writer writes a subgramman which contains two 
rewriting rules to analyze the case frame of • 
verb, that a rewriting rules ts the rule to 
construct VP (verb phrase) from V and UP (a verb 
and a noun phrase), and that the other ts the rule 
to construct VP (verb phrase) from V. NP and PP (a 
verb. a noun phrase, and a prepositional phrase). 
When he specifies NONDETERMINISTIC_PARALLELED mode 
to the subgremmar, the executor of GRADE 8ppltes 
both rewriting rules to an Input tree, constructs 
two transformed trees, and merges them tnto 8 new 
tree whose top node has 8 spectal property PARA. 
The top node of this structure is called a pare 
special node. whose sub-trees are the transformed 
trees by the rewriting rules. Figure 6 shows an 
example of thts mode and apara node. 
--'7 
V NP PP SG 
PARA 
VP PP VP A A",, 
V NP V NP PP 
Figure 6 An example of a pars speclal node 
A grammar writer can select the most 
appropriate one from the sub-trees under a pare 
special node. A grammar writer ts able to use 
built-in functlons. MAP-SG. MAP-SGN. SORT. CUT. and 
INJECTION in the substructure operation part to 
choose the most appnoprlate one. Figure 7 shows an 
example to use these bullt-Jn functions. 
substructure_operation: 
eX <= ca11-dtc(V.LEX CASE-FRAME Z(N NP PP)): 
eX <- ca11-butlt(map-sg ~(gX) tree 
EVALUATE-CASE-FRAME): 
@X <- call-built(sort Z(@X) tree SCORE): 
@X <- cell-built(cut \[(eX) tree 1): 
9X <- call-built(Injection ~(eX) tree 1): 
Figure 7 An example of bullt-ln functions 
In this substructure operation part. the 
executor of GRADE appltes the dictionary rule 
wrttten tn a word which ts the value of V.LEX 
(lexlcal untt of verb) to the tree. and sets the 
result to the vartable eX. When the 
nondetermtnisttc-paralleled mode ts used tn the 
dictionary rule. the value of eX ts the tree whose 
root node tsa pare spectel node. After that, the 
executor calls butlt-tn functton MAP-SG to apply 
342 
the subgrammar EVALUATE-CASE-FRAME to each sub-tree 
of the value of OK. and sets the result to eX 
again. The subgrammar EVALUATE-CASE-FRAME computes 
the evaluation score end sets the score to the 
value of the property SCORE tn the root node of the 
sub-trees. Next, the executor calls butlt-tn 
functton SORT. CUT. and INJECTION to get the 
sub-tree whose score Is the highest one among the 
sub-trees under the pare spectal node. This tree 
ts then set to 9X as the most appropriate result of 
the dictionary ru\]e. 
The para spectal node ts treated as the 
same as the other nodes tn the current 
Implementation of GRADE. A grammar wrtter can use 
the para node as he want, and can select a sub-tree 
under a pare node at the later grammatical rule 
application. 
7. System configuration end the environment 
The system configuration of GRADE ts Shown 
tn Figure 8. Grammatical rules written tn GRADE 
are first translated tnto tnternal forms, which are 
expressed by s-expressions tn LISP. This 
translation ts performed by GRADE translator. The 
Internal forms of grammatical rules are applted to 
an tnput tree. which ts an output of the 
morphological analysts program. Thts rule 
application Is performed by GRADE executor. The 
result of rule applications |s sent to the 
morphological generat4on program. 
Dictionary Grammar f 
J GRADE 
translator 
1/ \ Dictionary Grammar 
(Internal form) rule ~ ~ r~ 
tnput_~ GRADE ~output 
sententtal tree|executor J sententtal tree 
Ftgure 8 The system configuration of GRADE 
GRADE system ts mrttten tn UTILISP 
(University of Tokyo Interactive LISP) and 
Implemented on FACON M382 wtth the additional 
functton of handllng Chatnese characters. The 
system ts also usable on Ltsp Machtne Symbollcs 
3600. The program stze of GRADE system ts about 
10.000 ltnes. 
the form of tree-to-tree transformation rtth 
annotation to each node. (2) Rewriting rule has • 
powerful wrtttng facility. (3) Grammar can be 
divided Into several parts and can be 11nked 
together as a subgrammar network. (4) Subgrammar 
can be written tn the dictionary entrtes to express 
word spectftc linguiStiC phenomena. (5) Spectel 
node ts provtded tn a tree for embedding 
ambiguities. 
GRADE has been used for more than a year as 
the software of the nattonal machtne translation 
project from Japanese Into English. The 
effectiveness of GRADE has been demonstrated tn 
thts project. The linguistic parts of the project 
such as the morphological analysts/generation 
programs, the grammars for the analysts of 
Japanese. the transfer from Japanese Into Engltsh 
and the generation of Engllsh. are discussed tn 
other papers (Sakamoto 84) (TsuJt1 84) (Raged 84). 
Thts study: "Research on the machtne 
translation system (Japanese-English) of scientific 
and technological documents" Is betng performed 
through Spectal Coordination Funds for Promoting 
Science & Technology of the Science and Technology 
Agency of the Japanese Government. 
ACKNOWLEDGEMENTS 
Ve would 11ke to acknowlege the 
contribution of N. Kogt. F. Ntshtno. Y. Sakane. M. 
Kobayasht. S. Sate. and Y. Senda. who programmed 
much of the system. We mould also 11ke to thank 
the other member of Me-project for their useful 
comments. 
REFERENCES 
Bottet. Ch., et el. Implementation and 
Conversational Environment of ARIANE 78.4. Proc. 
COLING82. 1982. 
RageD, M., et el, Dealtng wtth Incompleteness of 
Linguistic Kno~ledego on Language Translation. 
Proc. COLING84o ;964. 
Sakamoto, Y.. et al, Lextcon Features for Japanese 
Syntactic Analysts In Mu-ProJect-JE, Proc. 
COLING84, 1984. 
TsuJtt, J., et el, Analysts Grammar or Japanese tn 
Hu-ProJect, Proc. COLING84, ;984. 
8. Conclusion 
The grammar wrtttng system GRADE ts 
discussed 4n thts paper. GRADE has the follow4ng 
featureS. (I) Rewriting rule ts an expression tn 
343 
