File Information

File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/79/j79-1007_metho.xml

Size: 28,634 bytes

Last Modified: 2025-10-06 14:11:11

<?xml version="1.0" standalone="yes"?>
<Paper uid="J79-1007">
  <Title>OF CONTEXT FREE LANGUAGES</Title>
  <Section position="4" start_page="0" end_page="0" type="metho">
    <SectionTitle>
0. Introduction.
</SectionTitle>
    <Paragraph position="0"> This paper presents a formal model of the translation of context free languages. The model is admittedly inadequate to provide for all the intricacies and complexities of the problem of language translation.</Paragraph>
    <Paragraph position="1"> Nevertheless, I hope that practicing apfllied and computational. linguists will find it intuitively satisfying in its simplicity. At the same time, the model should give us a basis for proving some theoretical results about the nature of language translation.</Paragraph>
    <Paragraph position="2"> Translation is necessarily concerned with both syntax and semantics, so we begin with a formal definition of semantics for context free grammars. In Section 2, a simple algorithm for translating from one context free language to another is given. The algorithm is &amp;quot;controlled&amp;quot; by a finite set of rules which specify how to replace phrases in the source language with semantically equivalent phrases in the target language. The translation algorithm, it turns out, is sttaightforward. The key proble~ is in &amp;quot;finding&amp;quot; the finite set of rules which carrectly specify the trans'lation . The main part of this paper, Section 3, is concerned with that problem.</Paragraph>
    <Paragraph position="3"> Throughout t&amp; paper, we assume that grammars and semantics are given.</Paragraph>
    <Paragraph position="4"> There is nothing in this paper that tells you. how to go about writing the &amp;quot;right&amp;quot; grammar and semantics for a given cf 1.</Paragraph>
    <Paragraph position="5"> t An earlier version of this paper was presented to the Eleventh Annual Meeting of the Association for Computational Linguistics at Ann Arbor, Michigan, August, 1973.</Paragraph>
    <Paragraph position="6"> This research was supported in part by NSF grant GN-534.1.</Paragraph>
    <Paragraph position="7"> Much of the presentation is formal.</Paragraph>
    <Paragraph position="8"> Some readers may find it helpful to read only through Example 1, and then to peruse Section 4 (Sample Translations) to pick up some intuition, before proceeding with the rest of the paper.</Paragraph>
  </Section>
  <Section position="5" start_page="0" end_page="0" type="metho">
    <SectionTitle>
