ACL-OCL / Base_JSON /prefixP /json /P91 /P91-1014.json
Benjamin Aw
Add updated pkl file v3
6fa4bc9
{
"paper_id": "P91-1014",
"header": {
"generated_with": "S2ORC 1.0.0",
"date_generated": "2023-01-19T09:03:29.345009Z"
},
"title": "Polynomial Time and Space Shift-Reduce Parsing of Arbitrary Context-free Grammars.*",
"authors": [
{
"first": "Yves",
"middle": [],
"last": "Schabes",
"suffix": "",
"affiliation": {
"laboratory": "",
"institution": "University of Pennsylvania Philadelphia",
"location": {
"postCode": "19104-6389",
"region": "PA",
"country": "USA"
}
},
"email": ""
}
],
"year": "",
"venue": null,
"identifiers": {},
"abstract": "We introduce an algorithm for designing a predictive left to right shift-reduce non-deterministic push-down machine corresponding to an arbitrary unrestricted context-free grammar and an algorithm for efficiently driving this machine in pseudo-parallel. The performance of the resulting parser is formally proven to be superior to Earley's parser (1970). The technique employed consists in constructing before run-time a parsing table that encodes a nondeterministic machine in the which the predictive behavior has been compiled out. At run time, the machine is driven in pseudo-parallel with the help of a chart. The recognizer behaves in the worst case in O(IGI2n3)-time and O(IGIn2)-space. However in practice it is always superior to Earley's parser since the prediction steps have been compiled before runtime. Finally, we explain how other more efficient variants of the basic parser can be obtained by determinizing portionsof the basic non-deterministic pushdown machine while still using the same pseudoparallel driver.",
"pdf_parse": {
"paper_id": "P91-1014",
"_pdf_hash": "",
"abstract": [
{
"text": "We introduce an algorithm for designing a predictive left to right shift-reduce non-deterministic push-down machine corresponding to an arbitrary unrestricted context-free grammar and an algorithm for efficiently driving this machine in pseudo-parallel. The performance of the resulting parser is formally proven to be superior to Earley's parser (1970). The technique employed consists in constructing before run-time a parsing table that encodes a nondeterministic machine in the which the predictive behavior has been compiled out. At run time, the machine is driven in pseudo-parallel with the help of a chart. The recognizer behaves in the worst case in O(IGI2n3)-time and O(IGIn2)-space. However in practice it is always superior to Earley's parser since the prediction steps have been compiled before runtime. Finally, we explain how other more efficient variants of the basic parser can be obtained by determinizing portionsof the basic non-deterministic pushdown machine while still using the same pseudoparallel driver.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Abstract",
"sec_num": null
}
],
"body_text": [
{
"text": "Predictive bottom-up parsers (Earley, 1968; Earley, 1970; Graham et al., 1980) are often used for natural language processing because of their superior average performance compared to purely bottom-up parsers *We are extremely indebted to Fernando Pereira and Stuart Shleber for providing valuable technical comments during discussions about earlier versio/m of this algorithm. We are also grateful to Aravind Joehi for his support of this research. We also thank Robert Frank. All remaining errors are the author's responsibility alone. This research wa~ partially funded by ARO grant DAAL03-89-C0031PRI and DARPA grant N00014-90-J-1863. such as CKY-style parsers (Kasami, 1965; Younger, 1967) . Their practical superiority is mainly obtained because of the top-down filtering accomplished by the predictive component of the parser. Compiling out as much as possible this predictive component before run-time will result in a more efficient parser so long as the worst case behavior is not deteriorated.",
"cite_spans": [
{
"start": 29,
"end": 43,
"text": "(Earley, 1968;",
"ref_id": "BIBREF2"
},
{
"start": 44,
"end": 57,
"text": "Earley, 1970;",
"ref_id": "BIBREF3"
},
{
"start": 58,
"end": 78,
"text": "Graham et al., 1980)",
"ref_id": "BIBREF4"
},
{
"start": 665,
"end": 679,
"text": "(Kasami, 1965;",
"ref_id": "BIBREF6"
},
{
"start": 680,
"end": 694,
"text": "Younger, 1967)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1"
},
{
"text": "Approaches in this direction have been investigated (Earley, 1968; Lang, 1974; Tomita, 1985; Tomita, 1987) , however none of them is satisfying, either because the worst case complexity is deteriorated (worse than Earley's parser) or because the technique is not general. Furthermore, none of these approaches have been formally proven to have a behavior superior to well known parsers such as Earley's parser. Earley himself ([1968] pages 69-89) proposed to precompile the state sets generated by his algorithm to make it as efficient as LR(k) parsers (Knuth, 1965) when used on LR(k) grammars by precomputing all possible states sets that the parser could create. However, some context-free grammars, including most likely most natural language grammars, cannot be compiled using his technique and the problem of knowing if a grammar can be compiled with this technique is undecidable (Earley [1968] , page 99). Lang (1974) proposed a technique for evaluating in pseudo-parallel non-deterministic push down automata. Although this technique achieves a worst case complexity of O(n3)-time with respect to the length of input, it requires that at most two symbols are popped from the stack in a single move. When the technique is used for shift-reduce parsing, this constraint requires that the context-free grammar is in Chomsky normal form (CNF). As far as the grammar size is concerned, an exponential worst case behavior is reached when used with the characteristic LR(0) machine. 1 Tomita (1985; 1987) proposed to extend LR(0) parsers to non-deterministic context-free grammars by explicitly using a graph structured stack which represents the pseudo-parallel evaluation of the moves of a non-deterministic LR(0) push-down automaton. Tomita's encoding of the non-deterministic pushdown automaton suffers from an exponential time and space worst case complexity with respect to the input length and also with respect to the grammar size (Johnson [1989] and also page 72 in Tomita [1985] ). Although Tomita reports experimental data that seem to show that the parser behaves in practice better than Earley's parser (which is proven to take in the worst case O ([G[2n3)-time) , the duplication of the same experiments shows no conclusive outcome. Modifications to Tomita's algorithm have been proposed in order to alleviate the exponential complexity with respect to the input length (Kipps, 1989) but, according to Kipps, the modified algorithm does not lead to a practical parser. Furthermore, the algorithm is doomed to behave in the worst case in exponential time with respect to the grammar size for some ambiguous grammars and inputs (Johnson, 1989) . 2 So far, there is no formal proof showing that the Tomita's parser can be superior for some grammars and inputs to Earley's parser, and its worst case complexity seems to contradict the experimental data.",
"cite_spans": [
{
"start": 52,
"end": 66,
"text": "(Earley, 1968;",
"ref_id": "BIBREF2"
},
{
"start": 67,
"end": 78,
"text": "Lang, 1974;",
"ref_id": "BIBREF9"
},
{
"start": 79,
"end": 92,
"text": "Tomita, 1985;",
"ref_id": null
},
{
"start": 93,
"end": 106,
"text": "Tomita, 1987)",
"ref_id": null
},
{
"start": 411,
"end": 433,
"text": "Earley himself ([1968]",
"ref_id": null
},
{
"start": 553,
"end": 566,
"text": "(Knuth, 1965)",
"ref_id": "BIBREF8"
},
{
"start": 887,
"end": 901,
"text": "(Earley [1968]",
"ref_id": "BIBREF2"
},
{
"start": 914,
"end": 925,
"text": "Lang (1974)",
"ref_id": "BIBREF9"
},
{
"start": 1487,
"end": 1500,
"text": "Tomita (1985;",
"ref_id": null
},
{
"start": 1501,
"end": 1506,
"text": "1987)",
"ref_id": null
},
{
"start": 1941,
"end": 1956,
"text": "(Johnson [1989]",
"ref_id": "BIBREF5"
},
{
"start": 1984,
"end": 1990,
"text": "[1985]",
"ref_id": null
},
{
"start": 2163,
"end": 2177,
"text": "([G[2n3)-time)",
"ref_id": null
},
{
"start": 2386,
"end": 2399,
"text": "(Kipps, 1989)",
"ref_id": "BIBREF7"
},
{
"start": 2642,
"end": 2657,
"text": "(Johnson, 1989)",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1"
},
{
"text": "As explained, the previous attempts to compile the predictive component are not general and achieve a worst case complexity (with respect to the grammar size and the input length) worse than standard parsers.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1"
},
{
"text": "The methodology we follow in order to compile the predictive component of Earley's parser is to define a predictive bottom-up pushdown machine equivalent to the given grammar which we drive in pseudoparallel. Following Johnson's (1989) argument, any parsing algorithm based on the LR(0) characteristic machine is doomed to behave in exponential time with respect to the grammar size for some ambiguous grammars and inputs. This is a result of the fact that the number of states of an LR(0) characteristic machine can be exponential and that there are some grammars and inputs for which an exponential number of states must be reached (See Johnson [1989] for examples of such grammars and inputs). One must therefore design a different pushdown machine which can be driven efficiently in pseudo-parallel.",
"cite_spans": [
{
"start": 219,
"end": 235,
"text": "Johnson's (1989)",
"ref_id": "BIBREF5"
},
{
"start": 639,
"end": 653,
"text": "Johnson [1989]",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1"
},
{
"text": "We construct a non-deterministic predictive pushdown machine given an arbitrary context-free grammar whose number of states is proportional to the size of the grammar. Then at run time, we efficiently drive this machine in pseudo-parallel. Even if all the states of the machine are reached for some grammars and inputs, a polynomial complexity will still be obtained since the number of states is bounded by the grammar size. We therefore introduce a shift-reduce driver for this machine in which all of the predictive component has been compiled in the finite state control of the machine. The technique makes no requirement on the form of the context-free grammar and it behaves in the worst case as well as Earley's parser (Earley, 1970) . The push-down machine is built before runtime and it is encoded as parsing tables in the which the predictive behavior has been compiled out.",
"cite_spans": [
{
"start": 726,
"end": 740,
"text": "(Earley, 1970)",
"ref_id": "BIBREF3"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1"
},
{
"text": "In the worst case, the recognizer behaves in the same O -space as Earley's parser. However in practice it is always superior to Earley's parser since the prediction steps have been eliminated before run-time. We show that the items produced in the chart correspond to equivalence classes on the items produced for the same input by Earley's parser. This mapping formally shows its practical superior behavior. 3",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1"
},
{
"text": "Finally, we explain how other more efficient variants of the basic parser can be obtained by determinizing portions of the basic non-deterministic pushdown machine while still using the same pseudoparallel driver.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Introduction",
"sec_num": "1"
},
{
"text": "The parser we propose handles any context-free grammar; the grammar can be ambiguous and need not be in any normal form. The parser is a predictive shiftreduce bottom-up parser that uses compiled top down prediction information in the form of tables. Before run-time, a non-deterministic push down automaton (NPDA) is constructed from a given context-free grammar. The parsing tables encode the finite state control and the moves of the NPDA. At run-time, the NPDA is then driven in pseudo-parallel with the help of a chart. We show the construction of a basic machine which will be driven non-deterministically.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "The Parser",
"sec_num": "2"
},
{
"text": "In the following, the input string is w --al...an and the context-free grammar being considered is G = (~, NT, P, S), where ~ is the set of terminal 3The characteristic LR(0) machine is the result of determinizing the n~acldne we introduce. Since this procedure introduce exponentially more states, the LR(0) machine can be exponentially large. symbols, NT the set of non-terminal symbols, P a set of production rules, S the start symbol. We will need to refer to the subsequence of the input string w = az...aN from position i to j, w]i,j], which we define as follows:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "The Parser",
"sec_num": "2"
},
{
"text": "f ai+l ... aj , if i < j w]i,~] I, \u00a2 ,ifi>_j",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "The Parser",
"sec_num": "2"
},
{
"text": "We explain the data-structures used by the parser, the moves of the parser, and how the parsing tables are constructed for the basic NPDA. Then, we study the formal characteristics of the parser.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "The Parser",
"sec_num": "2"
},
{
"text": "The parser uses two moves: shift and reduce. As in standard shift-reduce parsers, shift moves recognize new terminal symbols and reduce moves perform the recognition of an entire context-free rule. However in the parser we propose, shift and reduce moves behave differently on rules whose recognition has just started (i.e. rules that have been predicted) than on rules of which some portion has been recognized. This behavior enables the parser to efficiently perform reduce moves when ambiguity arises.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "The Parser",
"sec_num": "2"
},
{
"text": "The parser collects items into a set called the chart, C. Each item encodes a well formed substring of the input. The parser proceeds until no more items can be added to the chart C.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "An item is defined as a triple (s,i,jl, where s is a state in the control of the NPDA, i and j are indices referring to positions in the input string (i, j E [0, n]).",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "In an item (s,i,j), j corresponds to the current position in the input string and i is a position in the input which will facilitate the reduce move. . As we will see, non-kernel dotted rules correspond to the predictive component of the parser. We will later see each state s of the NPDA corresponds to a set of dotted rules for the grammar G.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "The set of all possible states in the control of the NPDA is written S. Section 2.2 explains how the states are constructed.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "The algorithm maintains the following property (which guarantees its soundness)4: if an item (s, i,j) is in the chart C then for all dotted rules A ~ aofl E s the following is satisfied: ",
"cite_spans": [
{
"start": 93,
"end": 101,
"text": "(s, i,j)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "(i) if a E (E U NT) +, then B7 E (NT U ~)*",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "GOTO~(s,X) = {r},GOTOnk(s,X) = {r'} with r, rt,s E S,X E NT.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "C := {(start, O, 0)}",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "Perform the following three operations until no more items can be added to the chart C:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "(1) KERNEL SHIFT: if (s,i,j) 6 C and if ksh(s') 6 ACTION(s, aj+I), then (s', i, j + 1) is added to C.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "(2) NON-KERNEL SHIFT: if (s,i,j) e C and if nksh(s') E ACTION(s, aj+I), then (s',j,j+ 1) is added to C.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "(",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "3) REDUCE: if (s, i, j) E C, then for all X --~ j3 s.t. red(X ~ ~) 6 ACTION(s, aj+t)",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "and for all (s', k, i) E C, perform the following:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "\u2022 for all rl 6 GOTO~(s',X), (rl,k,j) is added to C;",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "\u2022 for all r2 E GOTOnk(s',X), (r~,i,j) is added to C.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "If {(s, O, n) I (s, O, n) 6 C and s e .r} .# # then return acceptance otherwise return rejection.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "end (* recognizer *) In the above algorithm, non-determinism arises from multiple entries in ACTION(s, a) and also from the fact that GOTOk(s,X)and GOTOnk(s,X)contain a set of states.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Data-Structures and the Moves of the Parser",
"sec_num": "2.1"
},
{
"text": "We shall give an LR(0)-like method for constructing the parsing tables corresponding to the basic NPDA. Several other methods (such as LR(k)-like, SLR(k)like) can also be used for constructing the parsing tables and are described in (Schabes, 1991) .",
"cite_spans": [
{
"start": 233,
"end": 248,
"text": "(Schabes, 1991)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Construction of the Parsing Tables",
"sec_num": "2.2"
},
{
"text": "To construct the LR(0)-like finite state control for the basic non-deterministic push-down automaton that the parser simulates, we define three functions, closure, gotok and gotonk.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Construction of the Parsing Tables",
"sec_num": "2.2"
},
{
"text": "If s is a state, then closure(s) is the state constructed from s by the two rules: X .,8) )1 A",
"cite_spans": [],
"ref_spans": [
{
"start": 83,
"end": 89,
"text": "X .,8)",
"ref_id": null
}
],
"eq_spans": [],
"section": "Construction of the Parsing Tables",
"sec_num": "2.2"
},
{
"text": "(i) Initially,",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Construction of the Parsing Tables",
"sec_num": "2.2"
},
{
"text": "The goto functions we define differ from the one defined for the LR(0) construction in two ways: first we have distinguished transitions on symbols from kernel items and non-kernel items; second, each state in goto~(s,X) and gOtOn~(S,X) contains exactly one kernel item whereas for the LR(0) construction they may contain more than one.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 s}",
"sec_num": null
},
{
"text": "We are now ready to compute the set of states ,9 defining the finite state control of the parser.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 s}",
"sec_num": null
},
{
"text": "The SET OF STATES CONSTRUCTION is constructed as follows: for each X E r~ u NT terminal for each r E gotok(s,X) U goton~ (s, X) add r to S until no more states can be added to 8 end PARSING TABLES. Now we construct the LR(0) parsing tables ACTION, GOTOk and GOTOnk from the finite state control constructed above. Given a context-free grammar G, we construct ~q, the set of states for G with the procedure given above. We construct the action table ACTION and the goto tables using the following algorithm.",
"cite_spans": [
{
"start": 121,
"end": 127,
"text": "(s, X)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "\u2022 s}",
"sec_num": null
},
{
"text": "Input: A context-free grammar G = (Y,, NT, P, S). Output: The parsing tables ACTION, GOTOk and GOTOnk for G, the start state start and the set of final states ~'.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "Step 1. Construct 8 = {so,..., sin}, the set of states for G.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "Step 2. The parsing actions for state si are determined for all terminal symbols a E ~ as follows:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "(i) for all r e gotok(si,a), add ksh(r) to ACTION(si, a);",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "(ii) for all r E goto, k(si,a), add nksh(r) to to ACTION(si, a);",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "(iii) if A --* a* is in si, then add red(A--* a)",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "to ACTION(si, a) for all terminal symbol a and for the end marker $.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "Step 4. The kernel and non-kernel goto tables for state si are determined for all non-terminal symbols X as follows:",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "(i) VX E NT, GOTO~(si,X) := gotok(si,X) (ii) VX E NT, GOTOnk(si, X) :--gotonk(si, X)",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "Step 3. The start state of the parser is start := ciosure({S --* .a I S --~ a ~_ P})",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "Step 4. One of the objectives for the design of the nondeterministic machine was to make sure that it was not possible to reach an exponential number of states, a property without which the machine is doomed to have exponential complexity (Johnson, 1989 ). First we observe that the number of states of the finite state control of the non-deterministic machine that we constructed in Section 2.2 is proportional to the size of the grammar, IG[. By construction, each state (except for the start state) contains exactly one kernel dotted rule. Therefore, the number of states is bounded by the maximum number of kernel rules of the form A --* ao/~ (with a non empty), and is O(IGI).",
"cite_spans": [
{
"start": 239,
"end": 253,
"text": "(Johnson, 1989",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "We conclude that the algorithm requires in the worst case O(IGIn~)-space since the maximum number of items (8, i, j) in the chart is proportional to IGIn 2.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "A close look at the moves of the parser reveals that the reduce move is the most complex one since it involves a pair of states (s, i,j) and (s', k,j/. This move can be instantiated at most O(IGI2nS)-time since i,j,k E [0, n] and there are in the worst case O (IGI ~) pairs of states involved in this move. 5 The parser therefore behaves in the worst case in O(IGI2nS)-time.",
"cite_spans": [
{
"start": 128,
"end": 136,
"text": "(s, i,j)",
"ref_id": null
},
{
"start": 260,
"end": 267,
"text": "(IGI ~)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "One should however note that in order to bound the worst case complexity as stated above, arrays similar to the one needed for Earley's parser must be used to implement efficiently the shift and reduce moves. 6",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "As for Earley's parser, it can also be shown that the algorithm requires in the worst case O(IGI2n2)-time for unambiguous context-free grammars and behaves in linear time on a large class of grammars.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "begin (CONSTRUCTION OF THE PARSING TABLES)",
"sec_num": null
},
{
"text": "The algorithm that we described in Section 2 is a recognizer. However, if we include pointers from an item to the other items (to a pair of items for the reduce moves or to an item for the shift moves) which caused it to be placed in the chart, the recognizer can be modified to record all parse trees of the input string. The representation is similar to a shared forest. ",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Retrieving a Parse",
"sec_num": "4"
},
{
"text": "We derive the correctness of the parser by showing how it can be mapped to Earley's parser. In the process, we will also be able to show why this parser can be more efficient than Earley's parser. The detailed proofs are given in (Schabes, 1991) . We are also interested in formally characterizing the differences in performance between the parser we propose and Earley's parser. We show that the parser behaves in the worst scenario as well as Earley's parser by mapping it into Earley's parser. The parser behaves better than Earley's parser because it has eliminated the prediction step which takes in the worst case O(]GIn)-time for Earley's parser. Therefore, in the most favorable scenario, the parser we SKerael shift and non-kernel shift moves require both at most O(IGIn 2 )-time.",
"cite_spans": [
{
"start": 230,
"end": 245,
"text": "(Schabes, 1991)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Correctness and Comparison with Earley's Parser",
"sec_num": "5"
},
{
"text": "6Due to the lack of space, the details of the implementation are not given in this paper but they are given in (Schabes, 1991 ).",
"cite_spans": [
{
"start": 111,
"end": 125,
"text": "(Schabes, 1991",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Correctness and Comparison with Earley's Parser",
"sec_num": "5"
},
{
"text": "propose will require O(IGln) less time than Earley's parser.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Correctness and Comparison with Earley's Parser",
"sec_num": "5"
},
{
"text": "For a given context-free grammar G and an input string al .-.an, let C be the set of items produced by the parser and CearZey be the set of items produced by Earley's parser. Earley's parser (Earley, 1970) produces items of the form (A ---* a * ~, i, j) where A --* a \u2022 ~ is a single dotted rule and not a set of dotted rules.",
"cite_spans": [
{
"start": 191,
"end": 205,
"text": "(Earley, 1970)",
"ref_id": "BIBREF3"
}
],
"ref_spans": [
{
"start": 233,
"end": 253,
"text": "(A ---* a * ~, i, j)",
"ref_id": null
}
],
"eq_spans": [],
"section": "Correctness and Comparison with Earley's Parser",
"sec_num": "5"
},
{
"text": "The following lemma shows how one can map the items that the parser produces to the items that Earley's parser produces for the same grammar and input: The proof of the above lemma is by induction on the number of kernel items added to the chart created by Earley's parser.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Correctness and Comparison with Earley's Parser",
"sec_num": "5"
},
{
"text": "Lemma 1 If Cs, i,j) E C",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Correctness and Comparison with Earley's Parser",
"sec_num": "5"
},
{
"text": "The correctness of the parser follows from Lemma 1 and its completeness from Lemma 2 since it is well known that the items created by Earley's parser are characterized as follows (see, for example, page 323 in Aho and Ullman [1973] for a proof of this invariant): The parser we propose is therefore more efficient than Earley's parser since it has compiled out prediction before run time. How much more efficient it is, depends on how prolific the prediction is and therefore on the nature of the grammar and the input string.",
"cite_spans": [
{
"start": 210,
"end": 231,
"text": "Aho and Ullman [1973]",
"ref_id": "BIBREF0"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Correctness and Comparison with Earley's Parser",
"sec_num": "5"
},
{
"text": "The parser can be easily extended to incorporate standard optimization techniques proposed for predictive parsers.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optimizations",
"sec_num": "6"
},
{
"text": "The closure operation which defines how a state is constructed already optimizes the parser on chain derivations in a manner very similar to the techniques originally proposed by Graham eta] . (1980) and later also used by Leiss (1990) .",
"cite_spans": [
{
"start": 179,
"end": 190,
"text": "Graham eta]",
"ref_id": null
},
{
"start": 193,
"end": 199,
"text": "(1980)",
"ref_id": null
},
{
"start": 223,
"end": 235,
"text": "Leiss (1990)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Optimizations",
"sec_num": "6"
},
{
"text": "In addition, the closure operation can be designed to optimize the processing of non-terminal symbols that derive the empty string in manner very similar to the one proposed by Graham et al. (1980) and Leiss (1990) . The idea is to perform the reduction of symbols that derive the empty string at compilation time, i.e. include this type of reduction in the definition of closure by adding (iii):",
"cite_spans": [
{
"start": 177,
"end": 197,
"text": "Graham et al. (1980)",
"ref_id": "BIBREF4"
},
{
"start": 202,
"end": 214,
"text": "Leiss (1990)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Optimizations",
"sec_num": "6"
},
{
"text": "If s is a state, then closure(s) is now the state constructed from s by the three rules: The rest of the parser remains as before.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optimizations",
"sec_num": "6"
},
{
"text": "(i) Initially,",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Optimizations",
"sec_num": "6"
},
{
"text": "In the previous section we have constructed a machine whose number of states is in the worst case proportional to the size of the grammar. This requirement is essential to guarantee that the complexity of the resulting parser with respect to the grammar size is not exponential or worse than O(IGI2)time as other well known parsers. However, we may use some non-determinism in the machine to guarantee this property. The non-determinism of the machine is not a problem since we have shown how the non-deterministic machine can be efficiently driven in pseudo-parallel (in O([G[2n3)-time) .",
"cite_spans": [
{
"start": 568,
"end": 587,
"text": "(in O([G[2n3)-time)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Variants on the basic machine",
"sec_num": "7"
},
{
"text": "We can now ask the question of whether it is possible to determinize the finite state control of the machine while still being able to bound the complexity of the parser to O([Gl2n3)-time. Johnson (1989) exhibits grammars for which the full determinization of the finite state control (the LR(0) construction) leads to a parser with exponential complexity, because the finite state control has an exponential number of states and also because there are some input string for which an exponential number of states will be reached. However, there are also cases where the full determin~ation either will not increase the number of states or will not lead to a parser with exponential complexity because there are no input that require to reach an exponential number of states. We are currently studying the classes of grammars for which this is the case.",
"cite_spans": [
{
"start": 189,
"end": 203,
"text": "Johnson (1989)",
"ref_id": "BIBREF5"
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Variants on the basic machine",
"sec_num": "7"
},
{
"text": "One can also try to determinize portions of the finite state automaton from which the control is derived while making sure that the number of states does not become larger than O(IGI).",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Variants on the basic machine",
"sec_num": "7"
},
{
"text": "All these variants of the basic parser obtained by determinizing portions of the basic non-deterministic push-down machine can be driven in pseudo-parallel by the same pseudo-parallel driver that we previously defined. These variants lead to a set of more efficient machines since the non-determinism is decreased.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Variants on the basic machine",
"sec_num": "7"
},
{
"text": "We have introduced a shift-reduce parser for unrestricted context-free grammars based on the construction of a non-deterministic machine and we have formally proven its superior performance compared to Earley's parser.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "8"
},
{
"text": "The technique which we employed consists of constructing before run-time a parsing table that encodes a non-deterministic machine in the which the predictive behavior has been compiled out. At run time, the machine is driven in pseudo-parallel with the help a chart.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "8"
},
{
"text": "By defining two kinds of shift moves (on kernel dotted rules and on non-kernel dotted rules) and two kinds of reduce moves (on kernel and non-kernel dotted rules), we have been able to efficiently evaluate in pseudo-parallel the non-deterministic push down machine constructed for the given context-free grammar.",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "8"
},
{
"text": "The same worst case complexity as Earley's recognizer is achieved: O(IGl2na)-time and O(IG]n2)space. However, in practice, it is superior to Earley's parser since all the prediction steps and some of the completion steps have been compiled before run-time. The parser can be modified to simulate other types of machines (such LR(k)-like or SLR-like automata). It can also be extended to handle unification based grammars using a similar method as that employed by Shieber (1985) for extending Earley's algorithm.",
"cite_spans": [
{
"start": 464,
"end": 478,
"text": "Shieber (1985)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "8"
},
{
"text": "Furthermore, the algorithm can be tuned to a par-ticular grammar and therefore be made more efficient by carefully determinizing portions of the nondeterministic machine while making sure that the number of states in not increased. These variants lead to more efficient parsers than the one based on the basic non-deterministic push-down machine. Furthermore, the same pseudo-parallel driver can be used for all these machines. We have adapted the technique presented in this paper to other grammatical formalism such as treeadjoining grammars (Schabes, 1991) .",
"cite_spans": [
{
"start": 544,
"end": 559,
"text": "(Schabes, 1991)",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "Conclusion",
"sec_num": "8"
},
{
"text": "The same arguraent for the exponential graramar size complexity of Tomita's parser(Johnson, 1989) holds for Lang's technique.2 This problem is particularly acute for natural language processing since in this context the input length is typically small (10-20 words) and the granunar size very large (hundreds or thousands of rules and symbols).",
"cite_spans": [],
"ref_spans": [],
"eq_spans": [],
"section": "",
"sec_num": null
}
],
"back_matter": [
{
"text": "Hans Leiss. 1990 ",
"cite_spans": [
{
"start": 5,
"end": 16,
"text": "Leiss. 1990",
"ref_id": null
}
],
"ref_spans": [],
"eq_spans": [],
"section": "annex",
"sec_num": null
},
{
"text": "We give an example that illustrates how the recognizer works. The grammar used for the example generates the language L = {a(ba)nln >_ O} and is infinitely ambiguous:The set of states and the goto function are shown in Figure 1 . In Figure 1 , the set of states is {0, 1, 2, 3, 4, 5}. We have marked with a sharp sign (~) transitions on a non-kernel dotted rule. If an arc from 51 to 52 is labeled by a non-sharped symbol X, then s2 is in gotot(Sl,X). If an arc from sl to 52 is labeled by a sharped symbol X~, then 52 is in gotont(Sx, X). The input string given to the recognizer is: ababa$ ($ is the end marker). The chart is shown in Figure 3. In Figure 3 , an arc labeled by s from position i to position j denotes the item (s, i,j) . The input is accepted since the final states 2 and 5 span the entire string ((2, 0, 5) E C and (5, 0, 5) E C). Notice that there are multiple arcs subsuming the same substring. ( 1,0, 3)(1,2, 3)15,0,3) (4, O, 4)(4, 2, 4) (3,4,5) (2,0,5) (2,2,5) (2,4,5) (1,0,5) (1,2,5) (1,4,5) (5,0,5)(5,2,5) ",
"cite_spans": [
{
"start": 728,
"end": 736,
"text": "(s, i,j)",
"ref_id": null
}
],
"ref_spans": [
{
"start": 219,
"end": 227,
"text": "Figure 1",
"ref_id": null
},
{
"start": 233,
"end": 241,
"text": "Figure 1",
"ref_id": null
},
{
"start": 637,
"end": 643,
"text": "Figure",
"ref_id": null
},
{
"start": 650,
"end": 658,
"text": "Figure 3",
"ref_id": null
},
{
"start": 918,
"end": 940,
"text": "1,0, 3)(1,2, 3)15,0,3)",
"ref_id": null
}
],
"eq_spans": [],
"section": "An Example",
"sec_num": null
}
],
"bib_entries": {
"BIBREF0": {
"ref_id": "b0",
"title": "Theory of Parsing",
"authors": [
{
"first": "A",
"middle": [
"V"
],
"last": "Aho",
"suffix": ""
},
{
"first": "J",
"middle": [
"D"
],
"last": "Ullman",
"suffix": ""
}
],
"year": 1973,
"venue": "Translation and Compiling",
"volume": "I",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "A. V. Aho and J. D. Ullman. 1973. Theory of Pars- ing, Translation and Compiling. Vol I: Parsing.",
"links": null
},
"BIBREF2": {
"ref_id": "b2",
"title": "An Efficient Context-Free Parsing Algorithm",
"authors": [
{
"first": "Jay",
"middle": [
"C"
],
"last": "Earley",
"suffix": ""
}
],
"year": 1968,
"venue": "",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Jay C. Earley. 1968. An Efficient Context-Free Pars- ing Algorithm. Ph.D. thesis, Carnegie-Mellon Uni- versity, Pittsburgh, PA.",
"links": null
},
"BIBREF3": {
"ref_id": "b3",
"title": "An efficient context-free parsing algorithm",
"authors": [
{
"first": "Jay",
"middle": [
"C"
],
"last": "Earley",
"suffix": ""
}
],
"year": 1970,
"venue": "Commun. ACM",
"volume": "13",
"issue": "2",
"pages": "94--102",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Jay C. Earley. 1970. An efficient context-free parsing algorithm. Commun. ACM, 13(2):94-102.",
"links": null
},
"BIBREF4": {
"ref_id": "b4",
"title": "An improved context-free recognizer",
"authors": [
{
"first": "S",
"middle": [
"L"
],
"last": "Graham",
"suffix": ""
},
{
"first": "M",
"middle": [
"A"
],
"last": "Harrison",
"suffix": ""
},
{
"first": "W",
"middle": [
"L"
],
"last": "Ruzzo",
"suffix": ""
}
],
"year": 1980,
"venue": "ACM Transactions on Programming Languages and Systems",
"volume": "2",
"issue": "3",
"pages": "415--462",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "S.L. Graham, M.A. Harrison, and W.L. Ruzzo. 1980. An improved context-free recognizer. ACM Trans- actions on Programming Languages and Systems, 2(3):415-462, July.",
"links": null
},
"BIBREF5": {
"ref_id": "b5",
"title": "The computational complexity of Tomlta's algorithm",
"authors": [
{
"first": "Mark",
"middle": [],
"last": "Johnson",
"suffix": ""
}
],
"year": 1989,
"venue": "Proceedings of the International Workshop on Parsing Technologies",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Mark Johnson. 1989. The computational complex- ity of Tomlta's algorithm. In Proceedings of the International Workshop on Parsing Technologies, Pittsburgh, August.",
"links": null
},
"BIBREF6": {
"ref_id": "b6",
"title": "An efficient recognition and syntax algorithm for context-free languages",
"authors": [
{
"first": "T",
"middle": [],
"last": "Kasami",
"suffix": ""
}
],
"year": 1965,
"venue": "",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "T. Kasami. 1965. An efficient recognition and syn- tax algorithm for context-free languages. Technical Report AF-CRL-65-758, Air Force Cambridge Re- search Laboratory, Bedford, MA.",
"links": null
},
"BIBREF7": {
"ref_id": "b7",
"title": "Analysis of Tomita's algorithm for general context-free parsing",
"authors": [
{
"first": "R",
"middle": [],
"last": "James",
"suffix": ""
},
{
"first": "",
"middle": [],
"last": "Kipps",
"suffix": ""
}
],
"year": 1989,
"venue": "Proceedings of the International Workshop on Parsing Technologies",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "James R. Kipps. 1989. Analysis of Tomita's al- gorithm for general context-free parsing. In Pro- ceedings of the International Workshop on Parsing Technologies, Pittsburgh, August.",
"links": null
},
"BIBREF8": {
"ref_id": "b8",
"title": "On the translation of languages from left to right",
"authors": [
{
"first": "D",
"middle": [
"E"
],
"last": "Knuth",
"suffix": ""
}
],
"year": 1965,
"venue": "Information and Control",
"volume": "8",
"issue": "",
"pages": "607--639",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "D. E. Knuth. 1965. On the translation of languages from left to right. Information and Control, 8:607- 639.",
"links": null
},
"BIBREF9": {
"ref_id": "b9",
"title": "Deterministic techniques for efficient non-deterministic parsers",
"authors": [
{
"first": "Bernard",
"middle": [],
"last": "Lang",
"suffix": ""
}
],
"year": 1974,
"venue": "Automata, Languages and Programming",
"volume": "",
"issue": "",
"pages": "",
"other_ids": {},
"num": null,
"urls": [],
"raw_text": "Bernard Lang. 1974. Deterministic tech- niques for efficient non-deterministic parsers. In Jacques Loeckx, editor, Automata, Languages and Programming, 2nd Colloquium, University of Saarbr~cken. Lecture Notes in Computer Science, Springer Verlag.",
"links": null
}
},
"ref_entries": {
"FIGREF0": {
"type_str": "figure",
"uris": null,
"num": null,
"text": "dotted rule of a context-free grammar G is defined as a production of G associated with a dot at some position of the right hand side: A ~ a \u2022/~ with A --~ afl E P. We distinguish two kinds of dotted rules. Kernel dotted rules, which are of the form A ~ a \u2022 fl with a non empty, and non-kernel dotted rules, which have the dot at the left most position in the right hand side (A --~ \u20221~)"
},
"FIGREF1": {
"type_str": "figure",
"uris": null,
"num": null,
"text": "The use of these tables is explained below.The action table is accessed by a state and a terminal symbol. It contains a set of actions. Given an item,(s, i,j), the possible actions are determined by the content of ACTION(s, aj+x) where aj+l is the j + 1 th input token. The possible actions contained in ACTION(s, aj+l) are the following:\u2022 KERNEL SHIFT s t, (ksh(s t) for short), for s t E S. Anew token is recognized in a kernel dotted rule A --* a \u2022 aft and a push move is performed. The item (s I, i,j + 1) is added to the chart, since aa spans in this case w]i,j+l]. \u2022 NON-KERNEL SHIFT s t, (nksh(s I) for short), for s t E S. A new token is recognized in a nonkernel dotted rule of the form A --* \u2022aft. The item (s',j,j + 1) is is added to the chart, since a spans in this case wljj+x ] \u2022 REDUCE X ---. fl, (red(X ---* fl) for short), for X --* ~ E P. The context-free rule X --*/~ has been totally recognized. The rule spans the substring ai+z ...aj. For all items in the chart of the form (s ~, k, i), perform the following two steps: -for all rl E GOTOk(s',X), it adds the item (ra, k,j) to the chart. In this case, a dotted rule of the form A ~ a \u2022 Xfl is combined with X --* fl\u2022 to form A ---* aX \u2022/~; since a spans w]k,i] and X spans wli,j], aX spans w]k,j].-for all r2 E GOTOnk(s t, X), it adds the item (r2,i,j) to the chart. In this case, a dotted rule of the form A ~ \u2022 Xf~ is combined with X --~ fl\u2022 to form A ~ X \u2022/~; in this case X spans w]idl-4This property holds for all machines derived from the basic NPDA."
},
"FIGREF2": {
"type_str": "figure",
"uris": null,
"num": null,
"text": "{closure({S --, .~ I S-* a e P})} repeat for each state s in 8"
},
"FIGREF3": {
"type_str": "figure",
"uris": null,
"num": null,
"text": "The worst case time complexity of the parser is the same as for the recognizer (O([GI2n3)-time) but, as for Earley's parser, the worst case space complexity increases to O([G[2n 3) because of the additional bookkeeping."
},
"FIGREF4": {
"type_str": "figure",
"uris": null,
"num": null,
"text": "then we have: (i) for all kernel dotted rules A ~ a \u2022 ~ E s, we have C A ~ ct \u2022 ~, i, j) E CearIey (ii) and for all non-kernel dotted rules A ---, *j3 E s, we have C A ~ \u2022~, j, j) E Cearaev The proof of the above lemma is by induction on the number of items added to the chart C. This shows that an item is mapped into a set of items produced by Earley's parser. By construction, in a given state s E S, non-kernel dotted rules have been introduced before run-time by the closure of kernel dotted rules. It follows that Earley's parser can require O(IGln) more space since all Earley's items of the form C A ~ \u2022a, i, i) (i E [0, n]) are not stored separately from the kernel dotted rule which introduced them. Conversely, each kernel item in the chart created by Earley's parser can be put into correspondence with an item created by the parser we propose. Lemma 2 If CA --* a \u2022 fl, i,j) E CearZev and if (~ # e, then C s, i,j) e C where s = closure({A ~ a \u2022 fl})."
},
"FIGREF5": {
"type_str": "figure",
"uris": null,
"num": null,
"text": "C A --. a \u2022 fl, i, j) E Ceartey if and only if, ST E (VNT U VT)* such that S\"~W]o,i]XT and X==c, FA=~w]ij]A."
},
"TABREF0": {
"content": "<table><tr><td>The goto tables are accessed by a state and a non-</td></tr><tr><td>terminal symbol. They each contain a set of states:</td></tr></table>",
"type_str": "table",
"num": null,
"html": null,
"text": "such that S~w]o,i]A 7 and a=:=~w]~d]; (ii) if a is the empty string, then B 7 E (NT O ~)* such that S=~w]0./]A 7. The parser uses three tables to determine which move(s) to perform: an action table, ACTION, and two goto tables, the kernel goto table, GOTOk, and the non-kernel goto table, GOTOnk."
},
"TABREF2": {
"content": "<table><tr><td colspan=\"4\">every dotted rule in s is added to</td></tr><tr><td>closure(s);</td><td/><td/><td/></tr><tr><td colspan=\"4\">(ii) If A --* a \u2022 B/~ is in closure(s) and B --* 7 is a</td></tr><tr><td colspan=\"4\">production, then add the dotted rule B --* e7 to</td></tr><tr><td colspan=\"4\">closure(s) If s is a state and if X is a non-terminal or terminal</td></tr><tr><td colspan=\"4\">symbol, gotok(s,X) and gotonk(s,X) are the set of</td></tr><tr><td colspan=\"2\">states defined as follows:</td><td/><td/></tr><tr><td>gotok(s, X) =</td><td/><td/><td/></tr><tr><td>{closure({A</td><td>\u2022</td><td>A -*</td><td>\u2022 XZ e s</td></tr><tr><td/><td/><td colspan=\"2\">and a E (Z3 U NT) + }</td></tr><tr><td>gotonk ( s, X ) =</td><td/><td/><td/></tr><tr><td>{closure({A</td><td/><td/><td/></tr></table>",
"type_str": "table",
"num": null,
"html": null,
"text": "(if it is not already there). This rule is applied until no more new dotted rules can be added to closure(s)."
},
"TABREF4": {
"content": "<table><tr><td/><td colspan=\"2\">every dotted rule in s is added to</td></tr><tr><td colspan=\"2\">closure(s);</td><td/></tr><tr><td>(ii) ifA~</td><td>a.Bflisinclosure(s)</td><td>andB ~ 7is</td></tr><tr><td colspan=\"3\">a production, then add the dotted rule B ~ \u2022 7</td></tr><tr><td colspan=\"2\">to closure(s) (if it is not already there).</td><td/></tr><tr><td colspan=\"3\">Rules (ii) and (iii) are applied until no more new</td></tr><tr><td colspan=\"3\">dotted rules can be added to closure(s).</td></tr></table>",
"type_str": "table",
"num": null,
"html": null,
"text": "(if it is not already there); (iii) ifA ~ a.B~ is in closure(s) and ifB=~ e, then add the dotted rule A ~ aB \u2022 ~ to closure(s)"
}
}
}
}