File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/evalu/91/p91-1014_evalu.xml
Size: 4,025 bytes
Last Modified: 2025-10-06 14:00:02
<?xml version="1.0" standalone="yes"?> <Paper uid="P91-1014"> <Title>Polynomial Time and Space Shift-Reduce Parsing of Arbitrary Context-free Grammars.*</Title> <Section position="6" start_page="109" end_page="110" type="evalu"> <SectionTitle> 5 Correctness and Comparison </SectionTitle> <Paragraph position="0"> with Earley's Parser 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).</Paragraph> <Paragraph position="1"> 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.</Paragraph> <Paragraph position="2"> 6Due to the lack of space, the details of the implementation are not given in this paper but they are given in (Schabes, 1991).</Paragraph> <Paragraph position="3"> propose will require O(IGln) less time than Earley's parser.</Paragraph> <Paragraph position="4"> 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 * ~ is a single dotted rule and not a set of dotted rules.</Paragraph> <Paragraph position="5"> 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: null Lemma 1 If Cs, i,j) E C then we have: (i) for all kernel dotted rules A ~ a * ~ E s, we have C A ~ ct * ~, i, j) E CearIey (ii) and for all non-kernel dotted rules A ---, *j3 E s, we have C A ~ *~, j, j) E Cearaev The proof of the above lemma is by induction on the number of items added to the chart C.</Paragraph> <Paragraph position="6"> This shows that an item is mapped into a set of items produced by Earley's parser.</Paragraph> <Paragraph position="7"> 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 ~ *a, i, i) (i E \[0, n\]) are not stored separately from the kernel dotted rule which introduced them.</Paragraph> <Paragraph position="8"> 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.</Paragraph> <Paragraph position="9"> Lemma 2 If CA --* a * fl, i,j) E CearZev and if (~ # e, then C s, i,j) e C where s = closure({A ~ a * fl}). The proof of the above lemma is by induction on the number of kernel items added to the chart created by Earley's parser.</Paragraph> <Paragraph position="10"> 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): Lemma 3 The item C A --. a * fl, i, j) E Ceartey if and only if, ST E (VNT U VT)* such that S&quot;~W\]o,i\]XT and X==c, FA=~w\]ij\]A.</Paragraph> <Paragraph position="11"> 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.</Paragraph> </Section> class="xml-element"></Paper>