File Information

File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/91/p91-1032_metho.xml

Size: 32,649 bytes

Last Modified: 2025-10-06 14:12:47

<?xml version="1.0" standalone="yes"?>
<Paper uid="P91-1032">
  <Title>NP -+ Det Nom \[ PN Det -+ Art \] NP's Nom -+ N I Nom PP J Adj Nom</Title>
  <Section position="3" start_page="0" end_page="246" type="metho">
    <SectionTitle>
1 Motivation
</SectionTitle>
    <Paragraph position="0"> Grammars for spoken language systems are sub-ject to the conflicting requirements of language modeling for recognition and of language analysis for sentence interpretation. Current recognition algorithms can most directly use finite-state acceptor (FSA) language models. However, these models are inadequate for language interpretation, since they cannot express the relevant syntactic and semantic regularities. Augmented phrase structure grammar (APSG) formalisms, such as unification-based grammars (Shieber, 1985a), can express many of those regularities, but they are computationally less suitable for language modeling, because of the inherent cost of computing state transitions in APSG parsers.</Paragraph>
    <Paragraph position="1"> The above problems might be circumvented by using separate grammars for language modeling and language interpretation. Ideally, the recognition grammar should not reject sentences acceptable by the interpretation grammar and it should contain as much as reasonable of the constraints built into the interpretation grammar.</Paragraph>
    <Paragraph position="2"> However, if the two grammars are built independently, those goals are difficult to maintain. For this reason, we have developed a method for constructing automatically a finite-state approximation for an APSG. Since the approximation serves as language model for a speech-recognition front-end to the real parser, we require it to be sound in the sense that the it accepts all strings in the language defined by the APSG. Without qualification, the term &amp;quot;approximation&amp;quot; will always mean here &amp;quot;sound approximation.&amp;quot; If no further constraints were placed on the closeness of the approximation, the trivial algorithm that assigns to any APSG over alphabet E the regular language E* would do, but of course this language model is useless. One possible criterion for &amp;quot;goodness&amp;quot; of approximation arises from the observation that many interesting phrase-structure grammars have substantial parts that accept regular languages. That does not mean that the grammar rules are in the standard forms for defining regular languages (leftlinear or right-linear), because syntactic and semantic considerations often require that strings in a regular set be assigned structural descriptions not definable by left- or right-linear rules. A useful criterion is thus that if a grammar generates a regular language, the approximation algorithm yields an acceptor for that regular language. In other words, one would like the algorithm to be exact for APSGs yielding regular languages. 1 While we have not proved that in general our method satisfies the above exactness criterion, we show in Section 3.2 that the method is exact for left-linear and right-linear grammars, two important classes of context-free grammars generating regular languages. null 1 At first sight, this requirement may be seen as conflicting with the undecidability of determining whether a CFG generates a regular language (Harrison, 1978). However, note that the algorithm just produces an approximation, but cannot say whether the approximation is exact.</Paragraph>
  </Section>
  <Section position="4" start_page="246" end_page="247" type="metho">
    <SectionTitle>
