File Information

File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/concl/91/p91-1014_concl.xml

Size: 3,906 bytes

Last Modified: 2025-10-06 13:56:38

<?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="7" start_page="110" end_page="111" type="concl">
    <SectionTitle>
6 Optimizations
</SectionTitle>
    <Paragraph position="0"> The parser can be easily extended to incorporate standard optimization techniques proposed for predictive parsers.</Paragraph>
    <Paragraph position="1"> 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).</Paragraph>
    <Paragraph position="2"> 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): If s is a state, then closure(s) is now the state constructed from s by the three rules: (i) Initially, every dotted rule in s is added to closure(s); (ii) ifA~ a.Bflisinclosure(s) andB ~ 7is a production, then add the dotted rule B ~ * 7 to closure(s) (if it is not already there); (iii) ifA ~ a.B~ is in closure(s) and ifB=~ e, then add the dotted rule A ~ aB * ~ to closure(s) (if it is not already there).</Paragraph>
    <Paragraph position="3"> Rules (ii) and (iii) are applied until no more new dotted rules can be added to closure(s).</Paragraph>
    <Paragraph position="4"> The rest of the parser remains as before.</Paragraph>
    <Paragraph position="5"> 7 Variants on the basic machine null 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).</Paragraph>
    <Paragraph position="6"> 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.</Paragraph>
    <Paragraph position="7"> 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).</Paragraph>
    <Paragraph position="8"> 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.</Paragraph>
  </Section>
class="xml-element"></Paper>
Download Original XML