1. Phrase Structure Syntax and Semantics.
</SectionTitle>
    <Paragraph position="0"> I assume the reader is familiar with the notions of &amp;quot;derivation&amp;quot; and  syntax tree1' (alias &amp;quot;derivation tree&amp;quot;, alias &amp;quot;phrase marker&amp;quot;) for cf g ' s . Several good texts on these subjects are listed in the bibliography. The definition of semantics which I am about to give is based oa the following two simple notions: 1) it is phrases which have mewg (paragraphs, sentences, clauses, and morphs are special cases of' phrases) , and 2) the meaning of a phrase is a function of its syntactic structure and of the meanings of its constitumts. Keeping in mind that a function is nothing but aq assignment of elements in its csdemain to elements in its domain, this definition will provide for idiomatic and emotive meaning, as well as denotative or referential meaning, provided such meanings are specified in the universe of di,scourse. I wish to add before giving the definstion that, although I have never seen it in this form before, I do not believe this definition of semantics is original with me. I believe it incorporates the notions of semantics in Benson (1970), Knuth (1968, 1971), some statements attributed to Thompson (cf Benson, 1970), and in* Tarski (1936). Now the definition: Definition 1.</Paragraph>
    <Paragraph position="1"> Let. G = (V, z, P, S) be a context free grammar where: V is the finite nonempty vocabulary, C c - V is the terminal alphabet, S EU (V - C) is the axiom, and P is the finite nonempty set of grammar rules, having the form + A -t B, for A EU (V - C) and B 6 V .</Paragraph>
    <Paragraph position="2"> A phrase-structure semantics for G is a 7btuple d = (u, M, u, X, A, F, R), where: U is a set, the universe of discourse,</Paragraph>
    <Paragraph position="4"> A is a finite set of nbes of partial recursive functions, F is a finite set of definitions for the partial recursive functions named in A, R is a finite set of semantic rules, with the property that to each grammar rule A -t B . . .B there is assigned one</Paragraph>
  </Section>
  <Section position="6" start_page="0" end_page="213" type="metho">
    <SectionTitle>
1 n
</SectionTitle>
    <Paragraph position="0"> semantic rule, having the form r A + B1. . .B (xl,*..,X ~l = P, n + where p EU (M U X U A) , and r A + B1. .B (x~,~~~,x n 1 = P n specifies a partial recursive function: We also require that X fI (M u A) = 0. There is an example on the next page. Example 1.</Paragraph>
    <Paragraph position="1"> Coxfsider a cfg and phrase-structure semantics for well-formed addition expressions over the alphabet Z = {I, +).</Paragraph>
    <Paragraph position="3"> N is the set of non-aegatiue integers,  and f and I are recursive functions defined in F below,</Paragraph>
    <Paragraph position="5"> function on v(S) xu(+) xv(S) -+ v(S), since if x, and x, are in p(S) = N and if</Paragraph>
    <Paragraph position="7"> primitive recursive, Before explaining the example, let's first consider what the semantics is used for. We will need the following notation for trees:</Paragraph>
    <Paragraph position="9"> For readability, we write the members of M without unnecessary braces -i.e., &amp;quot;1&amp;quot; instead of &amp;quot;{l)&amp;quot;.</Paragraph>
    <Paragraph position="10"> The above inductive definition gives a &amp;quot;standard&amp;quot; parenthebized notation for trees. Let us denote the root of a tree t, rt(t) and the frontier, fr(t). We shall also need the following non-standard notation:</Paragraph>
    <Paragraph position="12"> . . . , t are trees and if Informally, to[ tl. . . t ] is the tree formed by &amp;quot;graf tiagl' each ti at the +I.</Paragraph>
    <Paragraph position="13"> n i&amp;quot;' node of the frontier of to, which can be done since this node has the same label as the root of ti. For example, the tree -A is denoted a&lt;b&lt;de&gt;c&gt;, and it has all the following non-standard representations: a&lt;bc&gt; [b&lt;de&gt;c], a&lt;b&lt;de&gt; c&gt; [dec] , and a[a&lt;bc&gt;] [b&lt;de&gt;cL As the reader can see, the &amp;quot;box notation&amp;quot; is useful for isolating any rooted subtree. In particular, note that S&lt;S+S&gt; [s&lt;I&gt;+s&lt;I&gt;] is the syntax tree S&lt;S&lt;I&gt;+S&lt;I&gt;&gt; of the grammar of Example 1, with its dominating suhtree S&lt;S+S&gt; isolated. Now back to the semantics. The semantic rules R are used to define a function 4 on the trees of the grammar which assigns to each syntax tree t a semantic function 4(t). Then 4 and the meaning function p are used to define a meaning function p on the sentences of G. First, we define 4, then u.</Paragraph>
    <Paragraph position="14"> To define $, we must first define the codomain of @, @.</Paragraph>
    <Paragraph position="15"> Informally,</Paragraph>
    <Paragraph position="17"> = fr(t). To specify a n n semantic function we will use the notathn f(x</Paragraph>
    <Paragraph position="19"> the name of the function, (xl,. . . ,x ) is the vector of arguments, D is the n domain, and C is the codomain.</Paragraph>
    <Paragraph position="20"> $ is defined by the following inductive definition:</Paragraph>
    <Paragraph position="22"> Intuitiv&amp;ly, the semantic function assigned to each tree t is the composition of the semantic functions assigned to the subtrees of which t is composed. We leave it to the reader to verify that $ is well-defined.</Paragraph>
    <Paragraph position="23"> The meaning function p on sentences is a special case of the meaning function v on a larger domain -- the set of phrase forms of the grammar.</Paragraph>
    <Paragraph position="24"> A phrase form is similar to a sentential form, except that it need not be derived from the axiom. Formally, the set of phrase. forms of G is the set</Paragraph>
    <Paragraph position="26"> The function $ is used to define the meaning function as follows. The u function p:P(G) +2 is defined by the following rule: Let w = w ..OW be</Paragraph>
  </Section>
  <Section position="7" start_page="213" end_page="213" type="metho">
    <SectionTitle>
1 n
</SectionTitle>
    <Paragraph position="0"> a phrase form in P (G) and let w have syntax trees tl, . . . , t . Then the m set of tueanings of w is the set L(G) , the language of G, is a subset of P(G) , so the meaning function on. u sentences, p:L(G) + 2 , is just the restriction of p to L(G) . A Since the three functions v, y, and II have disjoint domains, they can never be confused, so we shall write v for all three. ).I is the meaning function, which assigns to each sentence, phrase form, and symbol, one or more meanings according to the semantics d . Thus, we are assigning meaning to a sentence by assigning to it the meanbgs which are computed by the semantic functions specified by its phrase structures, taking as argu~ ments the meanings of the constituents of the sentence. The most elementary constituents of a sentence are the members of C which constitute it. One .may think of these as the lexical items of the language. Their meanings, wMch are the arguments of the semantic function, are among the morphemes of the language -- those morphemes which cannot be furthe-r separated into morphemes (this is the set of &amp;quot;atomic morphemes&amp;quot;, M) . Thus, the meaning of a sentence is a function of its morphemes. lhich function to use tq determined by its syntactic structure. A sentence can be semantically ambiguous if it has more than one syntax tree or if at least one of its constituents is semantically ambiguous.</Paragraph>
    <Paragraph position="1"> We retyrn to Example 1 on the next page.</Paragraph>
    <Paragraph position="2"> Now consider Example 1.</Paragraph>
    <Paragraph position="3"> Let w be the sentence &amp;quot;L + I' + I&amp;quot;. It has the syntax tree One meaning oE w is 4 (t) (P (I), P (+I, P (I), IJ (+.I, P (I)). For notational purposes, let tl, tq, 3, and t4 be the subtrees of t circled in the picture. Now compute this member of P (w) : Note that &amp;quot;I + I + I&amp;quot; also has the syntax tree but the sentenge is not semantically ambiguous since 2. Translation9 As Tree Mappings.</Paragraph>
    <Paragraph position="4"> Consider now any two cfg's and their associated semantics, 9, dl and G2, J2. A translation of L(G1) tjo L(G ) is a function</Paragraph>
    <Paragraph position="6"> defined as follew: The codomain of a translatfon must be the power set of the target language, since every sentence in L(G ) may have many semantically equivalent sen- null tences in L(G2). In this paper wel focus on banslations which are specified by a finite set of rules. For these translations, there is a simple algorithm for computing the trans lati011 of any sentence. This section presents th2 bethod for giving the finite specification of T and the algorithm for computing the translation.</Paragraph>
    <Paragraph position="7"> In fact, instead of specifying a translation on the languages, we specify a translation on the trees of the syntaxes.</Paragraph>
    <Paragraph position="8"> To make precise what is meant by &amp;quot;translqtions which are specified by a finite set of rules&amp;quot; we Sntroduce the concept of a generating set for trees. Let T and T2 be two sets bf trees with labels from some alphabet  tO[tl.. . t ] E gen(T) if it is defined, n for all positive integer$. n, and for all trees to, , ..., t EU gen(T).</Paragraph>
    <Paragraph position="9"> n T is a generating set for gen(T). We leave it to the reader to verify that every tree in gen(T) can be written in the f orin to [ tl. . . t ] , where</Paragraph>
    <Paragraph position="11"> The set of production.trees of a cfg is a generating set for the set of all the syntax trees of the grammar. Let G = (V, C, P, S), let P - (i) , B contain k rules, and let P = { A</Paragraph>
    <Paragraph position="13"> 1iE1,2, m.a,kl.</Paragraph>
    <Paragraph position="14"> Then the set of production trees of G is the .set The set T(G) of all syntax trees of G is the set gen(T,). As a more concrete example, consider the cfg G given by the following Tp is the set { S&lt;OS&gt;, S&lt;B2, B&lt;O&gt;, Bcl&gt; 1, or written pictorially: T(G) = gen(Tp) contains all trees of the following forms:: s (COS)&amp;quot; (&gt;p n&gt;0, The tree t = S&lt;OS&lt;OS&lt;B&gt;&gt;&gt; is 111 T(G) = gm(Tp) since t = S~OS~[OS~OS~B~~} and S&lt;OS&gt; EU Tp; 0 EU gen(Tp), and ScOS&lt;B&gt;&gt; EU ges(Tp). Note that t can also be written as t = s&lt;OS&lt;OS&gt;&gt; [OOS&lt;B&gt;], and again, S&lt;OScOS&gt;&gt; EU gen mp),</Paragraph>
    <Paragraph position="16"> Then we define the funktion r: T(G1) + 2 by the following inductive definition:</Paragraph>
    <Paragraph position="18"> any member of Note that the codomain of T is the power set of T(G2) because there may be trees in T(G ) whose non-trivial factorings into t [ t</Paragraph>
    <Paragraph position="20"> For these trees, ~(t) = { +(t 0 [t 1 ...tm]) 1 tO[tl...t 1 is a repre~entatim m of t ). As with languages, we will call a translation only if it preT(G2) null serves semantics, that is, T: T(G1) + 2 is a transPation iff for every tree t 6 T(G~) and for every tree t' E T(G~), if fr(t) = wl...w and</Paragraph>
    <Paragraph position="22"> N is the set of non-negative integers.</Paragraph>
    <Paragraph position="23">  We will call r fihitely specified (specified by a finite set of rules) iff the generating set T is finite.</Paragraph>
    <Paragraph position="24"> Finally, r is used to define a trdnslation r: L(G1) -+ 2 L(%) as follows: Let w EU L(Gl) have syntax trees tl, .... \. Then</Paragraph>
    <Paragraph position="26"> It follows from the definitions that 7 is a translation if r is. To see thtis, let w = wl.. .w and w' = wi m . . .w' and let w' E T(w). Then there exist n sy&amp;tax trees t of w and t' of w' such that t' C df). Let = @(t)(ul(wl)9&amp;quot;.9u 1 (w m )) and E 2 = (tf)(2,..,2(w). Then from the definition of 11, c1</Paragraph>
    <Paragraph position="28"> 0, and soris a translation.</Paragraph>
    <Paragraph position="29"> The functions ; and i are the method for specifving the function r. The specif icati.cn is finite just in case the generating set T is finite. The inductive definition for T gives the algorithm for computing the tpanslation of any tree in T(G ), and the definition of y, together with this  algorithm and a general context free parser such as Floyd's or Early's algorithm, gives the algorithm for computing the translation of any sentence in L(G ). The next example illustrates.</Paragraph>
    <Paragraph position="30">  (In the following and in all subsequent examples, we shall give explicitly only the grammar rules, the right-hand side of the semantic rules, the universes of discourse, the meaning function, and those definitions of partial recursive functions that are necessary. The reader can easily determine the rest of the specifications for the grammars and semantics, if he wishes. For cfg's we shall follow the usual convention that all symbols which do not appear on the left-hand side of some grammar rule are terminal symbols, and that the axiom is the first symbol appearing in the first rule. ) Example 3.</Paragraph>
    <Paragraph position="31"> We present two cfg's and their semantics, and a finitely specified translation T on T(G ) + 2</Paragraph>
    <Paragraph position="33"> N is the set of integers and f-: N x b + N is ordinary subtracfion The translation is specified by:</Paragraph>
    <Paragraph position="35"> The sentence 1-2-3 is semantically ambiguous (its meanings are O and -4).</Paragraph>
    <Paragraph position="36"> and its two translations are given by:  translation froq T(G1) to T(G2) exists. Can we find it? That is, can we produce the flnite set ofr rules aefining the functions ? and ;? Xn this section we consider a procedure which accepts two arbitrary cfg's and their phrase structure semantics and tries to fi~d a description of such a translation.</Paragraph>
    <Paragraph position="37"> The procedure may not always work, in thata it may not halt or the Function T it describes may.be only partial.  translation of t. First, the procedure is presented; then we give the arguments that t is 3 (partial) translation.</Paragraph>
    <Paragraph position="38"> Intuitively, the procedure works as follows: We try to find a finite generatiog set T for T(G1) and a pair of functions i: VNq+V and N..</Paragraph>
    <Paragraph position="39"> A</Paragraph>
    <Paragraph position="41"> is meant by to and t; represent the same semantic function&amp;quot; is iust this:</Paragraph>
    <Paragraph position="43"> In general, to get semantic equivalence, one has to be careful how the syntactic variables on the frontier of t are associated by the string x  with the syntactic variables on the frontier of t;), since these represent possible trees with mceming, and hence the domains of the semantic fwctions for t and t'</Paragraph>
    <Paragraph position="45"> If such a generating set T and functions i and ; can be found, the job is finished, since it can then be shown that the function T defined by i and ; is a translation.</Paragraph>
    <Paragraph position="46"> The procedure begins with the set Tp of production trees of G</Paragraph>
    <Paragraph position="48"> is indeed a finite generating set for T(G1) a If the procedure can find a ?? translation&amp;quot; for each t in T it will be successful, and will halt and P, output T, , and ;. The procedure systematically picks successive trees t 0 in T and searches T(G ) for a semantically equivalent tree t;) whose fron-</Paragraph>
    <Paragraph position="50"> tier it can roatch up by some rule x.</Paragraph>
    <Paragraph position="51"> If it finds one, it outputs the @a definition ;(to) = (tb, x), deletes t from T and tries one of the remain-</Paragraph>
  </Section>
  <Section position="8" start_page="213" end_page="213" type="metho">
    <SectionTitle>
0 P
</SectionTitle>
    <Paragraph position="0"> ing trees. If it succeeds in exhausting T it is successful.</Paragraph>
    <Paragraph position="1"> P' Suppose, however, that for some to in Tp, the procedure can't find a &amp;quot;translation&amp;quot; in T(G2). Then if we assume that 7 does exist, it must be the case that t is part of a larger tree (or of each of a set of larger  trees) which can be &amp;quot;translated&amp;quot;. Furthermore, if we also assume that r is finitely specified, this set is finite. Thus, the procedure tries to construct a new set of trees,</Paragraph>
    <Paragraph position="3"> generating set for T(G ) - {to}. It cannot be the case that the frontier  generating set to work with and begins again. It turns out that finding T depends heavily an the sequence in which successive trees are chosen for translation attempts. Therefore, to guarantee that T will be found if it exists, the procedure tries all possible sequences af trees. The procedure has the general steuctuxe of a  tree search&amp;quot;, and is represented by the search tree pictured. below. Each node in the tree represents a subprocedure which is described below the tree.</Paragraph>
    <Paragraph position="4">  structure semantics J1 and J2,, execute the search tree below far a14 integerpairs (maxi,maxs)= (1, 11, (1, 21, (2, 11, (2, 2), ... . Iffor It any pair step 1 halts and outputs success&amp;quot;, then halt.</Paragraph>
    <Paragraph position="6"> Reduced in the sense that each nonterminal symbol is derivable from the axiom an'd derives teminal. strings. It is well-known tht every cfg rlfm be put into this form.</Paragraph>
    <Paragraph position="7"> step 1: Set i t Ci.</Paragraph>
    <Paragraph position="8">  of step 2 returns success&amp;quot;, then halt and output success&amp;quot;. If step 2 returns &amp;quot;fail&amp;quot;, increase j and continue. If step 2 returns &amp;quot;fail&amp;quot; for a . (ie, for all j), then halt and output &amp;quot;fail&amp;quot;.</Paragraph>
    <Paragraph position="10"> If i &gt; maki then return &amp;quot;failtt.</Paragraph>
    <Paragraph position="11"> Othewise execute step 3 for each t EU T</Paragraph>
    <Paragraph position="13"> step 3 returns success&amp;quot;, then return &amp;quot;success&amp;quot;. If step 3 returns &amp;quot;fail&amp;quot;, then pick the next t in Ti and execute step 3 againr If step - 3 returns &amp;quot;fail&amp;quot; for all t in Ti, then return  If step 2 returns fail&amp;quot; return &amp;quot;fail&amp;quot; to step 3. expand: rn Let Dam(;) denote the domain of the current version of the functioh ?, i.e., ~orn(?) = {t I ?it) has been defined bysome execution of search in the current path of the search tree). Let T$' denote the (finite) set (T. U ~om(i)). Define i 1 the set T to be the smallest set of trees which is a generating</Paragraph>
    <Paragraph position="15"/>
  </Section>
  <Section position="9" start_page="213" end_page="213" type="metho">
    <SectionTitle>
END OF PROCEDURE
</SectionTitle>
    <Paragraph position="0"> Now we want to explain how the PROCEDURI$ defines functions (possibly partial functions) on T(G1) -+ 2 T(G2) and on L(G6 ) + 2  L(G2' , and prove that the functions are translations. We shall also show that if the PR0CEDZl.G halts, the translation it total, except under certain easily identifiable conditions.</Paragraph>
    <Paragraph position="1"> Consider any path in the search tree. It looks like this: step 1  We need to identify two particular sets of trees associated with this path. Both are finite. The first is the domain of the function i, and the second is the set of trees &amp;quot;excluded&amp;quot; by the successive executions of expand. Note that each execution of the subroutine - search adds one item to the definition of the function, ?, and the entire definition of ; is given by the set of all these items defined by executions of search in the path. The domain of ?, then, is the set ~orn(;) = {k I ;(t) is defined by some execution of the subroutine search in the path}.</Paragraph>
    <Paragraph position="2"> Similarly, each execution of the subroutine expand, in its first step, defines a new set, Tts which daes not contain the tree t. This step has the effect of excluding the tree t from any further consideration in the translation process. The set of all such trees is the set</Paragraph>
    <Paragraph position="4"> subroutine exclude in the path}.</Paragraph>
    <Paragraph position="5"> Wow, the set om(;) U T ) is a finite generating set for the set  and therefore on L(G1) + 2 L(G*) . Lett P(Excl) denote the set of frontiers of the trees of Excl.</Paragraph>
    <Paragraph position="6"> Note that each member of P(Exc1) is a phrase form. Then when the PROCEDURE halts, since T is total on (T(G,) - Exc~) , it A follows that is total on (P (G~) - P (Excl) ) and on (L(G1) - P (Excl) ) .  -Thus, is total on L(G1) if PROCEDURE halts and if none of the trees excluded by exclude are complete syntax trees. If complete syntax trees are excluded, then their sentences are the only ones for which 7 is not defined.</Paragraph>
    <Paragraph position="7">  We have left only to show that T is a translation. The reader may recall that there may be several nontrivial factorings of trees into a form for which T is defined, and that this may lead to non-unique translations. Furthermore, the languages may be semantically ambiguous. These condi.tions make the proof that r is a translation less lucid, so we shall give here the proof for the case where r is defined for only one factoring of each tree and there is no ambiguity. It will be helpful in the proof to have the following notation: Let t EU T(G1) have fr(t) = wl. . .w and let m t' C T(G2) have fr(tl) = wi ... w'. Then by a(t) : $(tl) we mean n Now to the proof. Let ~(t) = t'. We wish to show that $(t) r $(tl). Since t EU gen om(;)), t can be written as t [t . . . t ] where to C om(;) 0 1 m and each of the trees t . . , , t C gen(~om(i)). Let ;(to) = (tb, xl. . .X ) . 1' m n Then fram the definition of T, ~(t) = t' [t'.. .t'], where for each 0 1 n For inductive hypothesis, assume that for each j = 1,. . . ,m, t (t. Then we have: J For r E 1, ..., m let y = $(t j(v (W r r 1 jrm1+l *lj r 1, and for i = 1, ..., n let y' = $(y!)(y (v'  = 0, the result above demonstrates that Thus, by the defiliigion of in search, = $(t')(p2(~i),...,~2(~A)), or +(t) E $(t').</Paragraph>
    <Paragraph position="8"> Thus r is a translatiox.</Paragraph>
    <Paragraph position="9"> Finally, as we showed in Section 2, since T is a translation (on the.  syntax trees), r is a translation (on the languages). In programming terminology a generator is a program whose input is a set of parameters and whose output is a specialized program (cf Brooks and I I Iverson (1969), p. 365). Then PROCEDURE constitutes a translator generator&amp;quot;: its input is two cfg's and their associated phrase structure semantics, and its output is a table of tree transformations which &amp;quot;drives&amp;quot; a s&amp;andard tree-mapping program. The tree mapping program is designed to be part of a translator system composed of a parser, the tree mapper, and a frontier stripper (see Figure 1) . Translation proceeds as follows: Let G and a1 be the cfg and semantics for the source language, L1, and G2 ad  The importance of the argument that the function defined By the PROCEDURE is a translation, is just that w and u are guaranteed to have the sgne meaning. if they are unambiguous, and if thev are ambiguous, w and u are guaranteed to have meanings in common -- i . e . , that u is, a bona f i'de  -translation of w, in the ordinary sense of the word The usefulness of such a method of trahslating is that the generator, which has to considet all issues of syntax and semantics, and therefore runs very slowly, need only run once. The translator which it produces should run very fast, since, other than parsing, it bhly has to transform trees according to the finite set of rules in the tree transformation table (the funct&amp;quot;ion ;). No seman&amp;c computing is required at transloto time.</Paragraph>
    <Paragraph position="10"> This saction presents some examples of translations on context free languages.</Paragraph>
    <Paragraph position="11"> The tree search procedure outlined in Section 3 is programmed in CPS and runs on the IBM ~/370/165 at Ohio State. All of these translations were &amp;quot;found&amp;quot; by the program.</Paragraph>
    <Paragraph position="12">  It is interesting to note that the PROCEDURE does not have to know how + * 1 to corppute the functions f , , f , and f in order to discover this translation. All that is needed is to assume that if a symbol appears in both semantics, it represents the same semantic entity in each, whatever that entity is. For example, consider the two trees in the translation involving &amp;quot;+&amp;quot;. Let t = S&lt;S%O&lt;+&gt;&gt;, and t' = E&lt;EO&lt;+&gt;T&lt;F&lt;(E)&gt;&gt;&gt;. All we need to know is that @(t) : (g(tl&gt;, and it turns out we can find + that out without computing f : that, (g(t) : +(tl).</Paragraph>
    <Paragraph position="13"> Consider now the translation of ABC+*. The following shows that  This translation is interesting because it shows the procedure has the ability to &amp;quot;iiiscover&amp;quot; that a word (*) in L(C1) has no translation. But ,it can findsa phrase form involving that word which can be translated to a phrase f om in L(G2).</Paragraph>
    <Paragraph position="14">  evaluation of the second semantic function, the procedure must be able to + compute f (1,l).</Paragraph>
  </Section>
  <Section position="10" start_page="213" end_page="213" type="metho">
    <SectionTitle>
TRANSLATION IV (1 ,+ to 2 ,+)
</SectionTitle>
    <Paragraph position="0"> Suppose the procedure were asked to translate from L(G ) to L(G ) in 2 1 the previous example - i.e., from the integers to the even integers. It would never halt, but it would &amp;quot;discover&amp;quot; that the phrase &amp;quot;1 + 1&amp;quot; is to be translated as the word &amp;quot;2&amp;quot;, &amp;quot;1 + 1 + 1 + I&amp;quot; as &amp;quot;2 + 2&amp;quot;, etc. It wotild define a translation which is total on the strings in L(G ) whose values  are even, and it would continue to look f0reve.r for possible translations for the odd-valued strings. We leave it as an exercise for the reader to give the functions ; and ; which define this partial translation.</Paragraph>
  </Section>
class="xml-element"></Paper>
Download Original XML