2 The Algorithm
</SectionTitle>
    <Paragraph position="0"> Our approximation method applies to any context-free grammar (CFG), or any unification-based grammar (Shieber, 1985a) that can be fully expanded into a context-free grammar. 2 The resulting FSA accepts all the sentences accepted by the input grammar, and possibly some nonsentences as well.</Paragraph>
    <Paragraph position="1"> The current implementation accepts as input a form of unification grammar in which features can take only atomic values drawn from a specified finite set. Such grammars can only generate context-free languages, since an equivalent CFG can be obtained by instantiating features in rules in all possible ways.</Paragraph>
    <Paragraph position="2"> The heart of our approximation method is an algorithm to convert the LR(0) characteristic machine .Ad(G) (Aho and Ullman, 1977; Backhouse, 1979) of a CFG G into an FSA for a superset of the language L(G) defined by G. The characteristic machine for a CFG G is an FSA for the viable prefixes of G, which are just the possible stacks built by the standard shift-reduce recognizer for G when recognizing strings in L(G).</Paragraph>
    <Paragraph position="3"> This is not the place to review the characteristic machine construction in detail. However, to explain the approximation algorithm we will need to recall the main aspects of the construction. The states of .~4(G) are sets of dotted rules A ---* a . \[3 where A ---, a/~ is some rule of G..A4(G) is the determinization by the standard subset construction (Aho and Ullman, 1977) of the FSA defined as follows:  B --~ &amp;quot;7, where B is a nonterminal symbol and B -+ 7 a rule in G.</Paragraph>
    <Paragraph position="4"> 2Unification-based grammars not in this class would have to be weakened first, using techniques akin to those of Sato and Tamaki (1984), Shieber (1985b) and Haas (1989).  .A~(G) can be seen as the finite state control for a nondeterministic shift-reduce pushdown recognizer TO(G) for G. A state transition labeled by a terminal symbol z from state s to state s' licenses a shift move, pushing onto the stack of the recognizer the pair (s, z). Arrival at a state containing a completed dotted rule A --~ a. licenses a reduction move. This pops from the stack as many pairs as the symbols in a, checking that the symbols in the pairs match the corresponding elements of a, and then takes the transition out of the last state popped s labeled by A, pushing (s, A) onto the stack. (Full definitions of those concepts are given in Section 3.) The basic ingredient of our approximation algorithm is the flattening of a shift-reduce recognizer for a grammar G into an FSA by eliminating the stack and turning reduce moves into e-transitions. It will be seen below that flattening 7~(G) directly leads to poor approximations in many interesting cases. Instead, .bq(G) must first be unfolded into a larger machine whose states carry information about the possible stacks of g(G). The quality of the approximation is crucially influenced by how much stack information is encoded in the states of the unfolded machine: too little leads to coarse approximations, while too much leads to redundant automata needing very expensive optimization.</Paragraph>
    <Paragraph position="5"> The algorithm is best understood with a simple example. Consider the left-linear grammar G1 S---. Ab A---* Aa Je AJ(G1) is shown on Figure 1. Unfolding is not required for this simple example, so the approximating FSA is obtained from .Ad(G1) by the flattening method outlined above. The reducing states in AJ(G1), those containing completed dotted rules, are states 0, 3 and 4. For instance, the reduction at state 4 would lead to a transition on nonter- null minal A, to state 2, from the state that activated the rule being reduced. Thus the corresponding e-transition goes from state 4 to state 2. Adding all the transitions that arise in this way we obtain the FSA in Figure 2. From this point on, the arcs labeled with nonterminals can be deleted, and after simplification we obtain the deterministic finite automaton (DFA) in Figure 3, which is the minimal DFA for L(G1).</Paragraph>
    <Paragraph position="6"> If flattening were always applied to the LR(0) characteristic machine as in the example above, even simple grammars defining regular languages might be inexactly approximated by the algorithm. The reason for this is that in general the reduction at a given reducing state in the characteristic machine transfers to different states depending on context. In other words, the reducing state might be reached by different routes which use the result of the reduction in different ways. Consider for example the grammar G2</Paragraph>
    <Paragraph position="8"> which accepts just the two strings aca and bcb.</Paragraph>
    <Paragraph position="9"> Flattening J~4(G2) will produce an FSA that will also accept acb and bca, an undesirable outcome.</Paragraph>
    <Paragraph position="10"> The reason for this is that the e-transitions leaving the reducing state containing X ~ c. do not distinguish between the different ways of reaching that state, which are encoded in the stack of One way of solving the above problem is to unfold each state of the characteristic machine into a set of states corresponding to different stacks at that state, and flattening the corresponding recognizer rather than the original one. However, the set of possible stacks at a state is in general infinite. Therefore, it is necessary to do the unfolding not with respect to stacks, but with respect to a finite partition of the set of stacks possible at the state, induced by an appropriate equivalence relation. The relation we use currently makes two stacks equivalent if they can be made identical by collapsing loops, that is, removing portions of stack pushed between two arrivals at the same state in the finite-state control of the shift-reduce recognizer. The purpose of collapsing loops is to ~forget&amp;quot; stack segments that may be arbitrarily repeated, s Each equivalence class is uniquely defined by the shortest stack in the class, and the classes can be constructed without having to consider all the (infinitely) many possible stacks.</Paragraph>
  </Section>
  <Section position="5" start_page="247" end_page="251" type="metho">
    <SectionTitle>
3 Formal Properties
</SectionTitle>
    <Paragraph position="0"> In this section, we will show here that the approximation method described informally in the previous section is sound for arbitrary CFGs and is exact for left-linear and right-linear CFGs.</Paragraph>
    <Paragraph position="1"> In what follows, G is a fixed CFG with terminal vocabulary ~, nonterminal vocabulary N, and start symbol S; V = ~ U N.</Paragraph>
    <Section position="1" start_page="247" end_page="248" type="sub_section">
      <SectionTitle>
3.1 Soundness
</SectionTitle>
      <Paragraph position="0"> Let J~4 be the characteristic machine for G, with state set Q, start state so, set of final states F, and transition function ~ : S x V --* S. As usual, transition functions such as 6 are extended from input symbols to input strings by defining 6(s, e) -s and 6is , a/~) = 5(6(s, a),/~). The shift-reduce recognizer 7~ associated to A4 has the same states, start state and final states. Its configurations are triples Is, a, w) of a state, a stack and an input string. The stack is a sequence of pairs / s, X) of a state and a symbol. The transitions of the shift-reduce recognizer are given as follows:  Shift: is, a, zw) t- (s', a/s, z), w) if 6(s, z) = s' Reduce: is, err, w) ~- /5( s', A), cr/s', A/, w) if either (1) A --~ * is a completed dotted rule 3Since possible stacks can be shown to form a regular  language, loop collapsing has a direct connection to the pumping lemma for regular languages.</Paragraph>
      <Paragraph position="1">  in s, s&amp;quot; = s and r is empty, or (2) A X1...Xn. is a completed dotted rule in s,</Paragraph>
      <Paragraph position="3"> The initial configurations of ~ are (so, e, w} for some input string w, and the final configurations are ( s, (so, S), e) for some state s E F. A derivation of a string w is a sequence of configurations c0,...,cm such that c0 = (s0,e,w), c,~ = ( s, (so, S), e) for some final state s, and ei-1 l- ci for l&lt;i&lt;n.</Paragraph>
      <Paragraph position="4"> Let s be a state. We define the set Stacks(s) to contain every sequence (s0,X0)... (sk,Xk) such that si = 6(si-l,Xi-1),l &lt; i &lt; k and s = 6(st, Xk). In addition, Stacks(s0) contains the empty sequence e. By construction, it is clear that if ( s, a, w) is reachable from an initial configuration in ~, then o- E Stacks(s).</Paragraph>
      <Paragraph position="5"> A stack congruence on 7C/ is a family of equivalence relations _=o on Stacks(s) for each state s E 8 such that if o- =, a' and/f(s, X) = d then o-(s,X} =,, ,r(s,X). A stack congruence ---- partitions each set Stacks(s) into equivalence classes \[&lt;r\]deg of the stacks in Stacks(s) equivalent to o- under --_,.</Paragraph>
      <Paragraph position="6"> Each stack congruence - on ~ induces a corresponding unfolded recognizer 7~-. The states of the unfolded recognizer axe pairs i s, M,), notated more concisely as \[~\]deg, of a state and stack equivalence class at that state. The initial state is \[e\],o, and the final states are all \[o-\]deg with s E F and o- E Stacks(s). The transition function 6- of the unfolded recognizer is defined by t-(\[o-\]', x) = \[o-is, x)\] '(''x) That this is well-defined follows immediately from the definition of stack congruence.</Paragraph>
      <Paragraph position="7"> The definitions of dotted rules in states, configurations, shift and reduce transitions given above carry over immediately to unfolded recognizers.</Paragraph>
      <Paragraph position="8"> Also, the characteristic recognizer can also be seen as an unfolded recognizer for the trivial coarsest congruence.</Paragraph>
      <Paragraph position="9"> Unfolding a characteristic recognizer does not change the language accepted: Proposition 1 Let G be a CFG, 7~ its characteristic recognizer with transition function ~, and = a stack congruence on TC/. Then the unfolded recognizer ~=_ and 7~ are equivalent recognizers.</Paragraph>
      <Paragraph position="10"> Proof: We show first that any string w accepted by TC/--- is accepted by 7~. Let do,...,dm be a derivation of w in ~=. Each di has the form di = (\[P/\]&amp;quot;, o'i, ul), and can be mapped to an TC/ configuration di = (sl, 8i, ul), where PS = E and ((s, C), X) = 8i s, X). It is straightforward to verify that do,..., d,, is a derivation of w in ~.</Paragraph>
      <Paragraph position="11"> Conversely, let w E L(G), and c0,...,em be a derivation of w in 7~, with ci = isl,o-i, ui).</Paragraph>
      <Paragraph position="12"> We define el = (\[~ri\] s~, hi, ui), where ~ = e and</Paragraph>
      <Paragraph position="14"> of shift move, 6i-1 I- 6i in 7C/_--.</Paragraph>
      <Paragraph position="15"> Assume now that ei-1 I- ci is a reduce move in ~. Then ui = ui-1 and we have a state s in 7~, a symbol A E N, a stack o- and a sequence r of state-symbol pairs such that</Paragraph>
      <Paragraph position="17"> and either (a) A --* * is in si-t, s = si-1 and r = e, or (b) A ---, XI...Xn. is in si-1 , r = (ql, Xd... (q., X.) and s = ql-</Paragraph>
      <Paragraph position="19"> We now define a pair sequence ~ to play the same role in 7~- as r does in ~. In case (a) above, ~ = e. Otherwise, let rl = e and ri = ri-l(qi-l,Xi-1) for 2 &lt; i ( n, and define ~ by = (\[d q', xl)... @hi q', xi) * * * (\[~.p-, x.)</Paragraph>
      <Paragraph position="21"> which by construction of e immediately entails that ~_ 1 ~- Ci is a reduce move in ~=. fl For any unfolded state p, let Pop(p) be the set of states reachable from p by a reduce transition.</Paragraph>
      <Paragraph position="22"> More precisely, Pop(p) contains any state pl such that there is a completed dotted rule A --* (~. in  p and a state pll such that 6-(p I~, ~) - p and 6-(f*,A) -- f. Then the flattening ~r= of~- is a nondeterministic FSA with the same state set, start state and final states as ~- and nondeterministic transition function @= defined as follows: * If 6=(p,z) - pt for some z E E, then f E * If p~ E Pop(p) then f E ~b=(p, ~).</Paragraph>
      <Paragraph position="23">  Let co,..., cm be a derivation of string w in ~, and put ei -- (q~,~q, wl), and p~ = \[~\]~'. By construction, if ci_~ F ci is a shift move on z (wi-x -- zw~), then 6=(pi-l,Z) = Pi, and thus p~ ~ ~-(p~_~, z). Alternatively, assume the transition is a reduce move associated to the completed dotted rule A --* a.. We consider first the case a ~ ~. Put a -- X1... X~. By definition of reduce move, there is a sequence of states rl,..., r~ and a stack # such that o'i-x = C/(r~, X1)... (rn, Xn), qi -- #(r~,A), 5(r~,A) = qi, and 5(rj,X1) - ri+~ for 1 ~ j &lt; n. By definition of stack congruence, we will then have = where rx = * and rj = (r~,X,)...(r~-x,X~-,) for j &gt; 1. Furthermore, again by definition of stack congruence we have 6=(\[cr\] r*, A) = Pi. Therefore, Pi 6 Pop(pi_l) and thus pi e ~_--(pi-x,*). A similar but simpler argument allows us to reach the same conclusion for the case a = e. Finally, the definition of final state for g= and ~r__ makes Pm a final state. Therefore the sequence P0,.-.,Pm is an accepting path for w in ~r_. We have thus proved Proposition 2 For any CFG G and stack congruence =_ on the canonical LR(0) shift-reduce recognizer 7~(G) of G, L(G) C_ L(~r-(G)), where ~r-(G) is the flattening of ofT~(G)--.</Paragraph>
      <Paragraph position="24"> Finally, we should show that the stack collapsing equivalence described informally earlier is indeed a stack congruence. A stack r is a loop if '/&amp;quot; -&amp;quot; (81, X1)... (sk, Xk) and 6(sk, Xt) = sz. A stack ~ collapses to a stack ~' if cr = pry, cr ~ = pv and r is a loop. Two stacks are equivalent if they can be collapsed to the same stack. This equivalence relation is closed under suffixing, therefore it is a stack congruence.</Paragraph>
    </Section>
    <Section position="2" start_page="248" end_page="248" type="sub_section">
      <SectionTitle>
3.2 Exactness
</SectionTitle>
      <Paragraph position="0"> While it is difficult to decide what should be meant by a &amp;quot;good&amp;quot; approximation, we observed earlier that a desirable feature of an approximation algorithm would be that it be exact for a wide class of CFGs generating regular languages. We show in this section that our algorithm is exact both for left-linear and for right-linear context-free grammars, which as is well-known generate regular languages. null The proofs that follow rely on the following basic definitions and facts about the LR(0) construction. Each LR(0) state s is the closure of a set of a certain set of dotted rules, its core. The closure \[R\] of a set R of dotted rules is the smallest set of dotted rules containing R that contains B --~ &amp;quot;7 whenever it contains A --~ a * Bfl and B ---* 7 is in G. The core of the initial state so contains just the dotted rule ff ~ .S. For any other state s, there is a state 8 ~ and a symbol X such that 8 is the closure of the set core consisting of all dotted rules A ~ aX./~ where A --* a. X/~ belongs to s'.</Paragraph>
    </Section>
    <Section position="3" start_page="248" end_page="250" type="sub_section">
      <SectionTitle>
3.3 Left-Linear Grammars
</SectionTitle>
      <Paragraph position="0"> In this section, we assume that the CFG G is leftlinear, that is, each rule in G is of the form A B/~ or A --+/~, where A, B E N and/3 E ~*.</Paragraph>
      <Paragraph position="1"> Proposition 3 Let G be a left-linear CFG, and let gz be the FSA produced by the approximation algorithm from G. Then L(G) = L(3r).</Paragraph>
      <Paragraph position="2"> Proof: By Proposition 2, L(G) C. L(.~'). Thus we need only show L(~) C_ L(G).</Paragraph>
      <Paragraph position="3"> The proof hinges on the observation that each state s of At(G) can be identified with a string E V* such that every dotted rule in s is of the formA ~ ~.a for some A E N and c~ E V*.</Paragraph>
      <Paragraph position="4">  Clearly, this is true for so = \[S' --* .S\], with ~0 = e. The core k of any other state s will by construction contain only dotted rules of the form A ~ a.</Paragraph>
      <Paragraph position="5"> with a ~ e. Since G is left linear, /3 must be a terminal string, ensuring that s = \[h\]. Therefore, every dotted rule A --* a. f in s must result from dotted rule A ~ .aft in so by the sequence of transitions determined by a (since C/tq(G) is deterministic). This means that if A ~ a. f and A' --* a'. fl' are in s, it must be the case that a - a ~. In the remainder of this proof, let ~ = s whenever a = ~.</Paragraph>
      <Paragraph position="6"> To go from the characteristic machine .M(G) to the FSA ~', the algorithm first unfolds Ad(G) using the stack congruence relation, and then flattens the unfolded machine by replacing reduce moves with e-transitions. However, the above argument shows that the only stack possible at a state s is the one corresponding to the transitions given by $, and thus there is a single stack congruence state at each state. Therefore, .A4(G) will only be flattened, not unfolded. Hence the transition function C/ for the resulting flattened automaton ~&amp;quot; is defined as follows, where a E N~* U \]~*,a E ~, and A E N:</Paragraph>
      <Paragraph position="8"> The start state of ~&amp;quot; is ~. The only final state is S.</Paragraph>
      <Paragraph position="9"> We will establish the connection between Y~ derivations and G derivations. We claim that if there is a path from ~ to S labeled by w then either there is a rule A --* a such that w = xy and S :~ Ay =~ azy, or a = S and w = e. The claim is proved by induction on Iw\[.</Paragraph>
      <Paragraph position="10"> For the base case, suppose. \[w I = 0 and there is a path from &amp; to .~ labeled by w. Then w = e, and either a - S, or there is a path of e-transitions from ~ to S. In the latter case, S =~ A =~ e for some A E N and rule A --~ e, and thus the claim holds.</Paragraph>
      <Paragraph position="11"> Now, assume that the claim is true for all Iwl &lt; k, and suppose there is a path from &amp; to ,~ labeled w I, for some \[wl\[ = k. Then w I - aw for some terminal a and Iw\[ &lt; k, and there is a path from ~-~ to S labeled by w. By the induction hypothesis, S =~. Ay =~ aaz'y, where A --.* aaz ~ is a rule and zly - w (since aa yPS S). Letting z -- ax I, we have the desired result.</Paragraph>
      <Paragraph position="12"> If w E L(~), then there is a path from ~ to labeled by w. Thus, by claim just proved, S =~ Ay ::~ :cy, where A ~ * is a rule and w = ~y (since e # S). Therefore, S =~ w, so w ~ L(G), as desired.</Paragraph>
    </Section>
    <Section position="4" start_page="250" end_page="251" type="sub_section">
      <SectionTitle>
3.4 Right-Linear Grammars
</SectionTitle>
      <Paragraph position="0"> A CFG G is right linear if each rule in G is of the form A --~ fB or A --* /3, where A, B E N and Proposition 4 Let G be a right-linear CFG and 9 e be the unfolded, flattened automaton produced by the approximation algorithm on input G. Then L(G) = L(Yz).</Paragraph>
      <Paragraph position="1"> Proof: As before, we need only show L(~') C L(G).</Paragraph>
      <Paragraph position="2"> Let ~ be the shift-reduce recognizer for G. The key fact to notice is that, because G is right-linear, no shift transition may follow a reduce transition. Therefore, no terminal transition in 3 c may follow an e-transition, and after any e-transition, there is a sequence of G-transitions leading to the final state \[$' --* S.\]. Hence ~&amp;quot; has the following kinds of states: the start state, the final state, states with terminal transitions entering or leaving them (we call these reading states), states with e-transitions entering and leaving them (prefinal states), and states with terminal transitions entering them and e-transitions leaving them (cr0ssover states). Any accepting path through ~&amp;quot; will consist of a sequence of a start state, reading states, a crossover state, prefinal states, and a final state. The exception to this is a path accepting the empty string, which has a start state, possibly some prefinal states, and a final state.</Paragraph>
      <Paragraph position="3"> The above argument also shows that unfolding does not change the set of strings accepted by ~, because any reduction in 7~= (or e-transition in jc), is guaranteed to be part of a path of reductions (e-transitions) leading to a final state of 7~_- (~). Suppose now that w = w: ... wn is accepted by ~'. Then there is a path from the start state So through reading states sl,..., s,,-1, to crossover state sn, followed by e-transitions to the final state. We claim that if there there is a path from sl to sn labeled wi+l...wn, then there is a dot- null ted rule A ---* x * yB in si such B :~ z and yz = w~+1...wn, where A E N,B E NU~*,y,z ~ ~*, and one of the following holds: (a) z is a nonempty suffix of wt... wi, (b) z = e, A&amp;quot; =~ A, A' --* z'. A&amp;quot; is a dotted rule in sl, and z t is a nonempty suffix ofT1 ...wi, or (c) z=e, si=s0, andS=~A.</Paragraph>
      <Paragraph position="4">  We prove the claim by induction on n - i. For the base case, suppose there is an empty path from  Sn to s,. Because sn is the crossover state, there must be some dotted rule A ~ x. in sn. Letting</Paragraph>
      <Paragraph position="6"> rule of s, and B = z. The dotted rule A --', z. yB must have either been added to 8n by closure or by shifts. If it arose from a shift, z must be a nonempty suffix of wl ...wn. If the dotted rule arose by closure, z = e, and there is some dotted rule A ~ --~ z t * A&amp;quot; such that A&amp;quot; =~ A and ~l is a nonempty suffix of Wl ... wn.</Paragraph>
      <Paragraph position="7"> Now suppose that the claim holds for paths from si to sn, and look at a path labeled wi...wn from si-1 to sn. By the induction hypothesis, A ~ z * yB is a dotted rule of st, where B =~ z, uz = wi+l...wn, and (since st ~ s0), either z is a nonempty suffix of wl ... wi or z = e, A ~ -. z ~. A&amp;quot; is a dotted rule of si, A&amp;quot; :~ A, and z ~ is a nonempty suffix of wl ... wl.</Paragraph>
      <Paragraph position="8"> In the former case, when z is a nonempty suffix of wl ... wl, then z = wj ... wi for some 1 &lt; j &lt; i. Then A ---, wj ...wl * yB is a dotted rule of sl, and thus A ---* wj ...wi-1 * wiyB is a dotted rule ofsi_l. Ifj &lt; i- 1, then wj...wi_l is a nonempty suffix of wl...wi-1, and we are done.</Paragraph>
      <Paragraph position="9"> Otherwise, wj ...wi-1 = e, and so A --* .wiyB is a dotted rule ofsi-1. Let y~ = wiy. Then A ~ .yJB is a dotted rule of si-1, which must have been added by closure. Hence there are nonterminals A I and A&amp;quot; such that A&amp;quot; :~ A and A I ~ z I * A&amp;quot; is a dotted rule of st-l, where z ~ is a nonempty sUtTLX of Wl .. * wi- 1.</Paragraph>
      <Paragraph position="10"> In the latter case, there must be a dotted rule A ~ ~ wj ...wi-1 * wiA&amp;quot; in si-1. The rest of the conditions are exactly as in the previous case.</Paragraph>
      <Paragraph position="11"> Thus, if w - wl...wn is accepted by ~c, then there is a path from so to sn labeled by wl ... w,.</Paragraph>
      <Paragraph position="12"> Hence, by the claim just proved, A ~ z. yB is a dotted rule of sn, and B :~ z, where yz -&amp;quot; wl...wa -- w. Because the st in the claim is so, and all the dotted rules of si can have nothing before the dot, and z must be the empty string.</Paragraph>
      <Paragraph position="13"> Therefore, the only possible case is case 3. Thus, S :~ A ---, yz = w, and hence w E L(G). The proof that the empty string is accepted by ~&amp;quot; only if it is in L(G) is similar to the proof of the claim.</Paragraph>
    </Section>
  </Section>
  <Section position="6" start_page="251" end_page="251" type="metho">
    <SectionTitle>
D
4 A Complete Example
</SectionTitle>
    <Paragraph position="0"> The appendix shows an APSG for a small fragment of English, written in the notation accepted by the current version of our grammar compiler.</Paragraph>
    <Paragraph position="1"> The categories and features used in the grammar are described in Tables 1 and 2 (categories without features are omitted). Features enforce personnumber agreement, personal pronoun case, and a limited verb subcategorization scheme.</Paragraph>
    <Paragraph position="2"> Grammar compilation has three phrases: (i) construction of an equivalent CFG, (ii) approximation, and (iii) determinization and minimization of the resulting FSA. The equivalent CFG is derived by finding all full instantiations of the initial APSG rules that are actually reachable in a derivation from the grammar's start symbol. In the current implementation, the construction of the equivalent CFG is is done by a Prolog program, while the approximator, determinizer and minimizer are written in C.</Paragraph>
    <Paragraph position="3"> For the example grammar, the equivalent CFG has 78 nonterminals and 157 rules, the unfolded and flattened FSA 2615 states and 4096 transitions, and the determinized and minimized final DFA 16 states and 97 transitions. The runtime for the whole process is 4.91 seconds on a Sun SparcStation 1.</Paragraph>
    <Paragraph position="4"> Substantially larger grammars, with thousands of instantiated rules, have been developed for a speech-to-speech translation project. Compilation times vary widely, but very long compilations appear to be caused by a combinatorial explosion in the unfolding of right recursions that will be discussed further in the next section.</Paragraph>
  </Section>
  <Section position="7" start_page="251" end_page="252" type="metho">
    <SectionTitle>
5 Informal Analysis
</SectionTitle>
    <Paragraph position="0"> In addition to the cases of left-linear and right-linear grammars discussed in Section 3, our algorithm is exact in a variety of interesting cases, including the examples of Church and Patil (1982), which illustrate how typical attachment ambiguities arise as structural ambiguities on regular string sets.</Paragraph>
    <Paragraph position="1"> The algorithm is also exact for some self-embedding grammars 4 of regular languages, such as S --+ aS l Sb l c defining the regular language a*eb*.</Paragraph>
    <Paragraph position="2"> A more interesting example is the following simplified grammar for the structure of English noun 4 A grammar is self-embedding if and only if licenses the derivation X ~ c~X~ for nonempty c~ and/3. A language is regular if and only if it can be described by some nonself-embedding grammar.</Paragraph>
    <Paragraph position="4"> The symbols Art, N, PN and P correspond to the parts of speech article, noun, proper noun and preposition. From this grammar, the algorithm derives the DFA in Figure 4.</Paragraph>
    <Paragraph position="5"> As an example of inexact approximation, consider the the self-embedding CFG</Paragraph>
    <Paragraph position="7"> for the nonregular language a'~b'~,n &gt; O. This grammar is mapped by the algorithm into an FSA accepting ~ I a+b+. The effect of the algorithm is thus to &amp;quot;forget&amp;quot; the pairing between a's and b's mediated by the stack of the grammar's characteristic recognizer.</Paragraph>
    <Paragraph position="8"> Our algorithm has very poor worst-case performance. First, the expansion of an APSG into a CFG, not described here, can lead to an exponential blow-up in the number of nonterminals and rules. Second, the subset calculation implicit in the LR(0) construction can make the number of states in the characteristic machine exponential on the number of CF rules. Finally, unfolding can yield another exponential blow-up in the number of states.</Paragraph>
    <Paragraph position="9"> However, in the practical examples we have considered, the first and the last problems appear to be the most serious.</Paragraph>
    <Paragraph position="10"> The rule instantiation problem may be alleviated by avoiding full instantiation of unification grammar rules with respect to &amp;quot;don't care&amp;quot; features, that is, features that are not constrained by the rule.</Paragraph>
    <Paragraph position="11"> The unfolding problem is particularly serious in grammars with subgrammars of the form S -+ XIS I&amp;quot;&amp;quot; J X,,S J Y (I) It is easy to see that the number of unfolded states in the subgrammar is exponential in n. This kind of situation often arises indirectly in the expansion of an APSG when some features in the right-hand side of a rule are unconstrained and thus lead to many different instantiated rules. In fact, from the proof of Proposition 4 it follows immediately that unfolding is unnecessary for right-linear grammars. Ultimately, by dividing the grammar into non-mutually recursive (strongly connected) components and only unfolding center-embedded components, this particular problem could he avoided, s In the meanwhile, the problem can be circumvented by left factoring (1) as follows:</Paragraph>
  </Section>
  <Section position="8" start_page="252" end_page="252" type="metho">
    <SectionTitle>
S -+ ZS\[Y
</SectionTitle>
    <Paragraph position="0"> z-+x, I...IX.</Paragraph>
  </Section>
class="xml-element"></Paper>
Download Original XML