This action might not be possible to undo. Are you sure you want to continue?

A Dissertation

Presented to The Faculty of the Graduate School of Arts and Sciences Brandeis University Department of Computer Science James Pustejovsky, Advisor

In Partial Fulﬁllment of the Requirements for the Degree Doctor of Philosophy

by Jos´ M. Casta˜o e n February, 2004

The signed version of this dissertation page is on ﬁle at the Graduate School of Arts and Sciences at Brandeis University. This dissertation, directed and approved by Jos´ M. Casta˜o’s committee, has been accepted and e n approved by the Graduate Faculty of Brandeis University in partial fulﬁllment of the requirements for the degree of:

DOCTOR OF PHILOSOPHY

Adam Jaﬀe, Dean of Arts and Sciences

Dissertation Committee: James Pustejovsky, Dept. of Computer Science, Chair. Martin Cohn, Dept. of Computer Science Timothy J. Hickey, Dept. of Computer Science Aravind K. Joshi, University of Pennsylvania

.

Casta˜o e n 2004 .c Copyright by Jos´ M.

.

Al Campris y su eterna perserverancia. Rodr´ ıguez. A la Pipi y su gran amor. que ser´ en vano a S. Debes amar la arcilla que va en tus manos debes amar su arena hasta la locura y si no. no lo emprendas. vii .

.

I would like to thank Martin Cohn for introducing me to Formal Languages and having always time for me. far away from my initial interests when I arrived at Brandeis. My sincere thanks to Tim Hickey and Ray Jackendoﬀ.Acknowledgments Many people contributed to this work. Ricardo e Rodr´ ıguez. Also many circumstances led me to this unexpected path. Piroska Cs´ri. Roser Saur´ and Bob Knippen. I am extremely grateful to Aravind Joshi for being part of my committee and for his precise comments and suggestions. Many thanks to my Argentinian friends and colleagues. Edward Stabler and Stuart Shieber helped me to ﬁnd a way at the initial stages of this endeavour. in many diﬀerent ways. My family n has a very special dedication. Anna ıa n u Rumshisky. ı I cannot express how grateful I am to my compa˜era Daniela in this and every route. My highest appreciation to those anonymous reviewers who made an eﬀort to understand and comment on my submissions during these years. Mar´ Pi˜ango. It is my belief that every intellectual work is fruit of a community. ix . some I don’t know. Aldo Blanco. Marc Verhagen. I would like to express my gratitude to James Pustejovsky who supported and encouraged me during these years. Pablo Funes. Jos´ Alvarez. my American friend. Alejandro Renato and the extraordinary friends I met at Brandeis. First and foremost. Francesco Rizzo. This work was inﬂuenced by many people. Domingo Medina. Ana Arregui.

.

However there are many problems that cannot be described by context-free languages: “the world is not context-free” [25]. as well as the structural descriptions generated by the corresponding grammars. it might be necessary to deal with the multiple copies language: {ww+ |w ∈ Σ∗ } [29]. xi . One of the hard problems in natural language is coordination. and at the same time has an “extra” context-sensitive descriptive power (e. GIls descriptive power is shown both in terms of the set of string languages included in GILs. as well as an LR-parsing algorithm for the deterministic version of GILs. Finally. There is increasing consensus that modeling certain natural language problems would require more descriptive power than that allowed by context-free languages. semi-linearity. polynomial parsability and semi-linearity. This work takes these ideas as its goal. This thesis presents an abstract family of languages. we discuss in Chapter 6 the relevance of Global Index Languages for natural language phenomena. At the same time there is a special concern to preserve the ‘nice’ properties of context-free languages: for instance. Innumerable formalisms have been proposed to extend the power of context-free grammars. Massachusetts by Jos´ M. In order to model coordination. named Global Index Languages (GILs). This family of languages preserves the desirable properties mentioned above: bounded polynomial parsability. Mildly context-sensitive languages and grammars emerged as a paradigm capable of modeling the requirements of natural languages. An Earley type algorithm to solve the recognition problem is discussed in Chapter 5. One of those problems concerns natural language phenomena.g the “multiple-copies” language is a GI language). We present a two-stack automaton model for GILs and a grammar model (Global Index Grammars) in Chapter 2 and 3. Casta˜o e n Context-free grammars (CFGs) is perhaps the best understood and most applicable part of formal language theory. Then characterization and representation theorems as well as closure properties are also presented. Waltham.ABSTRACT Global Index Languages A dissertation presented to the Faculty of the Graduate School of Arts and Sciences of Brandeis University.

.

. . . .1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Examples of LR-2PDAs . . . . . . . . . . .1. . . . . . . . .1 GILs. . . . . . . . . . . .5. . . . 3. . . . . . . . . . . . . . . . . . . . .3 Comparison with TM. . . . . . . . . . . . . . . . . .1 Deterministic LR-2PDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . . . ﬁnite turn CFGs and Ultralinear GILs . . . .3 GILs and Dyck Languages . . . . . . xiii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . . . . . . .5. . . 2. . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Outline of the Thesis and Description of the . . 2. . . . . . .1 Natural Language . . . . . . . . . . . . . . . . . . . 4 Global Index Languages Properties 4. . . . . .5 Determinism in LR-2PDA . 2. . . . . . . . 2. ix xi xv 1 1 2 4 5 6 9 9 10 12 13 15 17 20 20 21 23 23 24 26 28 32 35 41 41 42 44 46 47 2 Two Stack Push Down Automata 2. .4. . . . . . 2.4 Pumping Lemmas and GILs . . . .3 Semilinearity of GILs and the Constant Growth property 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . . Results . . . . . .2 LR-2PDA with deterministic auxiliary stack . . . . . .2 Closure Properties of GILs . . . .2. . . . . .3 Our proposal . . . . . . . . . .4 Equivalence of GIGs and LR-2PDA . . . . . . . . . . . . . . . . . . . . . 1. . . . . . . 1. . .1 Relations to other families of languages . . .1 Introduction . . . . . . . . . 3.2 Shrinking Two Pushdown Automata . . . .2 Global Index Grammars . . . . . . 2. . . . . .1. . . . . . . . .2 Left Restricted 2 Stack Push Down Automatas (LR-2PDAs) . . . . . . . . . . . . 3. . . . . . . . . . . . . . . . . . 2. . . . . . . 4. . . . . . . . . . . . . . . . . . . . . . . . . . 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Contents vii Acknowledgments Abstract List of Figures 1 Introduction 1.1 EPDA and equivalent 2 Stack Machines . . . . . . . . . . . . . . . . . . . . 1. . . . . . . . . . . . . . . . . . . . . . 3 Global Index Grammars 3. . PDA and LR-2PDA . . . . . . . . . . . . . . . . . .2 Biology and the Language of DNA . . . . .1 trGIGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 GIGs examples . . . . . . . .1. . . . . 2. . . . . . . . . .1 Indexed Grammars and Linear Indexed Grammars 3. . . . . . . . . .1. . . . .2. . . . . . . . . . . . . . . . .1 Automata with two Stacks . . . . . . . . .

. . . . . . . 6. . . . . 5. . . . . . . . . . . . . . . . . . . . . . .2. . . . . . . . . . . .3 Complexity Analysis . 73 . . . . . . . . . . . . . . . 100 . .6 LR parsing for GILs . . . . . . . . . . . 48 5 Recognition and Parsing of GILs 5. . . . . . . . . .1.4. . . .3 GIGs and HPSGs . . . . . . . . . . . . . . .2. . . .1 Future Work . . . . . 6. . . . .5 Implementation . . . . . 79 . . . . . . 5. . . . . . . .1 Linear Indexed Grammars (LIGs) and Global Index Grammars (GIGs) 6. . 5. . . . . . . . . . . . . . . 98 . . . . . . . .2 The Closure Operation. . . . . . . . . . . . . . . . 52 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. . . . . 6. . . . 5.1 Earley Algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 LR items and viable preﬁxes . . . . .1. .3 The Goto Operation. . . . . . . . .1. . . . . . . . . . . . . . . . . . 98 . . . . 5. . . . . . . . . . . . . .2 The palindrome language . . . . . . . 126 xiv . . . . . . . . . . . . . . . . . . . . . . . .3 Reﬁning the Earley Algorithm for GIGs . . . . . . . . . . . . . 52 . . . . . . . . . . 6. . . . . . . . . . . . . . . . . . . 6. . .3 The Copy Language . . . 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. . . . . . . . . . . . . . . . . .2 Parsing Schemata . . . . . . . .1 Control of the derivation in LIGs and GIGs . 53 . 83 . . . . . . . . . . . . .4. 107 107 108 108 110 112 113 115 116 119 6 Applicability of GIGs 6. . . . . . . . . . . . . . .2 GILs Recognition using Earley Algorithm . . . . . . . . . . 5. . . . . .6. . . . . . . . . . . . .2. . . . . . . . . . . .1. . . . . . . .3 Parsing Schemata for GIGs . . . . . . . . . . . 5. . . GILs. . . . 6. . . . . . . . . 5. . . . . . .2. .6. . . . . . . . 57 . . .1. . . . . . . . . . . . . . . .4 Multiple dependencies . . 5. . . .3. . . . . . . . . .4 Proof of the Correctness of the Algorithm . . . . . . . . . . . .5 Crossing dependencies . . . . . . . . . . . . . . . . 5. . . . . . . . . . . . . . . . . . . . . . 7 Conclusions and Future Work 125 7. . . . . .2 Set Inclusion between GIGs and LIGs . . . . . . . . . . . . . . . . . . . . . . 5.1 Graph-structured Stacks . . . . . . . . . . . . . . . . . . 51 . 99 . .2 First approach to an Earley Algorithm for 5. . . . . . . . . . . . . . . .1 Overview . . . . 73 . .4. . . . . . .4 Earley Algorithm for GIGs: ﬁnal version . . . . . . .2 Time and Space Complexity .2. . . . . . . . . . . . . . . . . . 80 . . . . . 81 . .3. 61 . . . . . . . . . .6. . . .1 LIGs in push-Greibach Normal Form . . . 75 . . 6.1 Control Languages . . . 5. . . . .5 Derivation order and Normal Form . . . . . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . . . 51 . . . . . . . . 5. . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .5 Language relations . . . 70 Completer E. . . . . . . . . . . . . . . . .4 6. . . . . . . . . . . . . . . . . . . . . . . . . .4 2.10 5. . . . . . . . . . . . . . . . . . . 62 i A graph structured stack with i and ¯ nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .List of Figures 1. . . . . .1 5. 64 Completer A . . . . . . . . . . .4 5. . . . . . . . . .7 5. . . . . . . . . . . . 58 A predict time graph . . . . . . 68 Completer C . .5 2. .24 6. . . . . . . . . . . . . . . . . . . . . . . . .1 2. 88 Set of States for Gwcw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 5. . . . . . . . . . .2 5. . . . .3 6. . . . . 79 GIG invariant .16 5. . . . . 68 Completer B . . . . . . . .23 5. . . . . . . . . . . . . . . . . .14 5. . . . . . .13 5. .20 5. . .3 5. . . . .9 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Transition diagram for the PDA recognizing the set of valid preﬁxes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 A graph structured stack with i and ¯ nodes . . . . . . . . 8 11 15 15 17 17 18 Two graph-structured stacks . . Another non context-free structural description for the language wwR GIG structural descriptions for the language wwR .6 5. . . . . . . . . . . Multiple agreement in an sLR-2PDA . . . 69 Completer D . . . . . . . . . . LR-2PDA . .12 5. . . .22 5. . . . . . . . 52 Push and Pop moves on the same spine . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dutch Crossed Dependencies (Joshi & Schabes 97) A Turing Machine . . . . . . . . . . . . . . . . . . . . . . . . 60 Paths and reductions in a graph structured stack with i and ¯ nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 A complete steps in the graph . . . 73 Earley CFG invariant . . . . . . . . . . . . . . . . . . . 60 Ambiguity on diﬀerent spines . . . . . . . . . 72 Completer G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Two LIG structural descriptions for the copy language . . . . . . .6 5. . . . . . . . . . . . 81 Path invariant . .18 5. . . . .19 5. . . . sLR-2PDA . . . . . . . . . . . . . .15 5. . . . annotated with indices for the grammar Gwcw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 5. . . . . . . . . . . . . . . . . . . A PDA . . .1 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . last case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 6. A non context-free structural description for the language wwR . . . . . . . . .2 2. . . . . . . . . . . . . . . . . . . . 58 i Push and Pop moves on diﬀerent spines . . . . . . . . . . . . 60 Two alternative graph-structured stacks distinguished by position . . . . . . . . . . . . . . . . .8 5. . . . . . . . . . . . . . . . 63 i I-edges . . . . . . . . . . . . . . . . . . . . . . . . . 108 109 109 110 110 xv . . . . . . . . . . . . . . . . . . 71 Completer F . . . . . . . . . . 102 LIGs: multiple spines (left) and GIGs: leftmost derivation . . . . 59 Two alternative graph-structured stacks .3 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . .21 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 6. . . . . . .15 6. .22 An IG and GIG structural descriptions of the copy language . . . . . . . . . . . . . . . . . . . . . . A GIG structural description for the multiple copy language . . . . . . . . . . . Head-Subject in GIG format . . . . . . . . . . . . . . . . . . . . LIG and GIG structural descriptions of 4 and 3 dependencies A LIG and a GIG structural descriptions of 3 dependencies . .14 6. . . . . . . . . . . . . . . .16 6. . . . . LIGs not in push-GNF II . . . . . . . . . . . . . . . . . . . Left and right recursive equivalence in LIGs. . . . . . . . . . . . . . Head-Comp in GIG format . . . . . . . . . . . . . . . . . . . . . SLASH in GIG format . . .13 6. . . . . . . . . . . . . . . . . .7 6. . LIGs not in push-GNF I . . . . . . . . . . . . . . . . . .10 6. . . . . . . 111 111 112 112 113 113 117 117 118 118 119 120 121 121 122 123 124 xvi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . second case . SLASH and coordination in GIG format . . . . . . . Left and right recursive equivalence in LIGs . . . . . .9 6. . . . . . . . Head-Comps Schema tree representation . .18 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . GIG structural descriptions of 3 dependencies .8 6. . . . . . . . . . . . . .6. . . . . . . . Head-Subject Schema . . . . . . . . . . . . . . . . . . . . . . . .6 6. . . . . . . . . . . . . . . . . . . . . . . . GIG structural descriptions of 4 dependencies . . .20 6. . . . . . . . . . . . . . . . . LIGs not in push-GNF II in GIGs . . . . . . . . . . . . . . . . . . . . . . . . .11 6. . . . .12 6.17 6. . . . . .

polynomial parsability.1 Introduction Context-free grammars (CFGs) constitute perhaps the most developed. semilinearity property.Chapter 1 Introduction 1. at least. However there are many problems that cannot be described by context-free languages. In an automaton model those extensions either use constrained embedded or additional stacks (cf. 81.g. Many formalisms have been proposed to extend the power of context-free grammars using control devices. 1 . closure properties). well understood and most widely applicable part of formal language theory. where the control device is a context-free grammar (see [87] and [26] regarding control languages). In [25] seven situations which cannot be described with a context-free framework are given. The appeal of this approach is that many of the attractive properties of context-free languages are preserved (e. for the following areas: • Natural Language modeling and processing. • Computational Biology • Possibly also relevant to programming languages which might use context sensitive features (like Algol 60). [7. Such a model is relevant. 59]). We try to obtain a model with eﬃcient computation properties. The purpose of this thesis is to explore an alternative formalism with restricted context-sensitivity and computational tractability.

for a level k language the complexity of the recognition problem is a polynomial where the degree of the polynomial is a function of k. INTRODUCTION Such models can be generalized and additional control levels.3 It has been claimed that a NL model must have the following properties:4 1 See 2 The for example [73. and multi-push-down grammars [21]. As a consequence those generalizations provide more expressive power but at a computational cost. Examples of those related hierarchies are: Khabbaz’s [49]. scrambling. in particular related to the so called Mildly-Context Sensitive formalisms.2 CHAPTER 1. Georgian Case and Chinese numbers) might be considered 3 However to be beyond certain mildly context-sensitive formalisms. 23. We will focus in natural language problems from a language theoretic point of view. 4 See for example. multiple context free grammars [71]. 1. 86] and [55. [46. etc.1 Natural Language Regarding natural languages (one of the seven cases mentioned above). The complexity of the recognition problem is dependent on the language level. there is increasing consensus1 on the necessity of formalisms more powerful than CFGs to account certain typical natural languages constructions. 47] on semi-linearity.1. as modeled by {an bm cn dm | n m ≥ 1} Mildly context-sensitive grammars [43] have been proposed as capable of modeling the above mentioned phenomena. Within Mildly-Context Sensitive formalisms we focus on Linear Indexed Grammars (LIGs) and Tree Adjoining Grammars (TAGs) which are weakly equivalent.g. We will exemplify this issue with some properties of natural language and we will consider some biology phenomena. They form hierarchies of levels of languages. leading to languages of the form {ww |w ∈ Σ∗ } – multiple agreements. 29]. following type of languages are also relevant to model molecular biology phenomena [70] there are other phenomena (e. that can be modeled with GILs. where a language of level k properly includes a language of level k − 1. – crossed agreements. {an bn cn dn | n ≥ 1}. corresponding to languages of the form {an bn cn | n ≥ 1}. among others. . Weir’s [87]. In general. or additional stacks can be added. additional levels of embeddedness. These constructions are exempliﬁed as [26]:2 – reduplication.

A lemma for level k of the hierarchy involves “pumping” 2k positions in the string. They have been proven to have recognition algorithms with time complexity O(n6 ) considering the size of the grammar a constant factor ( [67. head grammars (HGs). The equivalent machine model is a nested or embedded push down automata (NPDA or EPDA). Their expressive power regarding multiple agreements is limited to 4 counting dependencies (e. 62]). Tree Adjoining languages belong to the class L2 in Weir’s hierarchy. These formalisms have long been used to account for natural language phenomena. Therefore the following relations follow: The family of level-k languages contains the languages n n {a1 . INTRODUCTION – Constant growth property (or semi-linearity. and the time and space complexity of the recognition problem. its descriptive power.. tree adjoining grammars (TAGs). L = {an bn cn dn |n ≥ 1}). Many diﬀerent proposals for extending the power of LIGs/TAGs have been presented in the recent past. This is reﬂected in the pumping lemma.1.a2 k +1 | n ≥ 0} and {w2 k −1 +1 |w ∈ Σ∗ } . and combinatory categorial grammars (CCGs) which are weakly equivalent.1. and in the machine model allowing another level of embeddedness in the stack. where a CFG controls another CFG.g.. a stronger version of this requirement ) – Polynomial parsability – Limited cross-serial dependencies – Proper inclusion of context-free languages 3 The most restricted mildly context-sensitive grammar formalisms are linear indexed Grammars (LIGs). More expressive power can be gained in a mildly context-sensitive model by increasing the progression of this mechanism: in the grammar model adding another level of grammar control. In such hierarchies there is a correlation between the complexity of the formalism (grammar or automata).a2 k | n ≥ 0} and {w2 k −1 |w ∈ Σ∗ } but does not contain the languages n n {a1 . However... A TAG/LIG is a level-2 control grammar. an increase in descriptive power is correlated with an increase in time and space parsing complexity.. One of the characteristics of mildly context sensitive formalisms is that they can be described by a geometric hierarchy of language classes.

Tree Description Grammars [47] are other such examples. or ordering) the recognition problem is in O(n3 ·2 k −1 ) [86. 38. mutation and rearrangements. 1. 10. Searls [70. 87].4 CHAPTER 1. In this case the complexity of the recognition problem is a bound polynomial: O(n6 ) space and O(n9 ) time [36]. Multivalued Linear Indexed Grammars [63]. However. and the related Literal Movement Grammars (LMGs). Gene regulation.1. Some of those formalisms are: Minimalist grammars [78. recombination. 68] proposes a grammar model to capture the language of DNA. Range Concatenative Grammars [34. He shows that the language of nucleic acids is not regular. 69]). generative grammars have been proposed as models of biological phenomena and the connections between linguistics and biology have been exploited in diﬀerent ways (see [40. Those problems which are beyond context free are: Tandem Repeats (multiple copies). Pseudoknots (crossing dependencies) represented as: Lk = {uv¯R v R }. 66] is another formalism with some mildly context sensitive characteristics. For LMGs the complexity of the recognition problem is O(|G|m(+p)n1 +m+2p ) where p is the arity of the predicates. conformation of macromolecules and the computational analysis of sequence data are problems which have been approached from such a perspective. 54]. There are other formalisms related to mildly context-sensitive languages that are not characterized by a hierarchy of grammar levels. that it is ambiguous and that it is not context-free. gene structure and expression. nor deterministic nor linear. and m the number of terms in the productions. Direct Repeats (the copy language). INTRODUCTION An increase in the language level increases the time (and space) complexity but it still is in P : for a level-k control grammar (or a level-k of stack embeddedness. but their complexity and expressive power is bound to some parameter in the grammar (in other words the expressive power is bound to a parameter of the grammar itself). 12]. Contextual Grammars [52. Contextual Languages do not properly include context-free languages. u ¯ .2 Biology and the Language of DNA Recently. In Coupled Context-Free Grammars the recognition problem is in O(|P | · n3l ) where l is the rank of the grammar [28] and Multiple Context Free Grammars is O(ne ) where e is the degree of the grammar.

1. He proposed String Variable Grammars to model the language of DNA. or interleaved repeats. inverted repeats. Recently Rivas and Eddy [64] proposed an algorithm which is O(n6 ) to predict RNA structure including pseudoknots. The following languages can be generated by a Global Index Grammar: • Lm = {a1 n a2 n . String Variable Languages are a subset of Indexed Languages. however there are many GI languages which do not belong to the set of Linear Indexed Languages . (GILs). b. and they are able to describe those phenomena. dependent branches There are many similarities between Linear Indexed Grammars and Global Index Grammars. • L(Ggenabc ) = {an (bn cn )+ | n ≥ 1} unbounded number of agreements. 1. combinations. which is conjectured not to be an Indexed Language. are characteristic of the language of DNA. k ≥ 2} any number of agreements or dependencies.ak n | n ≥ 1. Probably the work by Searls is the most salient in this ﬁeld.1. We will show that the automaton and grammar model proposed here extends in a natural way the properties of Push Down Automata and context-free languages. which is in time O(n6 ). and proposed a formal grammar [65] corresponding to the language that can be parsed using such an algorithm.1. • L(Gsum ) = { an bm cm dl el f n | n = m + l ≥ 1}..3 Our proposal Unlike mildly context-sensitive grammars and related formalisms.. INTRODUCTION 5 Unbounded number of repeats. • L(Gmix ) = {w|w ∈ {a. c}∗ and |a|w = |b|w = |c|w ≥ 1} The mix language. • L(Gwwn ) = {ww+ |w ∈ {a. However there is no known algorithm that decides the recognition problem for String Variable Languages. which we call Global Index Languages. in the model we present here. We will also show that it is able to describe phenomena relevant both to natural language and biology. b}∗ } unbounded number of copies or repeats (which allows also an unbounded number of crossing dependencies). there is no correlation between the descriptive power (regarding the three phenomena we mentioned) and the time complexity of the recognition problem.

The recognition problem for Global Index Languages (GILs) has a bounded polynomial complexity. We detail the properties of GILs in the following section. This suggests that Linear Indexed Languages might be properly included in the family of Global Index Languages. limited cross-serial dependencies does not hold for GILs. The set of Global Index Languages is an Abstract Family of Languages. We also discuss the structural descriptions generated by GIGs along the lines of Gazdar [29] and Joshi [82. is also presented in Chapter 3. 1. GILs include multiple copies languages and languages with any ﬁnite number of dependencies as well as the MIX language. Therefore GILs have at least three of the four properties required for mild context sensitivity: a) semi-linearity b) polynomial parsability and c) proper inclusion of context free languages. which we call LR-2PDAs in Chapter 2 (a signiﬁcant part of this chapter was published in [18]). a proof of equivalence between the grammar model and the automaton model (the characterization Theorem) and a Chomsky-Sch¨tzenberger representation Theorem are presented in Chapter 3. a property which can be proved following the proof presented in [37] for counter automata. parsing and modeling of natural language phenomena. although no further implications are pursued. In addition. An abstract family of languages (AFL) is a family of languages closed under the following . GILs are also semi-linear. and the family of Global Index Languages (GILs) in Chapter 3. A subset of GIGs (trGIGs). However GIGs can generate structural descriptions where the dependencies are expressed in dependent paths of the tree. We show in Chapter 6 that the relevant structural descriptions that can be generated by LIGs/TAGs can also be generated by a GIG. and there is no correlation between the recognition problem complexity and the expressive power. 44]. The fourth property. In this work we will address three aspects of the problem: language theoretic issues. We present the corresponding grammar model : Global Index Grammars (GIGs). given they contain the MIX (or Bach) language [11]. The initial presentation of Global Index Languages was published in [17]. u In Chapter 4 we discuss some of the closure properties of Global Index Languages and their relationship with other languages.6 CHAPTER 1. INTRODUCTION (LILs).2 Outline of the Thesis and Description of the Results Language Theoretic Aspects (Chapters 2-4) We deﬁne the corresponding Automaton model.

O(|I|3 · |G|2 · n6 ). The time complexity of the algorithm is O(n6 ). OUTLINE OF THE THESIS AND DESCRIPTION OF THE RESULTS 7 six operations: union. Kleene star. Natural Language Modeling (Chapter 6) We present a comparison of LIGs and GIGs (some of these results were presented in [20]). intersection with regular languages. The graph-structured stack enables the computations of a Dyck language over the set of indices and their complements. They are also the basis for non-deterministic approaches. for higher level programming languages or deterministic approaches for shallow parsing in natural language. LIGs. The result. catenation. such as a non-deterministic Generalized LR parsing.2. We also show that GILs are closed under intersection with regular languages and inverse homomorphism (proved by construction with LR-2PDAs). Parsing (Chapter 5) We present a recognition algorithm that extends Earley’s algorithm for CFGs using a graphstructured stack [80] to compute the operations corresponding to the index operations in a GIG. The space complexity is O(n4 ). e-free regular sets.1. but the indexing mechanism could have a higher impact. This is due to the fact that GILs inherit most of CFL properties. We also show that GILs are closed under substitution by e-free CFLs. Tree Adjoining Grammars and Head Grammars are weakly . free morphisms and inverse morphisms. We evaluated the impact of the size of the grammar and the indexing mechanism separately. Combinatory Categorial Grammars. Most of the properties of GILs shown in these chapters are proved using straightforward extensions of CFL proofs. Deterministic LR parsing techniques are relevant. We also give an LR parsing algorithm for for deterministic GILs. e-free homomorphism. for example. shows that the size of the grammar has the same impact as in the CFG case. We show by construction using GIGs that GILs are closed under union. The construction of the Goto function shows an interesting (though not surprising) fact about GILs: the Goto function deﬁnes a PDA that recognizes the set of viable preﬁxes. We also prove that GILs are semi-linear. However it is O(n) for LR or state bound grammars and is O(n3 ) for constant indexing grammars which include a large set of ambiguous indexing grammars. concatenation and Kleene star.

LCFRLs LILs CFLs ww anbncn ww + an(bncn ) + GILs Figure 1. Finally. Our conjecture is that it is. INTRODUCTION equivalent. we disscuss how some properties of HPSGs can be modeled with GIGs (presented in [19].1. so the descriptive power of CFGs regarding by natural language phenomena is inherited by GIGs. LILs/TALs.2. We also show that GIGs can generate trees with dependent paths.8 CHAPTER 1. Other formalisms that might share structural similarities with GIGs could be Minimalist Grammars and Categorial Grammars. The question still to be answered is whether the area with lines in the LILs and LCFR languages set is empty or not. GILs include CFLs by deﬁnition. We discuss the relationship of LIGs with GILs in depth in section 6. and GILs can be represented as in ﬁgure 1. Those natural language phenomena that require an extra power beyond CFLs can be dealt with GILs with much more ﬂexibility than with LILs/TALs.1: Language relations . The set inclusion relation between CFLs. There is a long and fruitful tradition that has used those formalisms for Natural Language modeling and processing.

9 . 21.Chapter 2 Two Stack Push Down Automata 2. or multi-store PDAs as equivalent to n-order EPDA. 59] [21. We need to guarantee that the proposed automaton model does not have the power of a Turing Machine.. Those models restrict the operation of additional stacks (be embedded or ordered) allowing to read or pop the top of an additional stack only if the preceding stacks are empty. Consequently it is possible to simulate the capacity that a TM 1 See [7. Restricted classes of PDA with two stacks (2-PDA) were proposed as equivalent to a second order EPDA1 .[31. and n-Stack PDA..2 It is well known that an unrestricted 2-PDA is equivalent to a Turing Machine (cf.[7. 2 E. The simulation of a TM by a 2-PDA is enabled by the possibility of representing the head position and the tape to the left side of the head in a TM with one stack and the tape to the right side with the second stack. also generalized models of multistacks (e.g. 81. in the sense that it is forced to consume the input from left to right and has a limited capacity to go back from right to left.. (e. The model of 2-PDA that we want to explore here is a model which preserves the main characteristics of a PDA but has a restricted additional storage capacity: allows accessing some limited left context information. 85]. 84]). 84. 9].1 Automata with two Stacks Diﬀerent models of 2-Stack Push Down Automata have been proposed. [41]).g. but behaves like a PDA.g. 83.

sbm .g. “erases” the symbols as they are removed from the stack. and the LR-2-PDA is presented in section 2.3 These constraints force a left to right operation mode on the input in the LR-2PDA. and st1 . In order to simulate these movements in a 2-PDA. 13]). We adopt the following restrictions to the transitions performed by the kind of 2-PDA we propose here: the Main stack behaves like an ordinary PDA stack (allows the same type of transitions that a PDA allows).1 EPDA and equivalent 2 Stack Machines An EPDA. However transitions that push a symbol into the second auxiliary stack do not allow moves. sb2 . the input must be consumed and it must be possible to transfer symbols from one stack to the other.. 3 We might restrict even more the operation of the auxiliary stack disallowing moves that pop symbols from the auxiliary Stack. push/pop on current stack. Its expressive power is beyond PDA (context free grammars) and possibly beyond EPDA (e. It is initiated as a PDA but may create new stacks above and below the current stack. [83.. TAGs). is similar to a PDA. Moving back to the left.1... In the next two subsections we review some models that proposed 2-stack or nested stack automata. st2 .3 we deﬁne the LR-2PDA. Consequently it is possible to “use” the information stored in the auxiliary stack only once. either reading or replacing symbols. except that the push-down store may be a sequence of stacks. st2 . .g. it is not possible to write into the auxiliary stack. they cannot be recovered (unless some more input is consumed). In 2.. . sbm are a ﬁnite number of stacks introduced below the current stack.10 CHAPTER 2. The number of stacks is speciﬁed in each move. TWO STACK PUSH DOWN AUTOMATA has to move from left to right and from right to left. the input might be initially stored in the second stack (e. . Then a transition function looks like (from [45]): δ (input symbol. PDAs. stack symbol)= (new state. . Consequently this would produce a more restricted set of languages. sb2 . A more detailed comparison of TMs. because once the input is consumed. current state. .st1 .. sb1 . 2.. a 2nd order PDA in the progression hierarchy presented in [86].. Alternatively... M’..3.. Given that it is not possible to re-store them again in the auxiliary stack. stn are stacks introduced above the current stack.. stn ) where sb1 ..

so as to separate diﬀerent sub-stacks. 81. AUTOMATA WITH TWO STACKS 11 The possibility of swapping symbols from the top stack to embedded stacks produces the context sensitive power of L2 languages in Weir’s hierarchy. Symbols written in the second stack can be accessed only after the preceding stack is empty.1: Dutch Crossed Dependencies (Joshi & Schabes 97) 2 Stack automata (2-SA) were shown to be equivalent to EPDA [7. 59]. They also require the use of a symbol for the bottom of the stack. they use the additional stack in the same way as the embedded stacks are used in the EPDA.1. to recognize crossed dependencies as in the example depicted in the next ﬁgure: Figure 2. It allows the NPDA. for instance.2. The possible moves for a 2-SA automaton are the following [7]: • Read a symbol from the input tape .

δ. Growing Context Sensitive Languages (deﬁned by a syntactic restriction on context sensitive grammars) and the corresponding model of two pushdown automata (see [24. TWO STACK PUSH DOWN AUTOMATA • push a string onto. ⊥. 16. where • Q is the ﬁnite set of states. Σ. q 0 . 53. F ). The shrinking-TPDA.1. 2. b}∗ }. GCSLs are a proper subclass of CSLs: The Gladkij language {w#wR #w | w ∈ {a. In [16] Buntrock and Otto’s Growing Context Sensitive Languages (GCSLs) are characterized by means of the Shrinking Two Pushdown Automata (sTPDA). The reading/writing restriction is related to the requirement that the preceding stacks be empty. is deﬁned as follows: Deﬁnition 1 a) A TPDA is a 7-tuple M = (Q. The TPDA initializes the input in one of the stacks. n . the main stack • push a string onto the auxiliary stack. • remove bottom of the stack symbols. The kind of automata we present implements a restriction on the writing conditions on the additional stack. or pop a symbol from.12 CHAPTER 2. • pop a symbol from the auxiliary stack provided the main stack contains the bottom of the stack symbol • create a new set of empty stacks (add a string of bottom of the stack symbols). 15. but {an bn cn |n ≥ 1} is a GCSL. b}∗ } belongs to CSL \ GCSLs. and the alternative restriction with respect to writing. The recognition problem for growing context sensitive grammars is NP-complete ( [14]). But this restriction is not related to conditions on the the main stack but to conditions on the input. GCSLs contain the non-context-free and non-semi-linear {a2 |n ≥ 0} [16] The copy language is not a GCSL {ww|w ∈ {a. Γ.2 Shrinking Two Pushdown Automata Recently there has been interest on Church-Rosser Languages. 58]. Wartena [85] shows the equivalence of the concatenation of one-turn multi-pushdown automata restricted with respect to reading (as in the 2-SA case).

Part b) enables transitions that aﬀect the auxiliary stack if and only if an input symbol is consumed (i. the next symbol read and the top symbols of the stacks determine the next move of a LR-2PDA. • F ⊆ Q is the set of ﬁnal (or accepting) states.. i.2. Part c) is a relaxation of the previous one and enables .e. We use a standard notation similar to the one used in [77] or [41]. • Γ is the ﬁnite tape alphabet with Γ • q 0 ∈ Q is the initial state. The deﬁnition of the transition function δ ensures that transitions with epsilon moves are allowed only if they do not push a symbol into the auxiliary stack.2 Left Restricted 2 Stack Push Down Automatas (LR2PDAs) We deﬁne here the model of automaton that we described and proposed at the beginning of this section.e. The current state. 2.2. if it is not ). and • d : Q × Γ × Γ → P(Q × Γ∗ × Γ∗ ) Σ and Γ ∩ Q = ∅ 13 It can be seen that this kind of automaton needs some restriction. a. v) ∈ (δ. LEFT RESTRICTED 2 STACK PUSH DOWN AUTOMATAS (LR-2PDAS) • Σ is the ﬁnite input alphabet. only if they are equivalent to a PDA transition function. causing the machine to move without reading a symbol from the input or from the stacks. • ⊥ ∈ Γ \ Σ is the bottom marker of pushdown store. b ∈ Γ if (p. otherwise it is equivalent to a TM. Part a) in the deﬁnition of the transition function is equivalent to a PDA. We can consider the automaton model we present in the next section as preserving a shrinking property that conditions the use of the additional stack: it has to consume input. b) A TPDA is M is called shrinking if there exists a weight function φ : Q ∪ Γ → N+ such that for all q ∈ Q and a. Either of these symbols may be . u. and the requirement that every move must be weight reducing [57]. b) then φ(puv) < φ(qab). The restriction is implemented using a weight function over the automaton conﬁguration.

can be conﬂated in: a’. Q × (Σ ∪ { }) × Γ × Γ → P F (Q × Γ∗ × { }) . Σ. If part c) is removed from the deﬁnition a diﬀerent class of automata is deﬁned: we will call it sLR-2PDA. but this would rule out reduplication (copy) languages (See the introduction) as we will see below. δ. q 0 . Σ is the input alphabet. Γ. 4. F ) where Q. Q is the set of states. Q × Σ × Γ × Γ → P F (Q × Γ∗ × Γ2 ) c. and c. Γ. TWO STACK PUSH DOWN AUTOMATA -moves that pop elements from the second stack. and Γ is Γ ∪ { } ) : a. Q × (Σ ∪ { }) × Γ × Γ → P F (Q × Γ∗ × { })4 5. Q × (Σ ∪ { }) × Γ × { } → P F (Q × Γ∗ × { }) and b. The set of languages that can be recognized by a sLR-2PDA is therefore a proper subset of the set of languages that can be recognized by a LR-2PDA. Q × (Σ ∪ { }) × Γ × { } → P F (Q × Γ∗ × { }) and 4 The two transition types a. ⊥. Γ is the stacks alphabet. Such a restriction could be accomplished in the sLR-2PDA case because the auxiliary stack cannot be emptied using -moves. ⊥ ∈ Γ \ Σ is the bottom marker of the stacks 7. and F are all ﬁnite sets and 1. F ⊆ Q is the set of accept states. q 0 ∈ Q is the start state 6. Deﬁnition 3 A sLR-2PDA is a LR-2PDA where δ is: a. Deﬁnition 2 A LR-2PDA is a 7-tuple (Q.14 CHAPTER 2. 2. 3. δ is the transition function ( where P F denotes a ﬁnite power set. We keep them separate to show the parallelism with the type of productions in the grammar model. For Natural Language purposes it might be desirable to keep stronger restrictions on the auxiliary stack. . Σ. The auxiliary stack should be emptied only consuming input.

q 0 . whatever remains at the right is forgotten). but it cannot recognize Lc = {ww | w ∈ Σ∗ } which would require additional use of the storage capacity. ⊥) (Acceptance by empty stacks) (p. q 0 . from left to right. δ. PDA AND LR-2PDA b. PDA and LR-2PDA A Turing Machine: the input tape is also a storage tape. then (q. plus it has an unlimited work-space. ⊥. There is a work space (storage data structure) that also can be transversed only once (as soon there is a move to the left. a. Σ. Writes left to right or same cell Independent operation: allows e-moves Moves to the left erasing. They specify the current input. δ. The input can be transversed as many times as desired. state and stack contents. Read and Write one cell One head Figure 2. Z. ηβ) if δ(q. ⊥. A clear example of maximum transversal and input storage is the language Lr = {wwR | w ∈ Σ∗ } which can be recognized by a PDA. ⊥. An ID is a 4-tuple (q. ∗ is denoted by ∗ The language ac- cepted by a LR-2PDA M = (Q. w. aw. ⊥. If M = (Q. COMPARISON WITH TM.3. F ) is a LR-2PDA. 2. Q × Σ × Γ × Γ → P F (Q × Γ∗ × Γ∗ ) 15 The instantaneous descriptions (IDs) of a LR-2PDA describe its conﬁguration at a given moment.3 Comparison with TM.2. γ 1 . ζα. η). Reads left to right only. Zα. It has the capacity of remembering a sequence of symbols and matching it with another equal length sequence. ζ. Figure 2. that can be also used and reused at any time. γ 2 are strings of stack symbols. The reﬂexive and transitive closure of M M (p. w. Oβ) contains (p. O) M. . Γ. w. ⊥)} for some p in F . F ) is {w | (q 0 . Γ.2: A Turing Machine A PDA: The input can be transversed only once. γ 2 ) where q is a state w is a string of input symbols and γ 1 . Σ.3: A PDA .

4. . In order to avoid the possibility of transferring symbols from one stack to the other indeﬁnitely. then the possibility of storing information from the input seen at this move is lost. (q 1 . a. and store the symbols of the second copy back A loop back from state q 3 to state q 2 allows recognition of the language of any ﬁnite number of copies (example 2). a. However. . . ) (transfer symbols from auxiliary to main stack) 3. given the constraints imposed on LR-2PDAs. whatever remains at the right is forgotten). A sLR-2PDA cannot recognize the copy language: if the auxiliary stack is used to store all the symbols of the input tape then it would be of no more use than storing all the symbols in the main stack: the symbols can only be transferred from the auxiliary stack to the main stack only if the input tape is being read. consequently what is being read cannot be stored in the main or the auxiliary stack if there is a transferral occurring. TWO STACK PUSH DOWN AUTOMATA A LR-2PDA: The input can be transversed only once. . but it can store again in the second stack (the second copy). the second storage can be written to only when consuming input. While recognizing the second copy all the information stored about the ﬁrst copy is lost. Transfer from one stack to the other is restricted. an LR-PDA can recognize the language L3 = {www | w ∈ Σ∗ }. 1. . The corresponding machine is detailed below in the exsection 2. This exempliﬁes how many times (and the directions in which) the same substring can be transversed. a LR-2PDA is not able to transverse a substring indeﬁnitely. a) = (q 2 . a. u) = (q 3 . Consider the following transitions (where a is a symbol in Σ). a.16 CHAPTER 2. The crucial fact is that transitions type c. if information from the ﬁrst ordered stack is transferred to the second auxiliary stack. This capacity is reduced even further in the case of sLR-2PDA: both types of operations on the auxiliary stack are made dependent on consuming input. (q 3 . au) (recognize the second copy using the symbols stored in the main stack. (above) . from left to right. There are two work- spaces which also can be transversed only once (as soon there is a move to the left. The following languages which can be recognized by an LR-2PDA are examples of a maximum use of the storage of the input: L2ra = {wwR wR w | w ∈ Σ∗ } and L2rb = {wwR wwR | w ∈ Σ∗ }. (q 2 . but unlike a TM. a) (store the symbols of the ﬁrst copy) 2. ) = (q 1 .

Moves to the left erasing. δ. b. {a. w ∈ Σ∗ and |w| ≤ |u|} is recognized by a sLR-2PDA. Independent moving. Writes left to right or same cell Independent both operations. M 5 = ({q 0 . However the language L = {wuw | u. Transfer possible Dependent writing from 1. Figure 2. q 1 .5: sLR-2PDA 2. {x}. q 0 . c. Examples 2 and 3 are LR-2PDAs. q 3 ) where δ: . Moves to the left erasing. q 3 }. 17 Writes left to right or same cell Moves to the left erasing. Independent both operations. e}.2.4 Examples of LR-2PDAs The ﬁrst example is a sLR-2PDA. EXAMPLES OF LR-2PDAS Reads left to right only.4: LR-2PDA are not allowed. Writes left to right or same cell Moves to the left erasing. Reads left to right only. d. ⊥. Dependent moving (erasing) Figure 2. Example 1 (Multiple Agreements) .4. q 2 . Writes left to right or same cell Transfer NOT possible Dependent writing from 1.

$. $) ( d . c . x) = {(q 1 . ε ) = ( ε. δ(q 2 . ). $ . b. δ(q 1 . $ . δ(q 1 . δ(q 1 . x) = {(q 2 . δ(q 2 . $ ) = (ε . x⊥)} 4. c. e. x) = {(q 2 . δ(q 0 . $ . ⊥) = {(q 1 .a. $ . ε ) ( [] . ⊥. ε ) = (aa. δ(q 1 . . x) = {(q 2 . ε ) ( [] . ⊥. x) = {(q 2 . .a’) = (c$.. xx} 9.. c . c’c’) ( e . ⊥. )} 10. x) = {(q 1 . ⊥)} 12. c .6: Multiple agreement in an sLR-2PDA 1. where k > 3. x) = {(q 1 . a’ ) = ( ε. x⊥. ⊥) = {(q 2 . (q 2 . ⊥. $ . c . x.. (q 1 . ⊥) = {(q 1 . . ε ) (b.a’) = (cc.an | n ≥ 1} 1 2 k . $) = ( ε. ⊥. c .a.$. ⊥) = {(q 1 . c’) = ( ε. e. x. ε ) 4 ( d . x. δ(q 1 . d. ε) = (a$. ⊥)} 8. ⊥. δ(q 1 . x. ⊥. ε ) 3 ( [] . c. δ(q 1 . TWO STACK PUSH DOWN AUTOMATA Four Counting Dependencies M2 Five Counting dependencies M3 (a. $ . c’$) 4 4 ( d . $) = accept 5 5 ( e. ⊥) = {(q 1 . ak }. there is an sLR-2PDA that recognizes the language L(M k ) = {an an . c.. δ(q 2 .. c’) = ( $ .a’) = ($.a’a’) (c. . x. a. c’) = ( $ . x. . . ε) ( d . ⊥)} 2. xx. $) = accept 6 Figure 2.$.a’) = ($. a. ⊥. xx}) 5. d. ⊥. ⊥)} 3.a. ε ) Idem 3 (c. x⊥. )} 11. d. )} L(M 5 ) = {an bn cn | n ≥ 1} ∪ {an bn cn dn | n ≥ 1} ∪ {an bn cn dn en | n ≥ 1} It can be easily seen that the following is a proper generalization: Claim 1 For any alphabet Σ = {a1 . δ(q 1 . x⊥).18 Three counting dependencies M1 0 CHAPTER 2. )} 6. ε ) (c. $) = accept (c. $) = ( ε.a’$) Idem 2 (b. b. )} 7. . xx. x. ε ) 1 (a.

a2 ) = {(q 1 . Example 2 (The language of multiple copies) M wwn = ({q 0 . δ(q 1 . (q 3 . x⊥)} 2. x) = {(q 2 . transitions 9 to 12 recognize either the following copy or the last copy. ⊥) = {(q 1 . b. ⊥. δ(q 1 . ao ⊥. .2. {a. q 1 . ae−1 . ⊥) = {(q 1 . ao . . y. b}. ⊥. δ(q 3 . ⊥. ⊥) = {(q 2 . yu). δ(q 1 . δ(q 1 .4. q 2 }. ao−1 ) = {(q 1 . )} L(M 4 ) = {ww+ |w ∈ {a. ae−1 . ae ) = {(q 1 . y) = {(q 2 . Σ. δ(q 3 . ⊥. ao . ⊥. ak −1 ) = {(q 2 . . ⊥) = {(q 1 . δ(q 0 . ae ae } and 9. ao . δ(q 0 . q 2 ) where δ is as follows. )} 7. δ(q 1 . q 1 . q 2 . ⊥. x) = {(q 2 . ae ⊥)} 8. ⊥. . such that o. ao−1 ) = {(q 1 . . ak −1 . a1 . w. (q 3 . ⊥. a. a. ⊥)} 10. x⊥. δ(q 1 . )} . )} 14. x⊥). δ(q 3 . )} if k is odd or 10. ao ao . b. ⊥)} 11. ak . ⊥) = {(q 1 . . ⊥. a2 . w. δ. e ≥ 3 < k and o is odd and e is even: 1. ak . ⊥. δ. δ(q 2 . x) = {(q 2 . transitions 1 to 4 recognize the ﬁrst occurrence of w. δ(q 0 . ⊥. )} 6. ⊥)} if k is even. δ(q 2 . )} 6. q 0 . ae . a1 . . y⊥. EXAMPLES OF LR-2PDAS Proof Construct the sLR-2PDA M k as follows: 19 M k = ({q 0 . a. ⊥)} 2. . . x. . ⊥)} 12. . δ(q 1 . reverse the order of the stored symbols. transitions 5 to 8. δ(q 1 . δ(q 2 . yw. ⊥)} 13. a2 ⊥)} 4. ⊥) = {(q 3 . a1 . δ(q 3 .t. δ(q 1 . . u) = {(q 3 . xu)} 4. δ(q 1 . ⊥. a1 ⊥. y) = {(q 2 . . y⊥)} 3. xw. u) = {(q 1 . ⊥) = {(q 3 . ⊥. (q 3 . . . . ⊥. )} 7. a2 a2 }) 5. . δ(q 1 . y⊥. ⊥) = {(q 1 . ⊥) = {(q 1 . b}+ } 8. b. y}. u) = {(q 1 . u is any symbol in the vocabulary): 1. ⊥. {x. δ(q 1 . ⊥. q 3 ) where δ (s. xu). δ(q 2 . y⊥). If an intermediate copy is recognized transitions 13 and 14 allow going back to state 2 and reverse the order of the stored symbols. b. y. a1 . )} 9. yu)} 5. δ(q 1 . ⊥. a1 a1 . ⊥. a2 . q 0 . ae . ⊥)} 3. Σ. x⊥. . In the next example. a. a1 . q 3 }. u) = {(q 3 . (q 3 . . y) = {(q 2 . x.

b. d. for each q ∈ Q and Z. d. x. δ. y) = {(q 1 . z) = {(q 1 . y) = {(q 1 . The corresponding deﬁnition of a deterministic LR-2PDA is as follows: 2. x⊥)} 2. ⊥. δ(q 3 . z) = {(q 2 . δ(q 2 . c. δ(q 0 . z. ⊥) = {(q 3 . y) = {(q 1 . f }. )} 13. c. ) is nonempty. δ(q 1 . . ⊥. ⊥. ⊥. I ∈ Γ. ⊥) = {(q 3 . 3. y. I) contain more than one element. z. . zz. and a ∈ Σ ∪ { } does δ(q. Z. a. z) = {(q 1 . f. .1 Deterministic LR-2PDA Deﬁnition 4 A LR-2PDA is deterministic iﬀ: 1. b. TWO STACK PUSH DOWN AUTOMATA Example 3 (Crossed dependencies) M cr3 = ({q 0 . d. Deterministic GILs are recognized in linear time as we mentioned in the introduction. . )} 8. whenever δ(q. ⊥)} 5. I) is empty for all a ∈ Σ. Z. δ(q 3 . ⊥. I ∈ Γ. ⊥) = {(q 3 . y. ⊥)} 15. {x. . m. ⊥) = {(q 3 . Z. . {a. zy)} 6. yy. δ(q 1 . e. q 3 ) where δ: 1. δ(q 1 . ⊥. q 2 . zz)} 7. for each q ∈ Q. e. δ(q 1 .5. ⊥. xy. ⊥. a. x) = {(q 1 . ⊥. δ(q 3 . yx)} 4. ⊥. . y. then δ(q. 2. . ⊥) = {(q 1 . . y) = {(q 1 . ⊥. c. z}. a. δ(q 2 . for no q ∈ Q. ⊥. z⊥. Therefore understanding the deterministic LR-2PDA is crucial for obtaining a deterministic LR parser for GILs deﬁned in chapter 6. )} 11. ⊥. δ(q 1 . A. δ(q 2 . yy)} 12. x) = {(q 1 . q 1 .5 Determinism in LR-2PDA An LR parser for a CFL is essentially a compiler that converts an LR CFG into a DPDA automata [41. 2]. x. then δ(q. δ(q 2 . Z. y. . . xx)} 3. Z.20 CHAPTER 2. I ∈ Γ. x) = {(q 1 . ⊥. Z. z. )} 10. δ(q 2 . yz. )} L(M cr3 = {a b c d e f | n. q 0 . whenever δ(q. b. q 3 }. ⊥)} 2. ⊥)} 14. I) is empty for all I ∈ Γ. δ(q 1 . A. a. A ∈ Σ and Z. l ≥ 1} n m l n m l 9. I) is nonempty.

for no q ∈ Q. Z. for each q ∈ Q and Z. j) = (q. Deﬁnition 5 A LR-2PDA has a deterministic indexing. in the following examples of transitions. a. Condition 3 prevents the possibility of a choice between a move independent of the second stack symbol ( -move) and one involving a symbol from the stack. Z i . If the non-determinism is in the CFG backbone only we can guarantee that the recognition problem is in O(n3 ). A. and a ∈ Σ ∪ { } does δ(q. then δ(q. a. Therefore. Z.2. I ∈ Γ. a. . i) 3. . A ∈ Σ and Z. whenever δ(q. We can regard to be an abbreviation for all the possible symbols in the top of the stack. a. i) = (q. Z j . b. I) is empty for all I ∈ Γ. I j ) such that I i = I j . . (q.2 LR-2PDA with deterministic auxiliary stack Even if a GIG grammar is non-deterministic. DETERMINISM IN LR-2PDA 21 Condition 1 prevents the possibility of a choice between a move independent of the input symbol ( -move) and one involving an input symbol. I) contain two elements = (q i . ) = (q. 2. whenever δ(q. . Z. . ) is nonempty.5. ) = (q. I ∈ Γ. because they imply a non-deterministic choice. (q. . A. Z. nor with the fourth. then δ(q. a. . . I ∈ Γ. . Condition 2 prevents the choice of move for any equal 4-tuple. I i ) and (q j . 3. . (q. ) 2. or is a deterministic indexing LR-2PDA if and only if: 1. Z. 1. the ﬁrst case is not compatible with the third.5. I) is nonempty. The construction of the LR(k) parsing tables would show whether the indexing mechanism for a given GIG is non-deterministic. j) 4. j) 2. (q. Z. it might be an advantage to be able to determine whether the non-determinism lies in the CFG back-bone only and the indexing mechanism does not introduce non-determinism. for each q ∈ Q. I) is empty for all a ∈ Σ.

TWO STACK PUSH DOWN AUTOMATA .22 CHAPTER 2.

P. and α is in (V ∪ T )∗ .] represents a stack of indices. ⇒... The relation derives. (IGs) [1]. i is in I .e. [. Let β and γ be in (V I ∗ ∪ T )∗ . I. A → α b. have the capability to associate stacks of indices with symbols in the grammar rules.] → B[i. S). i. IGs are not semi-linear (the class of ILs contains the language {a2 | n ≥ 0}). As a consequence they are semi-linear and belong to the class of MCSGs.]α n where A and B are in V . is deﬁned as follows. 23 .Chapter 3 Global Index Grammars 3. a string in I ∗ .LILs) [29]. LIGs are Indexed Grammars with an additional constraint on the form of the productions: the stack of indices can be “transmitted” only to one non-terminal. where N is the set of non-terminal symbols.] c. T the set of terminals.] → [. and X i in V ∪ T . strings in (V I ∗ ∪ T )∗ . and P is a ﬁnite set of productions of the form: a. An Indexed Grammar is a 5-tuple (N. (LIGs. δ be in I ∗ .. and Linear Index Grammars. A[i. T. A[.. I the set of indices. on sentential forms. The class of LILs contains L4 but not L5 (see Chapter 1).1 Indexed Grammars and Linear Indexed Grammars Indexed grammars... S in V is the start symbol.

...]c. A[..] → α B[...X k is a production of type a.. c..] → B[.. {a}..] γ Example 5 L(G1 ) = {an bn cn dn |n ≥ 0}.. P.].] → A[... The introduction of indices in the derivation is restricted to rules that have terminals in the right-hand side..] → bB[..] → αB[i. A[i. 2.. B}..] γ c.. G1 = ({S.] X 1 .. The proposal we present here uses the stack of indices as a unique designated global control structure... This feature makes the use .] A[] → a A Linear Indexed Grammar is an Indexed Grammar where the set of productions have the following form. If A[... {a. d}.] γ b.X k δ k γwhere δ i = δ if X i is in V and δ i = n if X i is in T.] A[..24 CHAPTER 3.] → A[. these grammars provide a global but restricted context that can be updated at any local point in the derivation.. S[.. It is a grammar that controls the derivation through the variables of a CFG..] → S[i..]A → [.2 Global Index Grammars In the IG or LIG case.] → aS[i. P. B[ ] → 3. GLOBAL INDEX GRAMMARS 1.. b. S). where P is: S[.] A[i. In this sense. B[i.]d.] A[.] → α B[. If A → X 1 ..]. {i}. then βAδγ ⇒ βBxδγ 3. then βAδγ ⇒ βX 1 δ 1 . then βAxδγ ⇒ βX 1 δ 1 . S) where P : S[.] is a production of type b.X k δ k γ where δ i = δ if X i is in V and δ i = if X i is in T. S[. the stack of indices is associated with variables. A[.. {i}.X k is a is a production of type c.] → B[x. A}. where A and B are non terminals and α and γ are (possible empty) sequences of terminals and non terminals: a. G1 = ({S.. GIGs are a kind of regulated rewriting mechanism [25] with global context and history of the derivation (or ordered derivation) as the main characteristics of its regulating device. Example 4 L(G1 ) = {a2 n ≥ 0}. If [x.

A → α x ¯ Note the diﬀerence between push (type b) and pop rules (type c): push rules require the righthand side of the rule to contain a terminal in the ﬁrst position.. Pop rules do not require a terminal at all. so we can consider them global.]a β [x.. Derivations in a GIG are similar to those in a CFG except that it is possible to modify a string of indices.]A → [. I are ﬁnite pairwise disjoint sets and 1) N are non-terminals 2) T are terminals 3) I a set of stack indices 4) S ∈ N is the start symbol 5) # is the start stack symbol (not in I. The constraint on push rules is a crucial property of GIGs. in a linguistic sense.N . A → a β x c. .X k γ) (production type a. y ∈ {I ∪ #}..]α (epsilon rules or context free (CF) rules ) (epsilon rules or CF with constraints) (push rules or opening parenthesis) (pop rules or closing parenthesis) b.1 where x ∈ I. having the following form.]A → [.1 or context free ) xδ#βAγ ⇒ xδ#βX 1 . A ∈ N .]α [.X k is a production of type a. In the next subsection we present an even more restricted type of GIG that requires both push and pop rules in Greibach Normal Form. (i. #. I. Let β and γ be in (N ∪ T )∗ .2) [x] 1 The notation at the left makes explicit that operation on the stack is associated to the production and not to terminals or non-terminals. It also makes explicit that the operations are associated to the computation of a Dyck language (using such notation as used in e.T ) and 6) P is a ﬁnite set of productions. a.....]A → [x. GLOBAL INDEX GRAMMARS 25 of indices dependent on lexical information.. The notation at the right is intended to be more similar to the notation used in IGs and LIGs. T.g. α.. [39]). P ) where N.2 A → α [y] or or or or A→α [. which are strings in I ∗ #(N ∪ T )∗ as follows. x ∈ I) then: δ#βAγ ⇒ δ#βX 1 . µ = µ or µ = [x].. We deﬁne the derives relation ⇒ on sentential forms. 1. x in I.2.e.X k γ (production type a....1 A → α a. without it GIGs would be equivalent to a Turing Machine. S. δ be in I ∗ .X k γ Using a diﬀerent notation: δ#βAγ ⇒ δ#βX 1 . Deﬁnition 6 A GIG is a 6-tuple G = (N. and allows the kind of recognition algorithm we propose in Chapter 5. An additional constraint imposed on GIGs is strict leftmost derivation whenever indices are introduced or removed by the derivation. This string of indices is not associated with variables. If A → X 1 . T.. w be in T ∗ and X i in (N ∪ T ).3. β ∈ (N ∪ T )∗ and a ∈ T .

. In LIGs indices are associated with only one non-terminal at the right-hand side of the rule. The derives deﬁnition requires a leftmost derivation for those rules (push and pop rules) that aﬀect the stack of indices. where x ∈ I.. is the interpretation of the derives relation relative to the behavior of the stack of indices..X n γ ( or xδ#wAγ ⇒ δ#wX 1 .) or push: µ = x..b) (in other words push productions must be in Greibach Normal Form).. If A → X 1 .) or pop : µ = x... with the consequence that LILs are semilinear. In IGs the stacks of indices are distributed over the non-terminals on the right-hand side of the rule... Deﬁnition 7 A trGIG is a GIG where the set of production of types (c) (pop) rules. If A → aX 1 . IGs.. GLOBAL INDEX GRAMMARS This is equivalent to a CFG derives relation in the sense that it does not aﬀect the stack of indices (push and pop rules).X n γ ) x 3. and a ∈ T : c. x ∈ I. α. the stack of indices in a GIG is independent of non-terminals in the GIG case. x ∈ I. GIGs share this uniqueness of the stack with LIGs.. x ∈ I. then: µ δ#wAγ ⇒ xδ#waX k . LIGs and GIGs.X n γ µ ( or δ#wAγ ⇒ xδ#waX 1 .. A ∈ N . A → a β x ¯ or [x. Indeed push rules (type b) are constrained to start the right-hand side with a terminal as speciﬁed in GIG’s deﬁnition (6. We also introduce some examples of trGIGs modeling multiple agreements and crossed dependencies.] a β .2.) rules in GIGs.. 2.X n is a production of type (b.. but to an extreme: there is only one stack to be considered. We deﬁne the language of a GIG G.. GIGs can have rules where the right-hand side of the rule is composed only of terminals and aﬀects the stack of indices. are as follows. ∗ 3. This produces the eﬀect that there is only one stack aﬀected at each derivation step. then: ¯ xδ#wAγ ⇒ δ#wX 1 .26 CHAPTER 3.]A → [. β ∈ (N ∪ T )∗ .X n is a production of type (c. Unlike LIGs and IGs..) are constrained to start with a terminal in a similar way as push (type b. L(G) to be: {w|#S ⇒ #w and w is in T ∗ } It can be observed that the main diﬀerence between.1 trGIGS We now deﬁne trGIGs as GIGs where the pop rules (type c.X n γ ) x ¯ ∗ The reﬂexive and transitive closure of ⇒ is denoted as usual by ⇒..

and P is composed by: 1.E i → ai E i ai ai−1 ¯ 2. E}.. C}. P ) and P is: S → ACE C → cD ¯ i 27 A → aAb i A → ab i ¯ j ¯ j C → cD1 ¯ i D1 → CD D→d j E → eE E→e The derivation of w = aabbccddee: #S ⇒ #ACE ⇒ i#aAbCE ⇒ ii#aabbCE ⇒ i#aabbcD1 E ⇒ i#aabbcCDE ⇒ #aabbccDDE ⇒ j#aabbccdDE ⇒ jj#aabbccddE ⇒ j#aabbccddeE ⇒ #aabbccddee Example 7 (crossing dependencies) L(Gcr ) = {an bm cn dm | n.. {a1 . b. . #.. {a. E 2 .. S → A D 2. A. g }. c}. d}. d. B. {i}. . Oi → ai E i+1 If k is even add: If k is odd add: n n 3b. b. Ak }. Oi → ai Oi E i+1 ai−1 ¯ 6a. L}. P ) such that k ≥ 4 and j = k if k is even or j = k − 1 if k is odd.. 4 ≤ k} We can generalize the same mechanism even further as follows: Example 8 (Multiple dependencies) L(Ggdp ) = { an (bn cn )+ | n ≥ 1}. c.. .. {a . a j }. S→ a1 E 2 4a. E..Ak → ak Ak 5b.2. D. Ak → ak Ak ak −1 ¯ n 4b. O. m ≥ 1}. k ≥ 4} is in trGIL 1 2 k Proof Construct the GIG grammar Gk = ({S. {a. {a. #.ak | n ≥ 1..3. #. a 4 . Ggdp = ({S. O3 .. ak }. D → d D | d x ¯ Now we generalize example 6 and show how to construct a trGIG that recognizes any ﬁnite number of dependencies (similar to the LR-2PDA automaton presented in the previous chapter): Claim 2 The language Lm = {an an . G5 = ({S. P ) and P is: S → AR L → OR | C A → aAE ¯ i A→a ¯ i E→b i R→bL i C→cC|c O → c OE | c .. S. where Gc r = ({S. Ak → ak 6b. A → a A c | a B c 3. B → b B | b x 4. GLOBAL INDEX GRAMMARS Example 6 (multiple agreements) L(G5 ) = {an bn cn dn en | n ≥ 1}. Ok → ak ak −1 ¯ L(Gn ) = {a1 a2 . A. {a 2 . b.an | n ≥ 1. R. C. c.. {x and P is: 1. E i → ai Oi+1 ai and for every E i and Oi such that i is odd in Oi and i is even in E i add the following rules: 5a. S.. S → a1 S E 2 3a. D1 . S. e}. A.

P ) and P = 1. It is easy to see that by generalizing the same mechanism any ﬁnite number of crossing dependencies can be generated. S. {a. S. j}. R → Ra | a ¯ i 5.2. {a. {a. R. Above. A. R → Rb | b ¯ j The derivation of the string abbabb: #S ⇒ i#aS ⇒ ji#abS ⇒ jji#abbS ⇒ ji#abbRb ⇒ i#abbRbb ⇒ #abbRabb ⇒ #abbabb Example 10 (Multiple Copies) L(Gwwn ) = {ww+ | w ∈ {a.2 GIGs examples We conjecture that the following languages can be deﬁned with a GIG and cannot be deﬁned using a trGIG. {i. j. #. C. {i. c.28 CHAPTER 3. we can see that by using left recursive pop productions we can generate a language with a higher number of crossing dependencies than we can by using a trGIG. f }. S → R 4. j}. P ) and P = . L. b. S. we mentioned the diﬀerence between push and pop rules in GIGs. B. b}. e. C}. This diﬀerence enables the use of left recursive pop rules so that the order of the derivation is a mirror image of the left-right order of the input string. {i. F. GLOBAL INDEX GRAMMARS The derivation of the string aabbccbbcc shows ﬁve dependencies. S → bS j 3. #. b}∗ } Gww = ({S. B. This is not possible in trGIGs because pop rules cannot be left recursive. b}∗ } Gwwn = ({S. b}. Example 11 (Crossing Dependencies) L(Gcr3 ) = {an bm cl dn em f l } Gcr3 = ({S. #. E}. d. Example 9 (Copy Language) L(Gww ) = {ww |w ∈ {a. k}. P ) and P = S → AS | BS | C B→b j ¯ i C → RC | L L → Lb | b ¯ j R → RA ¯ i R → RB ¯ j R→ [#] A→a i L → La | a The derivation of ababab: #S ⇒ #AS ⇒ i#aS ⇒ i#aBS ⇒ ji#abS ⇒ ji#abC ⇒ ji#abRC ⇒ i#abRBC ⇒ #abRABC ⇒ #abABC ⇒ i#abaBC ⇒ ji#ababS ⇒ ji#ababL ⇒ i#ababLb ⇒ #ababab In the next example. R}. #S ⇒ #AR ⇒ #aAER ⇒ #aaER ⇒ i#aabR ⇒ ii#aabbL ⇒ ii#aabbOR ⇒ i#aabbcOER ⇒ #aabbccER ⇒ i#aabbccbRii#aabbccbbL ⇒ ii#aabbccbbC ⇒ i#aabbccbbcC ⇒ #aabbccbbcc 3. S → aS i 2. D.

[11] ). c}. P ) and P is: S → cS i ¯ i ¯ j S → bS j S → aS k S → SaSbS | SbSaS S → SaScS | ScSaS S → SbScS | ScSbS ¯ k S→ L(Gmix ) = Lmix = {w|w ∈ {a. There are also factorial duplicates for the number of times a character occurs in the string. however it is not so easy to prove or assess whether the 2 A. The diﬃculty is due to the number of strings in the language at the basic combination level (there are 90 strings of length 6. and 1680 strings of length 9). j. {a. Joshi p. {i. and the need to ensure that the three dependencies (between a’s. b.2. D → Dd | d This can be even further generalized. B → bB | bC j ¯ i 2. obtaining sets of crossing dependencies. It allows an incredible number of possible strings of any given length in the language. S → F L ¯ k 29 3. k}. GLOBAL INDEX GRAMMARS 1. This is important because it is very diﬃcult to build a proof for the claim that the MIX language belongs (or does not belong to) to a family of languages 2 . . S. L → Lf | Ef 6. This language though conceptually simple. We show that GILs are semilinear. The number of strings of length 3n is (3n)!/(n!)3 .c. b’s and c’s) are observed. F → aF | aB i ¯ j 4. C → cC | c k 5. E → Ee | De 7. and at the same time it requires that three dependencies be observed. turns out to be a very challenging problem. therefore ILs and GILs could be incomparable under set inclusion. Example 12 (MIX language) Gmix = ({S}. In the mix language each character occurs in one third of the string and there are three characters. as exempliﬁed by Lmcr = {an bm cl dn em f l g n hm il } or {an bm cl (dn em f l )+ } The next example shows the MIX (or Bach) language (the language with equal number of a’s b’s and c’s in any order. #.g. c}∗ and |a|w = |b|w = |c|w ≥ 1} Example of a derivation for the string abbcca. It is easy to design GIG grammars where the respective languages are in Lmix . It was conjectured in [29] that the MIX language is not an IL. S ⇒ k#aS ⇒ #aSbScS ⇒ #abScS ⇒ j#abbcS ⇒ #abbcScSaS ⇒ #abbccSaS ⇒ #abbccaS ⇒ #abbcca We present here the proof that L(Gmix ) = Lmix . The number of permutations for a string of length n is n!.3. b. see e.

we reach the following point: ∗ ∗ ∗ ∗ . and t are members of the pairs that remove indices in the derivation. b. We need to prove that ut1 wt2 y t3 z is in L(GMIX ) ( |uti wti y ti z| = n + 3). S ⇒ k#a ⇒ #acb k j j i i S ⇒ j#b ⇒ #bac ¯ j ¯ j S ⇒ j#b ⇒ #bca S ⇒ i#b ⇒ #cba ¯ i ¯ i S ⇒ i#b ⇒ #cab Inductive Hypothesis: Assume for any string uwyz in Lmix then uwyz is in L(GMIX ). 2. GLOBAL INDEX GRAMMARS language is indeed Lmix . First direction: L(Gmix ) is in Lmix = {w|w ∈ {a. It might just turn out to be a signiﬁcant subset of Lmix (in other words it is not so easy to ﬁgure out if there are some set of strings in Lmix that might not be generated by a particular grammar). It can be seen that all the derivations allow only equal number of a s. n = 3: S ⇒ k#a ⇒ #abc k ¯ k ¯ k is clearly in the language. 1. w = w c2 and y = a2 y b2 trigger the following derivation (perhaps the only one). Where ¯ ¯ t1 t2 t3 is any string of length three in Lmix and t designates the terminals that introduce the indices ¯ in the derivation.30 CHAPTER 3. S ⇒ jδ #u bS ⇒ δ#u bSaScS ⇒ iδ #u bw caScS ⇒ δ #u bw caay bcS If we try to combine the derivation proposed in 1. c}∗ and |a|w = |b|w = |c|w ≥ 0}. We show ¯ ¯ that Gmix generates any uti wti y ti z It is trivial to see that the following derivation is obtained (where a corresponds to tk and b and c ¯ to the tk ’s. where ¯ ¯ ¯ ¯ |uwyz| = n. n ≥ 0. Second direction: Lmix is in L(Gmix ) Basis n = 0. y = a1 y c1 z. Proof . with the one proposed in 2. This blocking eﬀect can be illustrated by the following hypothetical situation: suppose uwyz might be composed by u = u b1 . S ⇒ δ#uS ⇒ kδ#uaS ⇒ δ#uaSbScS ⇒ δ #uawbScS But at this point the strings b and c might block a possible derivation. b s and c s due to the constraint imposed by the indexing mechanism.

We need to account whether there is a possible conﬁguration such that a conﬂict of indices arises.tj . there is more than one element in one of the indices : ¯¯ ¯¯ ti tj (ti )n [tj tj (ti ti )n+1 ] for example: ab(a)n [cacb](cb)n ab(a)n [accb](cb)n S ⇒ ti S[ti ti ] reduces to the following problem which is derived by the embedded S ¯ ¯ ¯ ¯ tj (ti )n [tj . tj are reduced to the case of two conﬂicting indices. This in turn can be easily derived by: δ#S ⇒ jδ#bS ⇒ δ#baScS ⇒ in−1 δ#baan−1 cS ⇒ kin−1 δ#baan−1 caS ⇒ in−1 δ#baan−1 cacbS ⇒ δ#baan−1 cacb(cb)n−1 Claim 4 For any sequence of two possible conﬂicting indices there is always at least a derivation in Gmix . Case 1. . because the grammar is highly ambiguous. there are three diﬀerent indices (ti = tj = tk ): ti utj vtk .3.. Case 2.2.. S ⇒ jδ #u b1 S ⇒ kjδ #u b1 a0 S ⇒ jδ #u b1 a0 Sb0 Sc0 S ∗ 31 At this point the next step should be the derivation of the non-terminal S at b0 Sc0 .ti )n ] And this problem is reduced to: ¯¯¯¯ tj ti S tj tj ti ti S i. GLOBAL INDEX GRAMMARS 3..(ti .. Therefore. We prove now that such a blocking eﬀect in the indexing is not possible: there are always alternative derivations.. removing the index j.. Claim 3 For any sequence of possibly conﬂicting indices the conﬂicting indices can be reduced to two conﬂicting indices in a derivation of the grammar Gmix . We show now that this situation is impossible and that therefore Lmix is in L(GMIX ). is there any possible combination of indices : ¯ ¯ ¯ ¯ ¯ ¯ ti · · · tj · · · tk · · · tj · · · tk · · · ti · · · tj · · · tk · · · ti that cannot be derived by GMIX ? Remember t designates the terminals that introduce the indices ¯ in the derivation. This cannot be done because the derivation has to proceed with the preceding S (at a0 Sb0 ) due to the leftmost derivation constraint for GIGs. In other words. tk . and t are members of the pairs that remove indices in the derivation.e. clearly S ⇒ i#ti S ⇒ #ti Stj Stk S and the complements of ti . there is no guarantee that the necessary sequence of indices are removed.: baScacbS where the two non terminal S expand the ti n−1 triples..

w.e. 3.) It can be seen that there is an alternative derivation: S ⇒ k#uai vS ⇒ #uai vbj Scj S ⇒ j#uai vbj wbi xcj S ⇒ #uai vbj wbi xcj Sci Saj ⇒ #uai vbj wbi xcj zci yaj . they are also removed in the derivation of the substring). The tests were performed on the strings of length 6 and 9. This assumption is made based on the previous two claims. Therefore we conclude that there is no possible blocking eﬀect and there is always a derivation: S ⇒ #uawbycz ∗ ∗ ∗ ∗ We also used the generate-and-test strategy to verify the correctness of the above grammar Gmix for Lmix and two other grammars for the same language. Let us assume the ti triple corresponds to a(bc) and tj triple corresponds to b(ca) therefore it is: uai vbj wbi xcj zci yaj (or uai vbj ci xcj zbi yaj . shows that any CFG is u . z and y do not introduce possible blocking indices (i.3 GILs and Dyck Languages We argue in this section that GILs correspond to the result of the “combination” of a CFG with a Dyck language. if indices are introduced. ¯ ¯ ¯ ¯ S ⇒ i#uti S ⇒ #uti S ti S ti S ⇒ j#uti vtj ti S ti S ⇒ ¯ ¯ ¯ ¯ ¯ ¯ ∗ ¯ ¯ ¯ ¯ j#uti vtj ti xti S ⇒ #uti vtj ti xti S tj S tj ⇒ #uti vtj ti xti z tj y tj Similar alternatives are possible for the remaining combinations: ¯ ¯ ¯ ¯ uti v ti wtj xti z tj y tj ¯ ¯ ¯ ¯ uti vtj wtj xti z tj y ti ¯ ¯ ¯ ¯ uti vtj wti xtj z tj y ti ¯ ¯ ¯ ¯ uti v ti wtj xtj z ti y tj ¯ ¯ ¯ ¯ uti vtj wtj xti z ti y tj ¯ ¯ ¯ ¯ uti vtj wti xtj z ti y tj ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ However the last one requires some additional explanation. x.32 CHAPTER 3. Formally: S ⇒ #uS ⇒ #uwS ⇒ #uwxS ⇒ #uwxzS ⇒ #uwxzy Therefore for the following combination: ¯ ¯ ¯ ¯ ti utj wti xti z tj y tj : the following derivation is possible. etc. given we are considering just two possible conﬂicting indices. GLOBAL INDEX GRAMMARS Assume the possible empty strings u. The well-known Chomsky-Sch¨tzenberger theorem [22].

Proof Let L = L(G). P 1) such that P1 is given according to the following conditions. This stack of indices. #.3. T. such that α1 and β 1 ∈ (N ∪ T T )∗ as follows: 1. if p = A → αaβ then p1 = A1 → α1 a¯β 1 a 2. S. Dyck languages can also provide a representation of GILs. if p = A → α then p1 = A1 → iα1 i 3 We 3 use a subscript 1 to make clear that either productions and non-terminals with such subscript belong to the CFG G1 and not to the source GIG. φ(¯) = a φ(i) = . S 1 . As we have seen above. GILs include languages that are not context free. β ∈ (N ∪ T )∗ create a new ¯ production p1 ∈ P 1. a CFL and a homomorphism φ such that L = φ(Dr ∩CF L). GILS AND DYCK LANGUAGES 33 the result of the “combination” of a Regular Language with a Dyck Language. R is a regular set and φ is a homomorphism [39]. GILs can be represented using a natural extension of Chomsky-Sch¨tzenberger u theorem (we will follow the notation used in [39]). which results in a PDA. For every production p ∈ P where a ∈ T. if i ∈ I. P ). and α. Deﬁne φ as the homomorphism from Σ0 ∗ into T ∗ determined by φ(a) = a. A GIG is the “combination” of a CFG with a Dyck language: GIGs are CFG-like productions that may have an associated stack of indices. L = φ(Dr ∩ R). where D is a semi-Dyck set. The analogy in the automaton model is the combination of a Finite State Automaton with a stack. This “combination” is formally deﬁned in the CFG case as follows: each context-free language L is of the form. Let Dr be the semi-Dyck set over Σ0 . u For each GIL L. Deﬁne a CFG grammar G1 = (N. where G = (N T. Σ0 . φ(¯ = i) if a ∈ T . I. there is an integer r. T and I are pairwise disjoint and |T ∪ I| = r ¯ ¯ The alphabet for the semi-Dyck set will be Σ0 = (T ∪ I) ∪ (T ∪ I). . Push and pop moves of the stack have the power to compute a Dyck language using the stack symbols. i ∈ I. has the power to compute the Dyck language of the vocabulary of indices relative to their derivation order.3. as we said. Theorem 1 (Chomsky-Sch¨ tzenberger for GILs) .

Induction Hypothesis. Basis a) w = then #S ⇒ # and S 1 ⇒ b) |w| = 1 then #S ⇒ #a and S 1 ⇒ a¯ a Both and a¯ are in Dr ∩ L(G1) a The induction hypothesis exploits the fact that any computation starting at a given conﬁguration of the index stack and returning to that initial conﬁguration is computing a Dyck language. And if φ(z) = y and φ(u ) = u then φ(u ia¯z¯ a) = uaza a ia¯ a ia¯ The reverse direction φ(Dr ∩ L(G1)) ⊆ L.34 iα 3. First direction L ⊆ φ(Dr ∩ L(G1)). We have to show that L = φ(Dr ∩ L(G1)). Suppose w ∈ φ(Dr ∩ L(G1)). (2) and (3) i k n−1 n i n n−1 n−1 by Induction Hypothesis and (1) S ⇒ u A1 ⇒ u ia¯B 1 ⇒ u ia¯zC 1 ⇒ u ia¯z¯ a a a a ia¯ If u . Basis: a) w = then S 1 ⇒ and #S ⇒ # k k n−1 b) |w| = 1 then S 1 ⇒ a¯ and #S ⇒ #a and φ(a¯) = a a a Induction Hypothesis Suppose that if there is a CFL derivation uA ⇒ uzB and z ∈ Dr then there is a GIL derivation δ#u ⇒ δ#u yA such that φ(z) = y Case (A) If: S 1 ⇒ zA1 ⇒ za¯ then a n−1 k . Suppose that if there is a GIL derivation δ#uA ⇒ δ#uyB (where u. y ∈ k ¯ ¯ T ∗ ) implies there is a L(G1) derivation u A ⇒ u zB (where u . z ∈ (T T ∪ I ∪ I)∗ ) such that z ∈ Dr k and φ(z) = y for every k < n. so is za¯. The proof is an induction on the length of the computation sequence. GLOBAL INDEX GRAMMARS 4. Suppose w ∈ L. φ and the corresponding CFL. z ∈ Dr so is u ia¯z¯ a. n > 1 then: Case (A) If: #S ⇒ #yB ⇒ #ya S 1 ⇒ zA1 ⇒ za¯ a It is clear that if z ∈ Dr . if p = A → α then p1 = A1 → ¯ 1 iiα [i] L(G1) is a CFL. so we have deﬁned Dr . if p = A → α then p1 = A1 → ¯ 1 ¯ i CHAPTER 3. And if φ(z) = y then φ(za¯) = ya a a Case (B) If: #S ⇒ #uA ⇒ i#uaB ⇒ i#uayC ⇒ #uaya by Induction Hypothesis.

j} CF Lww = L(GwwD ).4 Equivalence of GIGs and LR-2PDA In this section we show the equivalence of GIGs and LR-2PDA. S → S ¯ a ia¯ 5. Σ = T = {a. then there exists a LR-2PDA M such that L= L(M). P ) and P = 1. S → aS i 2. S }. b}∪I = {i. {a. a.4.3. This is on our view a consequence of the fact that GIGs are a natural extension of CFGs. Theorem 2 If L is a GIL. S → S b¯¯ bj 1. b. i. ¯ S. S → bS j 3. S → 3. #. S → S b ¯ j 6. 2. S → S b ¯ j ¯ Let D4 be the semi-Dyck set deﬁned over Σ0 = {a. S }. ¯ i. b}. j} ¯ b. . #. b. The proof is an extension of the equivalence proof between CFGs and PDAs. b}∗ } Given Gww = ({S. ¯ i. ¯ i We exemplify how the Chomsky-Sch¨tzenberger equivalence of GIGs can be obtained constructu ing the grammar for the language L1: Example 13 () L(Gww ) = {ww |w ∈ {a. S →S a¯¯ ai 3. and we construct GwwD from Gww as follows: GwwD = ({S. S →S b¯¯ bj 4. ¯ j. S. EQUIVALENCE OF GIGS AND LR-2PDA #S ⇒ #yA ⇒ #ya If z ∈ Dr so is za¯a¯ and if φ(z) = y then φ(za¯a¯) = yaa a a a a Case (B) If: S 1 ⇒ u A1 ⇒ u ia¯B 1 ⇒ u ia¯zC 1 ⇒ u ia¯z¯ a then a a a ia¯ #S ⇒ #yA ⇒ i#yaB ⇒ i#uayC ⇒ #uaya i k n−1 k n−1 n−1 35 If u . S → a¯iS a 6. ¯ j. j}. P ) and P = ¯ b. S → S a ¯ i 5. {a. S → S a ¯ i 7. i. a. {i. S → b¯ bjS 7. z ∈ Dr so is u ia¯z¯ a and if φ(z) = y and φ(u ) = u then φ(u ia¯z¯ a) = uaza a ia¯ a ia¯ If other (possible) derivations were applied to u ia¯zC then the corresponding string would not a be in Dr . j}. S → 4. ¯ = Σ∪Σ.

)} Now we have to prove that L(G) = L(M). x. . A. δ(q 1 . use G to construct an equivalent LR-2PDA. . and aﬀect the second stack accordingly. q 0 . ) = {(q 1 . 2. α. I. Remember GIGs require leftmost derivations for the rules that aﬀect the stack to apply. a. α. a. Therefore each sentential must be of the form xα where x ∈ T and alpha ∈ V ∪ T Claim 5 #S ⇒ #xα iﬀ (q1. if #S ⇒ #xα if and only if (q1. w. Γ. A. If they match repeat.e. ⊥) ∗ Notice that the proof is trivial if all the derivations are context free equivalent. ⊥) ∗ ∗ (q1. If the top of the stack is a terminal a. δ(q 1 . T. q 1 . Place the marker symbol ⊥ and the start variable on the stack. )| where A → w is a rule in P } ¯ j 6. w. We use as a basis the algorithm used in [77] to convert a CFG into an equivalent PDA.36 CHAPTER 3. q 2 }. i. The general description of the algorithm is as follows. δ. S⊥. δ(q 0 . δ(q 1 . . . Given a GIG G: 1. If the top of the stack is ⊥ accept. ⊥)} 2. compare it to the next symbol in the input. j) = {(q 1 . A. A. GLOBAL INDEX GRAMMARS Proof Assume a GIG G that generates L. a. b. Construct the LR-2PDA M = ({q 0 . δ 2 = ∗ δ2 δ1 (q1. S. P ) be a GIG. δ(q 1 . ) = {(q 1 . . x. #. S. select one of the rules for A and substitute A by the string on the right-hand side of the rule. . ⊥) or δ = [#]. ) = {(q 1 . w. ju)| where A → aw is a rule in P } j 5. a. δ 2 = ⊥ . ⊥) where δ 1 . u) = {(q 1 . The corresponding formalization is: Let G = (V. . j)| where A → w is a rule in P } [j] 4. the only change that we require is to take into account the operations on the indices stated in the grammar rules. c. . q 2 ) where Γ = V ∪ T ∪ I and δ: 1. If the top of the stack is a variable A. w. Otherwise reject this branch of the non-determinism. T. j) = {(q 1 . ⊥. δ(q 1 . Repeat the following steps forever. )| where A → w is a rule in P } 3. S.

. δ) (q 1 . ⊥) Case C Pop #S ⇒ jδ#yAγ ⇒ δ#yaηγ = δ#xα then by IH and 5. Aγ.4. S. α. a. . α. (q 1 . Assume (q1. S. S. ⊥) k≥1 Case A context free If #S ⇒ δ#yAγ ⇒ δ#yaηγ = δ#xα where x = ya and α = ηγ then by IH and 2 or 3: (q 1 . S. γ) j j (q 1 . ηγ. A → aη ∈ P where ι = #S ⇒ δ#yβ ⇒ yaηγ = xα Case B. β. the corresponding equivalence holds.e. S.3. ⊥) ∗ k−1 (q 1 . .) or (2. δ) Induction Hypothesis. Therefore we need to prove that whenever the stacks are used. . This case is a standard CFL derivation. S.) respectively. β. ya. α. EQUIVALENCE OF GIGS AND LR-2PDA 37 This holds true by the equivalence of PDA and CFG. a. ya. Push moves in the auxiliary stack. w. ⊥) Case B Push #S ⇒ µ#yAγ ⇒ jµ#yaηγ = jµ#xα then by IH and 4. . α. jµ) where δ = jµ. a. δ) . α. . Pop moves in the auxiliary stack. µ) j (q 1 . ⊥) where x ∈ T ∪ { } and δ = (q1. . x. δ) (q 1 . ⊥) ∗ (q1. jδ) ¯ j ¯ j (q 1 . a. By (1. (q 1 . ⊥. ⊥) k−1 (q 1 . that the claim above is a particular case of: #S ⇒ δ#xα iﬀ (q1. (q 1 . ¯ j ∗ j k−1 ∗ ∗ k k ∗ (q 1 . ⊥) k−1 and α = ηγ Hence: (q 1 . S. S. x. S. jγ) where δ = jγ. δ) implies #S ⇒ δ#yβ for any k ≥ 1 and show by induction on k that #S ⇒ δ#xα Let x = ya Case A. ∗ ¯ j The last step implies A → aη ∈ P Hence: #S ⇒ jδ#yβ ⇒ δ#yaηγ = xα The only if direction: Suppose that #S → δ#wα implies that (q 1 . . . δ) for any (q 1 . The last step implies A → aη ∈ P Hence: #S ⇒ γ#yβ ⇒ jγ#yaηγ = xα j ∗ Case C. x. ya. ya. k ∗ ∗ ∗ (q1. a. ya. i. (q 1 . ⊥) or δ = [#]. ⊥) First direction (if) Basis: #S ⇒ #x if (q1. δ). α. ι Given the last step implies β = Aγ for some A ∈ V . α. β. δ) (q 1 . Aγ.

B 1 B 2 . A. q and p in Q.[q n−1 B n−1 q n ] (pop) such that ¯ j δ(q.. [qAq n ] → a [q 1 B 1 q 2 ] [q 2 B 2 q 3 ] . . w. proving by induction on the steps in a derivation of G or moves of M that: #[qAp] ⇒ #w if and only if (q... ⊥.[q n−1 B n−1 q n ] such that δ(q. B 1 B 2 . jδ) ∗ ¯ j (q 1 .. j) contains (q 1 . ). q 1 ..B n−1 . q n in Q. δ. [qAq n ] → a [q 1 B 1 q 2 ] [q 2 B 2 q 3 ] . x. I = Γ2 . q 2 . B n−1 in Γ and i.. δ) Given the values δ. (push) 5.. a must be in δ Σ.. Proof Given a LR-2PDA construct an equivalent GIG as follows. B 1 B 2 . Notice that in case 4. A. then L is a GIL. ⊥) . ⊥) step ≤ k − 1) we obtain #S ⇒ δ#xα = #x iﬀ (q 1 . and cannot be given the constraints imposed on the possible transitions in a LR-2PDA. P ) where V is the set of variables of the form qAp.B n−1 .. 3. items 3. . I. ya. i) contains (q 1 . α. B 1 B 2 . a. Σ. S.[q n−1 B n−1 q n ] such that [j] δ(q. the only modiﬁcation is to mimic the operation of the auxiliary stack. B 1 .38 (q 1 . Let M be the LR-2PDA (Q. #. S. GLOBAL INDEX GRAMMARS (q 1 . j). Γ2 . ⊥) ∗ ∗ (p. a. Assume Γ is composed of two disjoint subsets Γ1 . S. a. ) contains (q 1 . α. ). with the stack of indices in the grammar. A. We follow the proof from [41]. [qAq n ] → a [q 1 B 1 q 2 ] [q 2 B 2 q 3 ] . and P is the set of productions.B n−1 .. 2. A. . α = (which excludes Case B Push to be the last step or move but not as a (q 1 . Aγ. a. j in I. We need to show that L(G) = L(M ). A. A.e.. 4. a... δ) = (q 1 . Γ.. Σ.B n−1 . Let G be a GIG = (V. B 2 . and 4. F ).[q n−1 B n−1 q n ] such that j δ(q. In all the cases if n = 1. ⊥. 1. ji). ⊥. then the production is [qAq 1 ] → a. such that Γ1 is used in the main stack and Γ2 is used in the auxiliary stack.. i. . j) contains (q 1 .. This conversion algorithm to construct a CFG from a PDA follows the one in [41] (including the notation). [qAq n ] → a [q 1 B 1 q 2 ] [q 2 B 2 q 3 ] . q 0 .. S → q 0 ⊥q for each q in Q And for each q... This construction is deﬁned so that a leftmost derivation in G of a string w is a simulation of the LR-2PDA M when processing the input w. plus the new symbol S. . ⊥) Theorem 3 If L is recognized by a LR-2PDA M. each a in Σ ∪ { }. A in Γ. ⊥) k−1 CHAPTER 3.

(q i . ay. γ i ) for 1 ≤ j ≤ m The ﬁrst move in I.. ⊥) δ ∗ (q i+1 . ⊥. γ k −1 = j ∈ I and δ = ¯ j Now the “only if” part (the basis was proven above).. First (if) direction: Induction Hypothesis: If (q. w. .. then γ 1 = .. PDA equivalence. A. y = y 1 . .. γ k ) implies: δ #[qAq n ] ⇒ γ k −1 #ay 1 y 2 ... B 1 B 2 . ⊥. in k moves (for any k ≥ 1) then the GIG G will derive the same string w and string of indices γ k I. so the induction hypothesis is: If γ 1 #u[qAp] ⇒ γ k #uw then (q. then either 1. . .B m . γ 1 ) k (p.. In other words. where γ i ∈ I ∗ and ∗ u. γ k ) for any k ≥ 1. y.. A.y m where each y i has the eﬀect of popping B i from the stack (see the details corresponding to the PDA-CFG case in [41]) then there exist states q 2 . ay. γ 1 ) k−1 (p.. A. γ 1 ) implies #[qAq n ] ⇒ γ 1 #a [q 1 B 1 q 2 ] [q 2 B 2 q 3 ] .y m = #w where γ k = ⊥. ⊥) (q 1 . ... EQUIVALENCE OF GIGS AND LR-2PDA 39 If only rules created with step 1 or 2 and the corresponding transitions are used then. w.y m = #w The same holds for the last symbol that is extracted from the stack (from II again): III.[q n−1 B n−1 q n ] where δ can be only be some j in I then γ 1 = j or δ is [⊥]. B i . γ k −1 ) (p. ⊥. ⊥) ∗ k−1 ∗ (q n−1 .3.4. (q. such that the inductive hypothesis holds for each: II. A. (q.y m−1 [q n−1 B n−1 q n ] ⇒ γ k #ay 1 y 2 . ie.: (q. .. the induction hypothesis states that whenever the LR-2PDA M recognizes a string emptying the main stack and changing the auxiliary stack from a string of indices γ 1 to a string of indices γ k .. ⊥.. B m . B 1 B 2 .[q n−1 B n−1 q n ] ⇒ γ k #ay 1 y 2 . implies: #[qAq n ] ⇒ γ 1 #a[q 1 B 1 q 2 ] [q 2 B 2 q 3 ] . ay. . γ 1 ) Suppose: k ∗ (p.. The basis is also proven for both directions. γ k −1 = ⊥ and δ = or [#] or 2.. γ k ) then γ 1 #u[qAp] ⇒ γ k #uw. y. γ i+1 ) then γ i #[q i B i q i+1 ] ⇒ γ i+1 #y i ∗ (q 1 .B m . q m + 1 = p. A.. w ∈ Σ∗ . Therefore I.. γ k ) Decomposing y in m substrings.. these are a CFG and a PDA and therefore follows from the standard CFG. given the only type of rules/moves applicable are 1 and 2 (in this case where δ = [⊥]). y i . y m .. q m +1.

: and from this move and II. B i+1 . ⊥.. . . xm . w. A.xn ): (q.B n to each stack in the sequence of ID’s so that: II. Z 0 ) ∗ ∗ (p. γ k ) where the possibilities are either xm = xn or δ = [⊥] or and given we require γ k to be ⊥ then the only possibilities are: (A) either γ k = γ k −1 = ⊥ and δ = (B) δ = γ k −1 then γ k = ⊥ ¯ The ﬁnal observation is that we satisfy the ﬁrst claim assigning the following values: q = q O and A = Z 0 .B n .. γ 1 ) or [⊥]. γ k ) #u[qAq n ] ⇒ γ k −1 #uax1 . B 1 B 2 ..xm [q n−1 B n−1 q n ] ⇒ γ k #uw which in turn implies: δ (q. x1 x2 ...40 CHAPTER 3. γ k − 1) (q n . ⊥) (q 1 . Again.B n . ⊥. B i .. w. γ i+1 ) From the ﬁrst step of the derivation in I. w.. γ i ) ∗ (q i+1 . where i = 1.xn . w. ∗ where γ 1 is ⊥ if δ in the ﬁrst step of I.B n . #u[qAq n ] ⇒ γ 1 #ua [q 1 B 1 q 2 ] [q 2 B 2 q 3 ] .xn such that γ i #ui [q i B i q i+1 ] ⇒ γ i+1 #ui xi therefore by the induction hypothesis: (q i . in the construction of the GIG G. we obtain (remember w = ax1 x2 .. γ i ) ∗ ∗ (q i+1 . ⊥) k−1 ∗ (p.. γ i+1 ) for 1 ≤ i ≤ n Now we can add B i+1 . B n . B i B i+1 ....n. we obtain: #S ⇒ #w iﬀ (q 0 . GLOBAL INDEX GRAMMARS I.. A.. So according to 1.[q n−1 B n−1 q n ] ⇒ γ k #uw δ k−1 where q n = p... we can decompose w as ax1 x2 . ⊥) or xm = (q n−1 . (q i . then (q.. A. is If we consider the last step from I. . xi . ⊥. . .. ⊥. ... ⊥). 2. .. xi .

Due to the constraints on the push productions at most the same amount of symbols as the size of the input can be introduced in the additional stack. Most of other relations are more diﬃcult to determine. Therefore a LBA can simulate a LR-2PDA. The additional stack in GIGs/LR-2PDA. 41 . The corresponding automaton is another two stack machine. Moreover. However GCSLs might include trGILs. GILs are incomparable to the Growing Context Sensitive Languages (GCSLs).Chapter 4 Global Index Languages Properties 4. another family of languages that has some similarities with GILs.1 Relations to other families of languages There are two clear cut relations that place GILs between CFLs and CSLs: GILs are included in CSLs and GILs include CFLs. It is interesting to establish the relation of GILs to LILs and LCFRLs because there is an extensive tradition that relates these families of languages to natural language phenomena. the relation to LILs is interesting because of their similarities both in the grammar and the automaton model. The relation to Growing Context Sensitive languages is interesting for a similar reason. GILs and ILs might be incomparable. GILs might include LILs and perhaps LCFRLs. corresponds to an amount of tape equal to the input in a LBA. • Proper inclusion of GILs in CSLs. and the constraints imposed on the use of the additional stack in the GIL automaton might be seen as a shrinking property. We do not address possible relationship with the counter languages [42] however.

There are no other derivations from S 3 than #S 3 ⇒ #S 1 and #S 3 ⇒ #S 2 Therefore L1 ∪ L2 = L3 .2 Closure Properties of GILs The family of GILs is an Abstract Family of Languages. Proof Let L1 and L2 be GILs generated respectively by the following GIGs: G1 = (N 1 . #. • GILs and Growing Context Sensitive Languages are incomparable.g. We consider this quite possible. Construct the grammar G3 = (N 1 ∪ N 2 . Assume also that S 3 . [41]). T 2 . GLOBAL INDEX LANGUAGES PROPERTIES • Proper inclusion of GILs in ILs. n 4. The copy language {ww|w ∈ Σ∗ } is not a GCSL [53]. A string w is in L1 if and only if the derivation #S 3 ⇒ #S 1 ⇒ #w is a derivation in G3 . care should be taken that the two sets of stack indices be disjoint. Union L1 ∪ L2 :. This is an open question. concatenation and Kleene closure. The same argument holds for w in L2 starting the derivation #S 3 ⇒ #S 2 . instead of two CFG grammars. I 2 are disjoint. S 2 ) Since we may rename variables at will without changing the language generated. S 4 . This result is obtained from the deﬁnition of GIGs. We discuss this issue in Chapter 6. • Proper inclusion of LILs in GILs. GCSLs include the language {ba2 |n ≥ 1} which is not semi-linear. GILs contain some languages that might not be ILs. using two GIG grammars. However it remains as an open question. Proposition 1 GILs are closed under: union. • CFLs are properly included in GILs.42 CHAPTER 4. S 3 ) where P 3 is P 1 ∪ P 2 plus the productions S 3 → S 1 | S 2 . S 1 ) and G2 = (N 2 . T 1 ∪ T 2 . T 1 . I 2 . #. #. P 2 . I 1 . ∗ . S 5 are not in N 1 or N 2 . I 1 . we assume that N 1 . N 2 . For concatenation. This can be proved using the same type of construction as in the CFL case (e. P 1 . such as the MIX language. P 3 . I 1 ∪ I 2 . ILs are not semi-linear and GILs are semi-linear.

T 1 . -free homomorphisms. A string w is in L1 if and only if the derivation #S 4 ⇒ #S 1 ⇒ #wS 2 is a derivation in G4 . Assume that the non-terminals of G an Ga are disjoint. I 1 . and a string u is in L2 if and only if the derivation #wS 2 ⇒ #wu. Notice that #S 4 ⇒ #S 1 ⇒ δ#wS 2 for some δ in I 1 does not produce any further derivation because the I 1 and I 2 are disjoint sets. [#] ∗ ∗ ∗ The proof is similar to the previous one. therefore also no δ ∈ I 2 can be generated at this position. Construct G4 = (N 1 ∪ N 2 .4. Closure:. #. The proof that L(G4 ) = L(G1 )L(G2 ) is similar to the previous one. The substituting CFG must be in Greibach Normal Form (so as to respect the constraints on productions that push indices in the stack). This proof adapts the substitution closure algorithm given in [41] to prove substitution closure by CFLs. -free regular sets. where each Ga is in GNF. T 1 ∪ T 2 . Proposition 2 GILs are closed under substitution by -free CFLs. CLOSURE PROPERTIES OF GILS 43 Concatenation:. Proof Let L be a GIL. Let L be L(G) and for each a in Σ let La be L(Ga ). #. Construct a GIG grammar G1 such that: (a) the non terminals of G1 are all the non-terminals of G and of each Ga .2. given the only production that uses S 1 and S 2 is S 4 L(G4 ) = L1 · L2 . S 4 ) such that P 4 is P 1 ∪ P 2 plus the production S 4 → S 1 S 2 . (c) the set of indices I and # are the set of indices and # from G (d) the start symbol of G1 is the start symbol of G. S 1 ) where P 5 is P 1 plus the productions: S5 → S1 S5 | . P 4 .Let G5 = (N 1 ∪ {S 5 }. (e) The productions of G1 are all the productions of each Ga together with all the productions from G modiﬁed as follows: replace each instance of a terminal a in each production by the start symbol of Ga . P 5 . (b) the terminals of G1 are the terminals of the substituting grammars Ga . I 1 ∪ I 2 . L ⊆ Σ∗ . and for each a in Σ let La be a CFL. is a derivation in G4 for some w.

in which case p = p and η = i or η = Y It is easy to see that ([p0 . a) = p and δ G (q. L ∩ R is a Global Index Language. Y ) contains (q . Σ. ⊥. Σ. Construct an LR-2PDA M 1 accepting h−1 (L) in the following way. Σ. q ]. GILs do not tolerate an substitution due to the constraints on type b. Let L = L(M ) where M is the LR-2PDA (Q. w) = p i Proposition 4 Global Index Languages are closed under inverse homomorphism. Proof Let L be L(M ) for an LR-2PDA M =(QG .3 Semilinearity of GILs and the Constant Growth property The property of semilinearity in a language requires that the number of occurrences of each symbol in any string (also called the commutative or Parikh image of a language) to be a linear combination of the number of occurrences in some ﬁnite set of strings. Z. η). a. X. Proposition 3 If L is a Global Index Language and R is a regular set. ⊥. ⊥) (q. q]. Parikh [60] showed that CFLs are semilinear. On input a M 1 generates the string h(a) stores it in a buﬀer and simulates M on h(a). γ. Proof Let h : Σ → ∆ be a homomorphism and let L be a GIL. δ. F A ). δ A . q 0 ]. Σ. . [p0 . Y ) contains ([p . ⊥) ([p. Γ. . a similar proof to that used in the CFL case works for these closure properties: in both cases a LR-2PDA with a modiﬁed control state is used (again see [41] for the CFL case). Therefore L(M 1) = {w | h(w) ∈ L}. F ). q 0 . η) and δ(p0 . γ. δ. p0 . Note that a may be . γ. η) if and only if: δ A (p. Again. q 0 ]. 4. γ. GLOBAL INDEX LANGUAGES PROPERTIES Note that the requirement that the substituting grammar be in GNF implies that it is an -free CFL. X. Construct M’ = (QA ×QG . ⊥. GILs are also closed under intersection with regular languages and inverse homomorphism. η) if and only if (an induction proof is given by [41] for the CFL case) (q 0 . q 0 . w. δ G . F G ) and let R be L(A) for a DFA A = (QA . w. (push) productions which require Greibach normal form. F A ×F G ) such that δ is deﬁned as follows: δ([p. Γ. a. q]. Γ. .44 CHAPTER 4.

... The commutative or Parikh image of a language L ∈ Σ∗ .. [33. that CFLs are letter-equivalent to a regular set. then their intersection X ∩Y is also semilinear. Theorem 5 If L is a GIL then L is a semi-linear language. We follow the proof presented in [37] to prove that the class of languages L(M c ). Deﬁnition 8 A set V in Nn a) is linear if V = {v 0 + c1 v 1 + . [46. the constant growth property requires that there should be no big gaps in the growth of the strings in the languages. If ψ(L) is semi-linear. We will use the following lemma in the proof of semilinearity for GIGs. The Parikh image of a language is the set of all vectors obtained from this mapping to every string in the language. 60]..g. Roughly speaking. Intuitively. 35]). |an |(w)) where |ai |(w) denotes the number of occurrences of ai in w. 37]). Semilinearity has been assumed as a good formulation of the constant growth property of natural languages (e. L is a semi-linear language. is semilinear provided that the languages corresponding to C are semilinear. v i ∈ Nn for 1 ≤ i ≤ m} b) is semilinear if V is the ﬁnite union of linear sets. an }. ψ(L) = {ψ(w)|w ∈ L}.e.. . Two languages L1 . as Theorem 5. deﬁne a mapping from Σ∗ into N n as follows: ψ(w) = (|a1 |(w). However. We will not discuss here whether semilinearity is the correct approach to formalize constant growth. L2 in Σ∗ are letter-equivalent if ψ(L1 ) = ψ(L2 ).1. Lemma 4 If X and Y are semilinear subsets of Nn . 86]). the property of semi-linearity of GILs follows from the properties of the control mechanism that GILs use... . [55.4.3. The proof of this lemma is in [30].g. This property has been extensively used as a tool to characterize formal languages (e.g. recently it has been claimed that semilinearity might be too strong a requirement for models of natural language (e. + cm v m |ci ∈ N. SEMILINEARITY OF GILS AND THE CONSTANT GROWTH PROPERTY 45 i. Deﬁnition 9 Parikh Mapping (see [39]) : Let Σ be {a1 .6. We assume a deﬁnition of semilinearity of languages such as that found in [39. where M c is obtained from an automata class C by augmenting it with ﬁnitely many reversal-bounded counters. The Parikh mapping is a function that counts the number of occurrences in every word of each letter from an ordered alphabet. concept. .

removing the pairs of ik and ¯k coordinates.. as follows: 1. Σ. S. We modify the construction of L1 in the proof of Theorem 1. GLOBAL INDEX LANGUAGES PROPERTIES The proof exploits the properties of Theorem 1: every GIL L = φ(Dr ∩ L1) such that L1 is a CFL. note that S 2 is a subset of S 1 . i Corollary 6 The emptiness problem is decidable for GILs. if p = A → α then p1 = A → iα i 3. By the Parikh theorem [60] the Parikh map of the CFL L(G1). For every production p ∈ P where a ∈ T. i ∈ I. P 1) Deﬁne a CFG grammar G1 = (N. in . in other words.. This follows from Theorem 1. if p = A → α then p1 = A → ¯ iα ¯ i 4. ik . We can consider pumping lemmas for diﬀerent families of languages as specifying the following facts about them: . 4. #. I. ¯k ∈ N} where the pairs of ik and ¯k i i i i ¯ coordinates correspond to symbols in I and the corresponding element in I.. if p = A → α then p1 = A → α 2. ¯n . am ... removing the illegal derivations. ψ(L(G1)) is an eﬀectively computable semi-linear set S 1 . Proof Given a GIG G = (N.4 Pumping Lemmas and GILs This section and the remainder of this chapter will present some exploratory ideas rather than established results. P ) such that ¯ Σ1 is (Σ ∪ I ∪ I) and P 1 is given according to the following conditions. Computing the intersection of S 1 and S 2 amounts to compute the properties that the control performed by the additional stack provides to GILs. Let S 2 be the semilinear set {(a1 . Σ1 . ¯p )|aj . and α. From S3 we obtain S 0 the semilinear set corresponding to ψ(L(G)). ∈ (N ∪ T )∗ create a new production p1 ∈ P 1.46 CHAPTER 4. S. Dr and L1 are semilinear by the Parikh theorem (L1 and Dr are CFLs). ip .. The intersection of S 1 and S 2 is a computable semilinear set S 3 according to [30]. if p = A → α then p1 = A → ¯ iiα [i] It can be seen that L(G1) ⊆ Σ1 ∗ and that for each w that is in the GIL L(G) there is a word w1 ∈ L(G1) such that |i|(w1) = |¯ i|(w1). .

4.4. PUMPING LEMMAS AND GILS

47

• Regular Languages: Inserting any number of copies of some substring in a string always gives a regular set. • Context Free Languages: every string contains 2 substrings that can be repeated the same number of times as much as you like. • GCFLs, LCFRLs, others and GILs, there is always a number of substrings that can be repeated as many times as you like. Following upon this last observation, the following deﬁnition is given in [35] as a more adequate candidate to express properties of natural language. This is a candidate for a pumping lemma for GILs. Deﬁnition 10 (Finite Pumpability) . Let L be a language. Then L is ﬁnitely pumpable if there is a constant c0 such that for any w ∈ L with |w| > c0 , there are a ﬁnite number k and strings u0 , ..., uk and v 1 , ..., v k such that w = u0 v 1 u1 v 2 u2 ...uk −1 v k uk and for each i, 1 ≤ |v i | < c0 and for any p ≥ 0, u0 v 1 p u1 v 2 p u2 ...uk −1 v k p uk ∈ L. Compare the previous deﬁnition with the following k-pumpability property of LCFRS ([71], and also in [35]) which applies to any level-k language. Deﬁnition 11 (k-pumpability) Let L be a language. Then L is (universally) k − pumpable if there are constants c0 ,k such that for any w ∈ L with |w| > c0 , there are stringsu0 , · · · , uk and v 1 , · · · , v k such that u0 v 1 u1 v 2 u2 · · · uk −1 v k uk , for each i : 1 ≤ |v i | < c0 , and for any u0 v 1 p u1 v 2 p u2 ...uk −1 v k p uk ∈ L. In this case the k value is a constant determined by the k-level of the language.

4.4.1

GILs, ﬁnite turn CFGs and Ultralinear GILs

We showed that there is no boundary in the number of dependencies that can be described by a GIL (see the language Lm in the previous chapter). This fact and the candidate pumping lemma for GILs are related to the following observation. For any CFG that recognizes a number of pairs of dependencies, ( e.g., La = {an bn , cm dm |n ≥ 1, m ≥ 1} has 2 pairs of dependencies or turns [32, 39, 88, 5]) there is a GIG that generates the total number of dependencies included in the

48

CHAPTER 4. GLOBAL INDEX LANGUAGES PROPERTIES

pairs. This is done by “connecting” the CFG pairs of dependencies (turns) with “dependencies” (turns) introduced by the GIG extra stack. This “connection” is encoded in the productions of the corresponding terminals. For example, in La it is possible to “connect” the b’s and c’s, in a turn of the GIG stack: any production that has a b in the right-hand side also adds an index symbol to the GIG stack (our notation for this will be bx ), and every production that has a c in the right-hand side removes the same index symbol from the production stack (we will denote this by c¯ ). x La = {an bn cm dm |n ≥ 1, m ≥ 1} → Lb = {an bx n c¯ m dm |n ≥ 1, m ≥ 1} = {an bn cn dn |n ≥ 1, } x Conjecture 1 For any k-turn CFG, where k > 1 is ﬁnite, there is a GIG that generates a language with (2 · k) dependencies. These observations are also related to the fact that LIGs (and the equivalent automata), can connect one-turn for each stack [85]. Therefore the boundary of the number of dependencies is four.

4.5

Derivation order and Normal Form

We introduced GIGs as a type of control grammar, with leftmost derivation order as one of its characteristics. GIG derivations required leftmost derivation order. We did not address the issue of whether this is a normal form for unconstrained order in the derivation, or if an extension of GIGs with unconstrained order in the derivation would be more powerful than GIGs. In this section we will speculate about the possibility of alternative orders in the derivation, e.g. (rightmost) or free derivation order. The following grammar does not generate any language in either leftmost or rightmost derivation order: Example 14 L(G6 ) = {an bm cn dm }, where G6 = ({S, A, B, C, D}, {a, b, c, d}, {i, j}, S, #, P ) and P = 1. S → A B C D 6. C → cC

¯ i

2. A → aA

i

3. A → a

i ¯ j ¯ j

4. B → bB

j

5. B → b

j

7. C → c

¯ i

8. D → dD

9.D → d

The only derivation ordering is an interleaved one, for instance all the a’s are derived ﬁrst, then all the c’s, followed by the b’s and ﬁnally the d’s. However we know that such a language is a GIL. It is our belief that the following conjecture holds, though it might be diﬃcult to prove. Unrestricted derivation order would introduce only unnecessary additional ambiguity.

4.5. DERIVATION ORDER AND NORMAL FORM

49

Conjecture 2 Unrestricted order of the derivation in a GIG is not more powerful than leftmost derivation order. Following the previous example, the next example might seem impossible with leftmost/rightmost derivation. It looks like an example that might support the possibility that unrestricted order of the derivation might yield more powerful grammars. Example 15 L(G6b ) = {an bm cl dm en f l | n, m, n ≥ 1}, where G6b = ({S, A, B, C, D, E, F }, {a, b, c, d, e, f }, {i, j, k}, S, #, P ) and P is: 1. S → ABCDEF 5. B → b

j k

2. A → aA

i

3. A → a

i

4. B → bB

j

6. C → cC | c 10.E → e

¯ i

7. D → dD

¯ j

8.D → d

¯ j

9.E → eE

¯ i

11. F → f F

¯ k

12. F → f

¯ k

A derivation with unrestricted order would proceed as follows: S ⇒ ABCDEF ⇒ i#aABCDEF ⇒ ji#abCDEF ⇒ kji#abcDEF ⇒ ji#abcDEf ⇒ i#abcdEf ⇒ #abcdef However the following grammar generates the same language in leftmost derivation: Example 16 L(G6c = {an bm cl dm en f l | n, m, n ≥ 1}, where G6b = ({S, A, B, C, D, E, F }, {a, b, c, d, e, f }, {i, j, k}, S, #, P ) and P is: 1. S → A 5. B → bC

j

2. A → aA

i k

3. A → aB

i

4. B → bB

j

6. C → cCf | cM f 10.E → De

¯ i

M → DE

7. D → dD

¯ j

8.D → d

¯ j

9.E → Ee

¯ i

**Similarly the following language which contain unordered crossing dependencies is a GIL: {an bm cl dp bm an dp c l |n, m, l, p ≥ 1}
**

2 2 2 2

The next example also shows that leftmost and rightmost derivation ordering might produce two diﬀerent languages with the same grammar for each ordering, introducing therefore another dimension of ambiguity. Example 17 L(G7 ) = {ww|w ∈ {a, b}∗ } ∪ {wwR |w ∈ {a, b}∗ } derivation respectively) (in leftmost and rightmost

G7 = ({S, S , A, B}, {a, b}, {i, j}, S, #, P ) and P =

50 1. S → aS

i

**CHAPTER 4. GLOBAL INDEX LANGUAGES PROPERTIES 2. S → bS
**

j

3. S → S 8. A → a

¯ i

4. S → S A 9. B → b

¯ j

5. S → S B

6. S → A

7. S → B

**Rightmost derivation produces: #S → i#aS → ji#abS → ji#abS → ji#abS B → ji#abAB → i#abAb → #abab
**

i j ¯ j ¯ i

**Leftmost derivation produces: #S → i#aS → ji#abS → ji#abS → ji#abS A → ji#abBA → i#abbA → #abba
**

i j ¯ j ¯ i

iii#. This is a departure from Tomita’s graph-structured stack. jii#. For instance. 51 . ii#. j#.1. jjj#.) #. ij#. jj#. in ﬁgure 5. the number of edges connecting a node to others is limited. As an initial approach. ijj#. j with maximum length of stack 3. The one at the right is equivalent to the maximal combination of stack conﬁgurations for indices i. (i. the number of possible conﬁgurations would grow exponentially with the length of the input.Chapter 5 Recognition and Parsing of GILs 5. iji#. ji#. jij#. i#. each node of the graph-structured stack will represent a unique index and a unique length of the stack. 1 See [51] for a similar approach to Tomita’s. etc. The numbers indicate the length.1 If all the possible stack conﬁgurations in a GIG derivation were to be represented. It is a device for eﬃciently handling of nondeterminism in stack operations. Each node at length n can have an edge only to a node at length n − 1. The graph-structured stack at the left represents the following possible stack conﬁgurations: iii#. and [50] for an approach to statistical parsing using graph algorithms.1 Graph-structured Stacks In this section we introduce the notion of a graph-structured stack [80] to compute the operations corresponding to the index operations in a GIG. the active nodes are represented by circles and the inactive are represented by squares.e. The set of nodes that represents the top of the stack will be called active nodes (following Tomita’s terminology). While the number of possible nodes increases.

and ai ∈ T for 1 ≤ i ≤ n. Push(newnode..0 j. Let G = (N.3 Figure 5. Retrieves all the nodes that are connected by an edge from the currentnode. T.1 j.1 $.. Create the Sets S i : 1 S0 = [S → • S$.3 i. Algorithm 1 (Earley Recognition for GFGs) . Therefore the number of edges connecting a node to a preceding one is bound by the size of the indexing vocabulary.ai .2 j. Therefore. RECOGNITION AND PARSING OF GILS i. Pop(curretnode).0 j.3 i. which are composed of a ”dotted” rule and a starting position: [A → α • β. 5. An item [A → α • β. pj ]. given a string w = a1 a2 . pj ] is inserted in the set of states S i if α corresponds to the recognition of the substring aj .3 CHAPTER 5.. n ≥ 0.2 i. These items are used to represent intermediate steps in the recognition process. 0] 2 For 0 ≤ i ≤ n do: Process each item s ∈ S1i in order performing one of the following: a) Predictor: (top-down prediction closure) .1: Two graph-structured stacks The following operations are possible on the graph-structured stack. P ) be a CFG.1 j. S.2 i. currentnode connects only to nodes of current length-1. Let w = a1 a2 · · · an be an input string.1 GILs Recognition using Earley Algorithm Earley Algorithm.oldnode). Earley items are inserted in sets of states.2. Earley’s parsing algorithm [27] computes a leftmost derivation using a combination of top-down prediction and bottom-up recognition.2 5.1 $.an with n ≥ 0 any integer i such that 0 ≤ i ≤ n is a position in w. Creates a newnode if it is not in the graph and creates an edge from newnode to oldnode if necessary. Because at this point we use nodes of unambiguous length.2 j.. There are as many sets as positions in the input string.52 i. Earley’s main data structures are states or “items”.

2 Therefore Earley items for GILs might be as follows: [∆. GILS RECOGNITION USING EARLEY ALGORITHM If [B → α • Aβ.2 First approach to an Earley Algorithm for GILs. a pointer to an active node in the graph-structured stack. Let G = (N. I. If [A → α • aβ. j] ∈ S i and (A → γ) ∈ P : add [A → • γ. We use the graph-structured stack and we represent the stack nodes as pairs of indices and counters (the purpose of the counters is to keep track of the length of the stack for expository purposes). pj ] Algorithm 2 (Earley Recognition for GIGs) . Initialize the graph-structured stack with the node (#. k] ∈ S j : add [A → αB • β. 0). O. If i = n and Sn+1 = {[S → S$ • . 0]} then accept 53 5.{#}. and ai ∈ T for 1 ≤ i ≤ n.{P}) with P: S → aS | bS S→S| ¯ i . k] to S1i c) Scanner: equivalent to shift in a shift-reduce parser.b}. and O. j] to S i + 1 3 4 If S i+1 is empty. Let w = a1 a2 · · · an be an input string. 0] 2 For 0 ≤ i ≤ n do: Process each item s ∈ S i in order performing one of the following: a) Predictor b) Completer c) Scanner 2 Actually O ≤ 2n. used to record the ordering of the rules aﬀecting the stack. 0). #. i] to S i b) Completer: (bottom-up recognition) If [B → γ • . S. Reject. 0. P ) be a GIG.5. Create the Sets S i : 1 S0 = [(#. We modify Earley items adding two parameters: ∆.{i}. S → • S$.{S}.2. j] ∈ S i : for [A → α • Bβ. j] ∈ S i and wi + 1 = a: add [A → αa • β. An example of such case would be the following i grammar: Gd = ({S}. A → α • Aβ. such that O ≤ n where n is the length of the input.{a. n ≥ 0. if pop rules “erase” symbols from the stack.2. T.

C 2 ) ∈ pop((δ 1 .t. j] ∈ S i : µ for [(δ 2 . O. A → αB • β. O − 1. scanner. we represent nodes in the graph-structured stack with pairs (δ. Reject. O. 0]} then accept The structure of the main loop of Earley’s algorithm remains unchanged except for the require- ment that the initial item at S 0 (line 1) and the accepting item at S n + 1 (line 4) point to the empty stack node (#. C 2 ) and O1 = O2 ( move) if δ = [δ 1 ] then (δ 1 .2 add every [(δ 2 . 0). 0). A → α • aβ. Scanner If [∆. 1. O2 = O1 + 1 and push( (δ 2 . and have the corresponding initial order in the derivation. B → γ • . j] ∈ S i and wi + 1 = a: µ add [∆. O − 1. RECOGNITION AND PARSING OF GILS If i = n and Sn+1 = {[(#. 0. O. (δ 1 . O. Completer B If [∆1 . C 2 ). This implementation used Shieber’s deduction engine backbone [72]. C 2 ). completer used in the For loop in 2 are modiﬁed as follows. A → αB • β. C 1 ) ) s. O1 . S → S$ • . C 1 ). j] ∈ S i where µ = µ δ or µ = [i]: for [(δ 2 . k] ∈ S j where δ 2 = i if µ = ¯ i: δ add [∆1 . C 2 ) and O1 = O2 2. i] to S i δ such that: if δ ∈ I then δ 2 = δ. Completer A If [∆1 . O2 . A → α • Bβ. k] ∈ S j where δ 2 = i if µ = [i]: add [∆1 . As we said. A → • γ. O. C 1 ) = (δ 2 . B → γ • . A → αa • β.54 3 4 If S i+1 is empty. C 1 )) s. CHAPTER 5. C 2 = C 1 + 1 if δ = ¯ and i = δ 1 then O2 = O1 + 1 and i (δ 2 . B → α • Aβ. C) such that C ≤ n. Predictor If [(δ 1 . The operations predictor. C 2 ). C 2 ). O. The example . to perform the corresponding operations on the graph-structured stack. C 2 = C 1 − 1 if δ = then (δ 1 .t. j] to S i + 1 µ 3. A → α • Bβ. k] to S i δ 3. j] ∈ S i and (A → γ) ∈ P : µ δ 1. C 1 ) = (δ 2 . k] to S i δ The following example shows the trace of the items added to a chart parser implementing the above algorithm.

1.4.[]. GILS RECOGNITION USING EARLEY ALGORITHM 55 shows the recognition of the string aabbccdd with the grammar G2 transformed into a trGIG.1.c].2.[i.[b.il].5.[b].[B.1.1.[B]. ﬁnalposition) The stack operation is represented as follows: “il” is a push rule of the stack index “i” and “ir” is a pop rule.[].Adding to chart: <23599> item(S. [Stacksymbol.3.ir].1.[].B.[b.3.2.(#.1) 9 Adding to chart: <10640> item(S. i S→B B → bBc ¯ i B → bc ¯ i 1 Adding to chart: <10898> item(<start>.1.[i.[a.d].ir].1.c].[b.Adding to chart: <23725> item(B.2)]) 12 Adding to chart: <23725> item(B.S.3) 17.3). Adding to chart: <23851> item(B.d].2. OrderCounter.3.2) 14.3.2.Adding to chart: <27671> item(S.2. Postdotlist. Adding to chart: <23852> item(B.2.c].[].4.2) 10.[#.ir].1).3) 18.ir].d].1. Adding to chart: <26897> item(B.0.[b.(i. b.B.d].[].[S.[].[#.[]. Each item is represented as follows: item(LeftSymbol.ir].c].[].3) 16 Adding to chart: <23852> item(B.(i.[].4) .4.[a.il]. #.[b].[].0) Adding to stack: <22605> item((i.0.2).[i.[b].2.ir].3) 15.0.il]. d}. Predotlist.0.0) 3 Adding to chart: <23470> item(S.[].[i.3.0.[b. {a.Adding to chart: <27540> item(S.[].1. initialposition.[a.[B]. B}.1) 8 Adding to chart: <23598> item(B.[i.[#. G2 = ({S.[a].2) 13.[S.c].2) 11.[#.0) 2 Adding to chart: <27413> item(S.[i.S.2.1.e].1.[].0.[#.c].[c].[i.d].0.c].[i.e].1) 6.[i.0. StackCounter.1)) 7 Adding to chart: <23598> item(B. StackOperation]. c. Example 18 (Trace of aabbccdd) L(G2 ) = {an bn cn dn |n ≥ 0}.[B.3. where P is: S → aSd.il].3.ir].3.0. S).[#.[S].Adding to chart: <23724> item(S.2.2.[#.c].e].2) Adding to stack: <22863> item((i.2.S.1.0.0.ir].0.2.[B]. {i}.1.[i.1.[i.[a].il].0)) 4 Adding to chart: <10771> item(S.3. Adding to chart: <27798> item(B.2.1) Adding to stack: <22732> item((i.0.2. P.1) 5.B.e].2.1.ir].[b.

56 19 CHAPTER 5.[c].4) 20. R → Ra | a ¯ i 5.[S.6) 24. This bookkeeping is performed here by the order parameter.a]. instead of the one introduced at step 5.ir].0.[#.0.3.1).1)aabR[a][b]⇒(#. In other words. 0).4. 3] ∈ S 4 and [(j.1.il].[d].3) aabR⇒(i.8) 28.a].3) aabS ⇒(j .0.S. (#.[d.3.b].1.[].[c.0. aaRa ⇒ (?.[#.2. 3. Adding to chart: <23085> item(B.2. 3).0. RECOGNITION AND PARSING OF GILS Adding to chart: <22956> item(B.0) S ⇒ (i.1) aS ⇒ (i. Adding to chart: <10883> item(S. the completer operation may jump up two steps and complete the “R” introduced after step 3. 6.ir].0.2.1) aS ⇒ (i.ir].a]. 0).5) 22. Adding to chart: <27783> item(B. R → Rb | b ¯ j The following derivation is not possible (in particular step 4).S. S → • R.7) 27.0) S ⇒ (x.[#. The pairs in parenthesis represent the nodes of the graph-structured stack: (#.?) aaba i i ¯ i ¯ j 1 2 3 4 However. 2.2) aaS ⇒ (j .0.[]. 3] to S 4 Then the following are sequentially added to S 4 : a) [(#.[S].0.e].[]. 2].[#.[].0. R → a • .[#.[c.2. In the following example the square brackets represent substrings to be recognized.[#.[b].b].2. Adding to chart: <27654> item(B. Adding to chart: <10982> item(<start>.0.[B.a].2.[S.1.5) 21.[#. S → bS • . the following complete operation would be performed : Given [(#. the following sequences can be generated using Earley’s Algorithm if no ordering constraint is enforced at the Completer Operation.0)aaba[a][b] ¯ i 6 After recognized this substring.[d]. S → aS i 2.il]. Adding to chart: <10625> item(S.0.[B].7) 26. 3] ∈ S 3 : ¯ j add [(#.1. 0). 3.0. j . the corresponding productions of the grammar Gww repeated below and the string aaba 1.il].[c]. S → R • .0. Adding to chart: <10754> item(S. S → bS j 3.[#.4.6) 25.[#. Consider the language Lww = {ww |w ∈ {a. Adding to chart: <23342> item(S.2) aaS ⇒(i.6) 23.e].2)aabR[b]⇒ i i j ¯ j ¯ i 1 2 3 4 5 (i.[#.il]. S → R 4.[].2) aaR⇒ (i.[].[d.ir]. Adding to chart: <23215> item(S.3.0.8) yes The following example shows why some bookkeeping of the order of the derivation is required in Earley items.b].B.3. b}∗ }.

S → aSc j 3. . R → bd ¯ j 4. R → bRd ¯ j Grammar Gamb4 produces the following derivation: S ⇒ i#aSd ⇒ ji#aaScd ⇒ ji#aaRcd ⇒ i#aabRdcd ⇒ #aabbcdcd But it does not generate the string aabbcddc nor aabbdccd. 1. complete steps have to check that there is a corresponding pop-move item that has been completed for every item produced at a reduced push move. j}. This is depicted in the following ﬁgure 5. 1]. 0). 0). 2). d}. The ambiguity arises in the following conﬁguration S ⇒ aabR which would lead to the following items: [(#. GILS RECOGNITION USING EARLEY ALGORITHM b) [(#. and at completer cases. 2] and b d. At this point. In other words. 0] i 5. 0. R}. push push pop pop Figure 5. R → [(#. {a. the complete operation of the previous algorithm does not specify the correct constraints.2.2.2: Push and Pop moves on the same spine The following grammar produces alternative derivations which illustrate this issue. there is no way to control the correct derivation given no information on the pop moves has been stored. R → bc ¯ i 6. S → R 7. S → aS • . b. c. It cannot handle cases of what we call predict-complete ambiguity. R → • ∗ • b c.2. S → aS • . R → bRc ¯ i 5. 2).3 Reﬁning the Earley Algorithm for GIGs The Algorithm presented in the preceding section does not specify all the necessary constraints. i 57 c) [(#. {i. at some predict steps. #. Example 19 Gamb4 = ({S. S. S → aSd i 2. P ) where P is: 1. completed-stack ambiguity and stack-position ambiguity.5. 4. The exact prediction path that led to the current conﬁguration has to be transversed back in the complete steps. 4. 2]. The predict-complete ambiguity In this case.

58

CHAPTER 5. RECOGNITION AND PARSING OF GILS ¯ A solution is to extend the graph-structured stack to include I nodes. Whenever a push item is

being completed it has to be matched against the complement node on the stack. The existence of ¯ a corresponding I node stored in the stack has to be checked whenever an item with a reduced push ¯ node is completed. The following ﬁgure 5.11 depicts a graph that includes I nodes (pop nodes). It also shows some additional edges (the dashed edges) that depict the corresponding active nodes in the I domain. We will discuss this issue again in the next subsection.

i,1 $,0 j,1

i,2

i,3

i,3

i,2

j,2

j,3

j,3

j,2

j,1

Figure 5.3: A graph structured stack with i and ¯ nodes i

Completed stack ambiguity The graph-structured stack we presented so far is built at prediction steps and no additional computation is performed on the graph at completion steps. Therefore there is no way to represent the diﬀerence between a conﬁguration like the one depicted in ﬁgure 5.2 and the one we present in ﬁgure 5.4.

A

push

B

pop

Figure 5.4: Push and Pop moves on diﬀerent spines Such a diﬀerence is relevant for a grammar like Gamb5 Example 20 Gamb5 = ({S, A, R, B}, {a, b, c, d, e}, {i, j}, S, #, P ) where P is: S→AB A→R A → aAb |ab

i

R → aRd |ad

j

B → cBd |cd

¯ i

B → cBe |ce

¯ j

5.2. GILS RECOGNITION USING EARLEY ALGORITHM

59

Grammar Gamb5 generates the string aadbccde but it does not generate the string aadbcced. If we consider the recognition of the string aaaddbccdde, it will generate the following stack nodes for the derivation A ⇒ aaaddb: a(i, j, 1)a(i, j, 2)a(i, j, 3)d(→ j, 3)d(→ j, 2)b(→ i, 1). The notation (i, j, 1) indicates that two nodes (i, 1) and (j, 1) where created at position a1 , and (→ j, 3) indicates that the node (j, 3) was completed at the position d4 . Consequently only the nodes (j, 3), (j, 2) and (i, 1) are completed at the derivation point S ⇒ aaaddbB. The edges depicted in ﬁgure 5.5 are all valid at position 3 (i.e accessible from the item [∆, 3, R → aaa • d, 3] in S 3 ). However they would be still valid at position 6: [∆, 3, B → α • d, 6] in S 6

i,1 $,0 j,1 j,2 j,3 i,2 i,3

∗ ∗

Figure 5.5: A predict time graph Therefore, it is necessary to distinguish between prediction and complete stages. We need to introduce a new edge, a completion edge. The arrows in ﬁgure 5.6 are intended to designate this completion edge. They also indicate that there is a diﬀerent kind of path between nodes. So, the simple lines indicate that there was a potential edge at the prediction step. Only those paths with additional arrows were conﬁrmed at a complete step.

i,1 $,0 j,1 j,2 j,3 i,2 i,3

Figure 5.6: A complete steps in the graph

Stack position Ambiguity Two (or more) diﬀerent stacks might have the same active nodes available at the same position. However those alternative stacks might correspond to alternative derivations. This issue is illustrated by the two stacks represented in ﬁgure 5.7.

60

CHAPTER 5. RECOGNITION AND PARSING OF GILS

i,1 $,0 j,1

i,2

i,3

i,1 $,0

i,2

i,3

j,2

j,3

j,1

j,2

j,3

Figure 5.7: Two alternative graph-structured stacks

The alternative graph-structured stacks depicted in ﬁgure 5.7 might be generated at diﬀerent positions, e.g. in the following alternative spines as illustrated in the following ﬁgure 5.8.

push pop

Figure 5.8: Ambiguity on diﬀerent spines Notice that although these stacks have the same active nodes, they do diﬀer in the nodes that can be reached from those active nodes. They even might be continued by the same pop complement part of the graph. It must be noticed that the active nodes from the graph structures in ﬁgure 5.8 are indistinguishable from each other. Some information must be added to make sure that they point to active nodes in diﬀerent graphs. The information that will enable to distinguish the corresponding nodes in the graph will be the position in which the push nodes are generated. This information replaces the order parameter that was used in the preliminary version of the algorithm. In this case the graph structured stack will be more like the one that is proposed in Tomita’s algorithm, in the sense that there is not an unambiguous length of the stack at each node.

i,5 $,0 $,0 j,1 j,2 j,3 j,4 j,5 j,8 i,6 i,7

i,1

i,2

i,3

Figure 5.9: Two alternative graph-structured stacks distinguished by position

e. oldnode. We will discuss it again below. The following operations are possible on the graph-structured stack.initialnode). Therefore. as is speciﬁed in algorithm 5 and depicted in ﬁgure 5. Path(currentnode). The modiﬁcations are ¯ necessary due to the fact that the graph-structured stack contains both nodes in I and I. These operations enable the computation of the Dyck language over the graph-structured stack. This operation is the equivalent of the previous Pop function with a stack ¯ that keeps record of the nodes in I. We will use also the complement notation to designate the ¯ corresponding complements.2. A node can connect to any node at a preceding position. It ﬁnds the preceding unreduced push node after one or more reductions have been performed. GILS RECOGNITION USING EARLEY ALGORITHM 61 5. PushC(currentnode. ∆j = (δ j .4 Earley Algorithm for GIGs: ﬁnal version Revised Operations on the stack We will use the following notation.5. . We say ∆− ∈ I. for a node at position pi there might be pi−1 edges to other nodes. p) such that δ is an index and p > 0 (p s are integers). A node ∆− designates a node corresponding to a pop move in the stack. Creates a newnode if it is not in the graph and creates an edge from newnode to oldnode if necessary.oldactivnode. p) such ¯ ¯ that δ ∈ I. Creates a complete edge from currentnode to precednode if necessary. We say ∆i > ∆j if ∆i = (δ i . A node ∆+ designates a node corresponding to a push move on the stack. pi ). We will use a slightly more complicated version that takes into account completed nodes and the initial nodes introduced by the Push operation. Note that the position is determined by the corresponding position of the terminal introduced by the push production.10. It also creates an i-edge from initialnode to newnode. These edges will be represented then by triples: (newnode. p < 0. On the other hand ∆− will designate a push node which has been removed by ∆− .2. It retrieves all the nodes in I that are connected by an edge to the push node that currentnode reduces. Push(newnode. It is a pair (δ. precednode). and pi > pj . the path function obtains the nodes in I which can be active. We say ∆+ ∈ I. pj ). Therefore the number of edges connecting a node to a preceding one is bound by the position of the current node. i. after a reduce operation has been done. It is a pair (δ. initialnode). Therefore ∆+ will designate a node corresponding to a pop move which ¯ “removes” ∆+ .

2 i.−3 i.3 j. −1 j. −3 i. ∆ + 2 ∈ I 1 2 3 4 5 6 valueset = {} ¯ For edge((∆ − 1. While Path performs them at predict time. ∆ − 3 ) add Path2(∆ − 3 ) to valueset return valueset S S i.1 j. Path2 performs them at complete time. −1 j. −2 i.1 $. 2 j.0 j.3 i. −2 j.10: Paths and reductions in a graph structured stack with i and ¯ nodes i The following operation operates on the reverse direction of the Path function.1 $. ∆ − 3 ∈ I. −2 S S S S S Figure 5. Path obtains the closest non reduced nodes ¯ ¯ in I. Path2 returns a set of nodes in I accessible from another node in I.−3 i.0 i. −3 j.3 i.3 j. Path(∆ − 1 ): CHAPTER 5.2 i. Both Path and Path2 perform Dyck language reductions on the graph structured stack.62 Algorithm 3 . and ∆ − 1 . named edgeC. −2 j. RECOGNITION AND PARSING OF GILS ¯ ¯ where ∆ − 1 . The returned set of nodes represent points in the derivation at which to continue performing reductions at complete time. 2 j. Completed nodes are designated by a particular kind of edge. . The portion of the graph that is already reduced corresponds to completed nodeswhich already matched their respective complements.1 j. ∆ + 2 ) add ∆ + 2 to valueset ¯ For edge(∆ − 1 .

-1 j. [∆Ac .5.1 j. -3 Figure 5. Two parameters represent the portion of the stack: the current active node ∆Ac and the initial node ∆In . We use a substitution mapping cl from DI into DI ∪ {c}∗ . ∆2 ) add ∆2 to valueset ¯ For edgeC(∆ − 1 . The empty stack is then represented by the node (#. ∆ − 3 ∈ I. p > 0. GILS RECOGNITION USING EARLEY ALGORITHM Algorithm 4 . A → α • aβ. -1 j. The vocabulary corresponding to the set of indices (I). p < 0. p) such that δ ∈ DI and p is an integer. p) such that δ ∈ I. ∆ − 1 ∈ I) and : ∆2 ∈ I ∪ {#} 1 2 3 4 5 6 valueset = {} ¯ For edgeC((∆ − 1. -3 S S paths $. but inherit the last generated node. p) (∆) in the stack. We need also to represent those constituents that did not generate a node of their own ( a push or pop derivation). A node ∆cl (or cl(∆)) is a pointer (cl(δ). ∆In . j] ∈ S i ¯ Nodes are represented by pairs of elements in I ∪ I ∪ {#}.0 j. p) such that δ ∈ I. their ¯ ¯ complements (I) and the empty stack symbol (#). We refer to these as transmitted nodes. We ¯ ¯ say a node ∆− is in I if it designates a pair (delta.0 j.3 j. DI = I ∪ I ∪ {#}). 0). . 2 j.1 j. -2 j.2. We say a node ∆+ is in I if it designates a pair (δ.e. p) to the node (δ. 2 j.3 j.11: A graph structured stack with i and ¯ nodes i New Earley items for GIGs Earley items have to be modiﬁed to represent the portion of the non reduced graph-stack corresponding to a recognized constituent. ∆ − 3 ) add Path2(∆ − 3 ) to valueset return valueset c c S 63 $. deﬁned as follows: cl(δ) = cδ for any δ ∈ DI ∆cl represents a node (cl(δ). Path2(∆ − 1 ): ¯ ¯ ¯ where ∆ − 1 . and positive. will be denoted by DI (i. negative integers and zero respectively. -2 j.

∆R ) to Pathset ¯ For edgeC (∆−1 . The interpretation of these edge is that there is a path connecting the two ∆In nodes. ∆R 2) add Path(∆ − 1 .12. ∆R2 ) to Pathset ¯ else if ∆ − 1 > ∆R ¯ For edgeC(∆ − 1 . I the set of indices. I-edges are depicted in ﬁgure 5.64 CHAPTER 5. RECOGNITION AND PARSING OF GILS As we mentioned when we introduced the Push operation Push(newnode. ∆R2 ) add Path(∆ − 1 ∆ − 3 . ∆ + 2 . Notice that an I-edge can be identical to a push or pop edge. ∆ − 3 . ∆ + 2 . ∆ + 2 . ∆ + 2 ∈ I. ∆ − 3 ∈ I. therefore we will call them I-edges. ∆ − 3 ) For Path (∆ − 3 . It also takes into account the diﬀerence between nodes corresponding to completed constituents (lines 7-12) and nodes corresponding to incomplete constituents (lines 1-6). These edges will be introduced in the predict operation. ∆R . by the following Push function.12: I-edges Now that we have introduced I − edges we present a second version of the path computation that takes into account I − edges (here ∆R ) as boundary points to deﬁne a path. ∆R2 ) to Pathset ¯ For edge(∆−1 . ∆ + 2 . ∆R2 ∈ I ∪ I.oldactivnode. we will make use of an additional type of edge. ∆R ) to Pathset . This kind of edge relates ∆In nodes. ∆ − 3 ) and For Path(∆ − 3 . ∆ + 2 ) such that ∆ + 2 ≥ ∆R add Path(∆ − 1 .initialnode). StorePath(∆ − 1 . and ∆ − 1 . B I−edge α push or pop edge A Figure 5. ∆R2 ) add Path(∆ − 1 . ∆ + 2 . 1 2 3 4 5 6 7 8 9 10 11 12 ¯ If ∆ − 1 = ∆R : ¯ For edge(∆ − 1 . ∆R ): ¯ ¯ ¯ where ∆ − 1 . Algorithm 5 . ∆ + 2 .

GILS RECOGNITION USING EARLEY ALGORITHM Algorithm 6 (Earley Recognition for GIGs) . to retrieve the active nodes in I. S → S$ • .2..an in which the index δ + in I was introduced. In the pop case there are two subcases (1.. we represent nodes in the graph-structured stack with pairs (δ ± . #. 0] 2 For 0 ≤ i ≤ n do: Process each item s ∈ S i in order performing one of the following: a) Predictor b) Completer c) Scanner 3 4 If S i+1 is empty. pop or e-move). scanner.2. Initialize the graph-structured stack with the node (#. P ) be a GIG. Let w = a1 a2 · · · an be an input string. 0).a): ¯ the active node in the triggering item is in I or (1. These subcases are constrained by the type of production applied (push. Let G = (N. 0). In the second case. p) such that −n ≤ p ≤ n. Prediction and Scanner Operations Prediction Operations will be divided in diﬀerent subcases. The operations predictor. (#. Reject. n ≥ 0. and ai ∈ T for 1 ≤ i ≤ n. completer used in the For loop in 2 are modiﬁed as follows to perform the corresponding operations on the graph-structured stack: as we said. T. [δ] . 0). Create the Sets S i : 1 S0 = [(#.b) where the active node is in I. 0). δ ∈ DI and the absolute value of p (abs(p)) refers to the position in w = a1 . (#. p1 ) designates an item active node (∆Ac ) and I(δ 0 . Ac(δ 1 . S → • S$.2. If i = n and Sn+1 = {[(#. 0). This is also required for productions ¯ that check the top of the stack: (A → γ) when the triggering item Active node is in I. 0). the function path is used. I. 0]} then accept 65 The structure of the main loop of Earley’s algorithm remains unchanged except for the requirement that the initial item at S 0 (line 1) and the accepting item at S n + 1 (line 4) have an empty stack Active and Initial node: (#. S. p0 ) designates an item initial node.5.

p3 ) ∈ path((δ 1 . I(δ 0 . A → • γ. All the completer operations . p1 ).2. p1 ). A → α • aβ. j] ∈ S i . A → • γ. (A → γ) ∈ P δ2 and δ 2 ∈ I: add every [Ac(δ 2 . p2 ) ∈ path(δ 1 . B → α • Aβ. j] ∈ S i . p2 ). B → α • Aβ. pr )) 1. p1 ). Scanner If [∆Ac . j] ∈ S i δ= and (A → γ) ∈ P such that δ ¯ or δ = [δ 1 ] or (δ 2 . p1 ). p1 ). I(δ 2 . p1 ). p1 ). (δ 1 . (δ 0 . I(δ 0 . p2 ). p0 )) ¯ 1. (δ 1 . I(δ 2 . j] ∈ S i and (A → γ) ∈ P and δ 1 . p0 ).66 1. p1 ). ∆In . and push( (δ 2 . p3 ). i] to S i and push( (δ 2 . i] to S i such that: p2 = i + 1. j] to S i + 1 Completer Operations The diﬀerent subcases of Completer operations are motivated by the contents of the Active Node ∆Ac and the Initial Node ∆In in the triggering completed item (item in S i ) and also by the contents of the Initial Node ∆I0 of the combination target item (item in S j ). p0 ). p2 ). I(cl(δ 0 ). i] to S i 2. p2 ). p2 ). δ 1 ∈ I and δ 2 = δ add every [Ac(δ 1 . ∆In . (δ r . RECOGNITION AND PARSING OF GILS If [Ac(δ 1 . δ 2 ∈ I: δ2 add every [Ac(δ 2 . p0 ). p0 ). p2 ). p0 ). δ r . p1 ). (δ 3 . ¯ such that: δ 2 = δ 1 and p2 = −p1 (A → γ) ∈ P δ2 and ¯ δ 2 ∈ I = δ¯ : 1 add every [Ac(δ 2 . (δ 0 . p1 ).3 Predictor e-move If [Ac(δ 1 . i] to S i ¯ such that: (δ 3 . A → αa • β. p2 ). p0 ) ) StorePath((δ 2 . B → α • Aβ.b Predictor Pop: Active Node is in I ¯ If [Ac(δ 1 . A → • γ. p2 ). p0 ) ) StorePath((δ 2 . p0 ) ) 1. (δ 0 .a Predictor Pop: Active Node is in I If [Ac(δ 1 . (δ 0 . I(δ 0 . I(δ 2 . j] ∈ S i and wi + 1 = a: add [∆A . B → α • Aβ. pr )) and δ 2 = δ 3 and p3 = −p2 and push( (δ 2 . I(δ 0 . p2 ). p2 ). (δ 1 .1 Predictor Push CHAPTER 5. p2 ). A → • γ.2.

1). The result item preserves the active node from the triggering item and the initial node from the combination target item. p0 )) and for [Ac1(δ 0 . it means that only two dimensions are being used. For a subtree to be in the Dyck language over DI is as follows: the initial node has to contain the node for the ﬁrst index introduced in the derivation.3. At this step. This is the reverse of predictor 1. the initial node ∆In is inherited by the result item. p). We use the symbol ‘ ’ hereafter to indicate that the information stored in the corresponding ﬁeld is not required in the computation.2. Therefore if the information is stored in a three dimension table. These edges are of the form (∆In . ¯ 3. . j] ∈ S i : for edge((δ 3 . If a subtree is in the Dyck language over a ¯ DI. ( . The idea is to be able to compute whether a tree has a valid stack (i. GILS RECOGNITION USING EARLEY ALGORITHM 67 check properties of the combination target item in S j against edges that relate its the initial node ∆I0 to the initial node of the completed triggering item ∆In . we need to check also whether the stack associated ¯ with each subtree is a proper substring of the Dyck language over I ∪ I. A → αB • β. As a result of the combination. ). No further constraints are checked. p3 ). therefore. 3 Use the standard terminology concerning Dyck languages as found for instance in [39]. the transmitted nodes are consumed. p2 ). The ﬁrst completer subcase involves a combination item in S j that had been generated by an e-production. p2 ). A → α • Bβ. ie. ∆I0 = (cl(δ). k] to S i Subcase 3. a}. (δ 0 . However.5. p3 ). . This is the equivalent of a production S → aS¯ for a Dyck language over the alphabet {a. a stack that is in the ¯ Dyck3 language of the indices and its complements (I ∪ I)). a reduction can be performed. B → γ • . .3 e-move) and therefore its initial node is a transmitted node. A completion edge is introduced recording the fact that this push node ∆In has been completed. Combination with an e-move item: δ 0 ∈ cl(I ∪ I) If [Ac(δ 2 .a Completer A.e. k] ∈ S j such that: ¯ δ 0 ∈ cl(I ∪ I) add [Ac(δ 2 . p2 ) such that δ ∈ I ∪ {#} and 0 ≤ p2 ≤ n). p3 ). and the active node has to contain its inverse. The active node ∆Ac is also in I or it is the empty stack (i.b combines a completed triggering item generated by a push production (using the prediction operation 1. I(δ 3 . p0 ). the initial node ∆In is in I.e ∆Ac = (δ 2 . The constraint that there is an I-edge between ∆In and ∆I0 is checked. (derived by Predictor 1. I(δ 3 . ∆I0 ) (where the omitted element is the active node ∆Ac of the combination target). p0 ) I(δ 0 .

and (p2 > −1) : for edge((δ 3 . δ 0 . j] ∈ S i δ 3 ∈ I. ( .68 I_0: e−move CHAPTER 5. B → γ • . A → αB • β. There are two additional constraints. p0 )) such that: ¯ δ 0 ∈ I ∪ I. (δ 0 . p0 ). RECOGNITION AND PARSING OF GILS I_3 I−edge edge I_3 Ac_2 + Ac_2 + − − Figure 5. p0 ). The existence of an edge between ∆In and ∆I0 is checked as in the previous cases. A → α • Bβ. The ﬁrst is −p2 < pI . p3 ).14: Completer B Subcase 3. p3 ).13: Completer A 3. In this case ¯ ¯ the active node ∆Ac is in I (i. δ 2 ∈ I ∪ {#}. ∆In ∈ I. p2 ). I(δ 0 .b Completer B: Push with Active Node in I ∪ {#}.c also combines a triggering item generated by a push production. ). I(δ 3 . add [Ac(δ 2 . I(δ 0 .e ∆Ac = (δ 2 . p2 ) such that δ 2 ∈ I and −n ≤ p2 < 0). In other words the active node ∆Ac is a closing parenthesis of the Dyck language that has not yet exceeded its opening parenthesis. p2 ). It should be noted that the string position in which an index in I is introduced constrains the possible orderings of the control . k] ∈ S j pushC( (δ 3 . k] to S i and such that I_0 − + I_0 I−edge + − I_3 + push edge + Ac_2 + Ac_2 + Figure 5. p3 ). p0 )) and for [ . (p2 > −1) If [Ac(δ 2 .

k] ∈ S j such that: δ 0 ∈ I ∪ I. ( )) I_0 + − I_0 I−edge (d_1.2...)Ac ] ¯ The second constraint requires that ∆In has to have a matching closing parenthesis..p_1) + − I_3 + push edge mirror push/pop (d_3.. The substring of the Dyck language that corresponds to the completed subtree is indicated by the square brackets.. I(δ 0 . (p2 < 0).5. i.. In this case the active node ∆Ac is also in I ( like in subcase 3. and −p2 < p3 If [Ac(δ 2 . This constraint then expresses the fact that (Ac is outside the square brackets. k] to S i such that ¯ δ 3 ∈ I.. ¯ ∆In ∈ I. p0 )..)Ac ] ¯ ¯ The result item preserves the active node from the triggering item and the initial node from the combination item.. )In . two nodes ∆In = (i. do not constitute a j valid stack conﬁguration for a subtree... ∆Ac is the matching parenthesis of ∆In ..15: Completer C Subcase 3. 2) and ∆Ac = (¯ − 3). ¯ (Ac . I(δ 0 . ¯ 3.e.. I(δ 3 . ( . Following the preceding example )¯ has to be inside the square I brackets: (Ac . GILS RECOGNITION USING EARLEY ALGORITHM 69 language elements. But there is a ¯ diﬀerent constraint: ∆Ac = ∆In . For instance. ). B → γ • .c Completer C: Push with Active Node in I. add [Ac(δ 2 . p2 ). δ 0 .d is the last case that combines a completed item generated by a push production. In other words: ..[(I0 . p2 ).−p_1) A_2 − A_2 − Figure 5.c).. because ∆Ac should have met the corresponding matching Dyck element and a reduction should have been performed.(In . (p2 < 0) and ¯ −p2 < p3 there is a completed edge((δ 3 .(I . δ 2 ∈ I.. j] ∈ S i for edge((δ 3 . −p3 ). A → α • Bβ. p3 ). p_3) (d_1. p0 )) and ¯ for [ . A → αB • β..[(I0 . p0 ). so the node ¯ ∆In has to have been completed. p3 ).

The Active Node of the result item are updated. A → αB • β. p2 ) = (δ 3 . ∆Ac1 . p0 ). p3 ). p0 ). becomes the updated Active node of . The alternatives for performing a Dyck reduction on the graph are three: a) The reduction is performed by the path2 function: choose (δ 5 . This is the base conﬁguration to perform a Dyck reduction. which is ∆Ac1 . p1 ).e corresponds to edges (∆In . and checked to verify that they satisfy the control properties required by the case 3. This option is similar to the previous one. p0 )) and ¯ for [Ac(δ 1 . A → α • Bβ. −p2 ). ¯ ¯ 3.e. )). p5 ) ∈ path2(δ 2 . ¯ Subcase 3. p2 ) b) The reduction is performed by a single edge from the complement of the Active Node (∆Ac ) to a matching node of the initial node in the target combination item ∆I0 . I(δ 3 . i. (δ 0 . I(δ 0 . k] ∈ S j such that: δ 0 ∈ I ∪ I. p1 ). k] to S i I_0 such that ¯ δ 3 ∈ I. p1 )(δ 5 . there ¯ ¯ is an edge ((δ 2 . + − i−edge Ac1: (d_1.d Completer D: Push with Active Node in I. B → γ • . In other words. p5 . −p3 ) such that δ I ∈ I and 0 < p3 ≤ n. p1 ). (δ 0 . (δ 1 .p_1) I_3 + push edge Ac1: (d_1. the only diﬀerence is that ∆Ac was not completed yet at this stage (the path2 function requires completed nodes). Therefore the whole stack of the completed triggering item can be reduced and the active node of the result is updated to a node that precedes ∆In in the stack. (p2 < 0). p1 ). A node preceding the active node (∆Ac1 ) of the target item (δ 1 .( p2 < 0).d.70 CHAPTER 5. p2 ). c) The completed item initial node and active node are equal (∆In = ∆Ac ). ∆I0 ) where ∆In = ∆Ac1 .16: Completer D The following Completer cases involve completed triggering items generated by pop productions. I(δ 0 . ). RECOGNITION AND PARSING OF GILS ¯ (δ 2 . j] ∈ S i ¯ −p2 = p3 and δ 2 = δ 3 for edge((δ 3 . product of the reduction. add [Ac(δ 1 . and ∆Ac = ∆I If [Ac(δ 2 . δ 2 ∈ I. −p0 . p3 ). (δ 1 .p_1) I_0 + − reduced path Ac_2 = I_3 Ac_2 − Figure 5.

17: Completer E. (δ 0 .δ 2 = δ 3 for edge(δ 1 . and (δ 5 . p2 ). p5 ). p3 = −p1 .f Completer F.6 3. A → αB • β. (∆Ac− ). −p0 ) 2 else if p2 = p3 . I(δ 3 . −p0 . This case is relevant for the language Lgenabc edge to itself. p1 ). ) add [Ac(δ 5 . and −p2 > p0 and (δ 5 . p2 ) for edge((δ 3 . −p2 ). the Active Node is positive (∆Ac+ ). p2 < 0 : Compute path2 (δ 2 . p3 . or exceeds it. I(δ 0 . A → α • Bβ. (δ 0 . j] ∈ S i such that δ 2 δ 3 ∈ I.2. δ 0 ∈ I and p2 > p3 4 There ¯ is a complete path of I elements that reaches the one that complements δ 0 . (δ 1 . ∆In ). p5 ) ≥ (δ 0 . Pop items with Push items: p0 > 0. for [Ac(δ 1 . The information that ∆In was completed is stored by the completed edge (∆In . p0 )) where ¯ δ 3 = δ 1 .e Completer E. p3 ). k] to S i I_0 5 71 + − i−edge Ac_1 I_0 (d_4. p3 ). δ 1 ∈ I. 5δ ¯2 6 An was introduced after δ 0 was reduced. p0 ).p_4) path + − + pop edge reduced graph Ac: (d_4. −p0 )4 ¯ ¯ else if −p2 > p0 and there is an edge (δ¯ . p5 ) ∈ path2(δ 2 . last case Subcase 3. and (δ 5 . p2 ). k] ∈ S j such that ¯ If p1 > p0 . p5 ).p_4) + − I_3=A_2 Ac_2 − Figure 5. Part of this constraint might be speciﬁed in the Completer Case G. .5. B → γ • .f considers the combination of a pop item with a push item and checks the properties of the Active Node (∆Ac ) to verify that it satisﬁes the control properties required in 3. p0 ). 3. alternatively. p5 ) = (δ 0 . These two alternatives are allowed by p2 > p3 . GILS RECOGNITION USING EARLEY ALGORITHM the result. ). Pop items with Push items and graph reduction ¯ If [Ac(δ 2 . p1 )(δ 5 . δ 0 ∈ I and p0 > 0. which has not yet exceeded the position of its opening parenthesis. Either the Active Node is a closing parenthesis. I(δ 0 . p1 ). The Active node ∆Ac is updated according to the performed reduction. in other words ∆Ac > ∆In .c.

7 Here we could state the constraint p2 > p0 .h combine completed items generated by the 1. . I(δ 0 . (δ 0 . ( .72 CHAPTER 5. A → α • Bβ. p2 ). A → αB • β. 3. p2 ). p3 ). ( . p3 )( ) I_0 + I_0 i−edge + I_3 − pop edge Ac_2 > I_3 Ac_2 + Ac_2 + − − Figure 5. p3 )( ) 3. (δ 0 . A → α • Bβ. k] ∈ S j add [Ac(δ 2 . I(δ 0 . RECOGNITION AND PARSING OF GILS If [Ac(δ 2 . p2 ). A → αB • β. Completer H e-move If [Ac(δ 2 . B → γ • . j] ∈ S i such that δ 3 ∈ I. B → γ • . k] to S i The following table summarizes the diﬀerent Completer cases. j] ∈ S i : for [Ac(δ 2 . k] to S i pushC edge (δ 3 . I(cl(δ 3 ). p0 )) for [ . or compute a graph reduction if the condition is not met. p0 ). Therefore the target item has to have the same contents in the Initial and Active node as the completed item. I(δ 0 . Subcase 3. ). p2 ). p3 ). (δ 3 . p2 ). p2 ). p3 ). I(δ 3 . j] ∈ S i : such that p2 > p3 for edge((δ 2 . k] ∈ S j : add [Ac(δ 2 . ¯ for edge((δ 3 . ). p3 ). p2 ).3 predictor. k] ∈ S j add [Ac(δ 2 . A → αB • β. I(δ 0 .g combines completed items generated by pop productions with target items also generated by pop productions. k] to S i and pushC edge (δ 3 . p0 ).18: Completer F The following subcases complete the remaining alternatives. p0 ). (δ 3 . δ 0 ∈ I for [ .g Completer G Pop items combine with Pop items7 ¯ If [Ac(δ 2 . I(δ 3 . p3 ). B → γ • . p0 ). p2 ). p3 ). Subcase 3. A → α • Bβ. p0 )).

transmitted Speciﬁc Actions ∆I 0 ← ∆In pushC(∆In . I(δ 2 .3. −) 5. Predictor pop. might require O(i2 ). p2 ). A → α • Bβ.5. p1 ). Predictor e-move and Predictor Push operations on an item each require constant time. ∆I0 ) ¯ check for ∆In reduce: ∆A ← ∆In − 1 reduce with path2 pushC(∆In .(∆A = ∆I ) +/.(∆A > ∆In ) +/ +/TARGET ITEM transmitted +/+/+/+/. j] where: 0 ≤ j. It has a maximum of n iterations where n is the length of the input. . For each active node there might be at most i edges. which may have O(i) active nodes. p2 .3.1 Complexity Analysis Overview The algorithm presented above has one sequential iteration (a for loop).. therefore the pop procedure might take time O(i2 ) for each set S i .19: Completer G Summary of Completer Cases CASE A B C D E F G H COMPLETED ITEM +/+ + + transmitted ACTIVE NODE +/+ ¯ . ≤ i Thus there might be at most O(i3 ) items in each set S i . COMPLEXITY ANALYSIS I_0 73 − I_0 i−edge − I_3 Ac_2 − Ac_2 − Figure 5.∆Ac + + +/-. Each item in S i has the form: [Ac(δ 1 . Scanner. −) pushC(∆In . p1 .3 5.

P ) where P is : 1.S → BC 3. k] ∈ S j (i = j). p3 . ≤ i with at most all [ . I(δ 3 . B → α • γ. P ) where P is S → aSd i S → BC S → DE n m n n B → bB ¯ i B→b ¯ i C → cC E → cE ¯ i C→c E→c ¯ i D → bD D→b n n m n L(Gamb ) = {a b c d |n. This is true even for some ambiguous grammars such as the following: Gamb = ({S. [Ac(δ.. d}.B → bB n k m n 8. {a. This is a general analysis. It can be observed that this algorithm keeps a CFG (O(n3 )) complexity if the values of p1 and p2 are dependent on i. A → α • Bβ. k ≥ 1.. m + k ≥ n} .C → cC 10. also in S j . provided the information in the node Ac1(δ 1 .e.B → b ¯ i 5. c. The required time for each iteration (S i ) is thus O(i5 ). i.B → b 9. p1 ) is not taken into account in the combination.C → c ¯ i 7. C}. m ≥ 1} ∪ {a b c d |n. p3 ). (δ 0 . D.e. This is in general the case except for some restricted cases in which the node ∆Ac1 is bound to the node ∆In and therefore does not increase the combinatorial possibilities. i. C → cC ¯ i 6. }. In such cases the number of items in each set Si is proportional to i. where 0 ≤ j ≤ i Languages that have this property will be called constant indexing languages. pj ]. j] where: 0 ≤ j.h ) can combine an item from S i : [Ac(δ 2 . if for each item there is only one value for p1 and p2 for each i. {i. Once the CF backbone chooses either the “BC” path or the “DE” path of the derivation. p3 ). d}. The Completer Operations (3.S → aSd i 2. There are S n iterations then the time bound on the entire 1-4 steps of the algorithm is O(n6 ). S.B → bB ¯ i 4. p0 . m. B. #. b. then the complexity of this operation for each state set is O(i5 ). deterministic. {a. p1 ). C → c L(Gam2 ) = {a b c d |n. I0(δ 0 . E}. the ambiguity resides in the CFG backbone. RECOGNITION AND PARSING OF GILS The computation of the Path function might require O(n3 ) also. c. while the indexing is so to speak. p2 . ≤ j such that there is an i−edge((δ 3 . }. b. k. p0 )). only two dimensions are taken into account from the three dimensional table where i-edges and edges are stored. S. p0 ). p2 ). C. O(i) and the complexity of the algorithm is O(n3 ). I(δ 2 . p2 ). We consider in detail each subcase of the Completer in the next subsection. {i. m ≥ 1} In this case. A → α • Bβ. where: 0 ≤ j. In other words. B. #.a to 3. A diﬀerent case of ambiguity is Gamb2 = ({S. There are at most O(j 2 ) such possible combinations. Given that there are at most O(i3 ) items in each set. only one indexing alternative can apply at each step in the derivation.74 CHAPTER 5.

the sources of increase in the time complexity are a) ambiguity between mode of operation in the stack ( . COMPLEXITY ANALYSIS 75 In this case (where the ambiguity is between a pop and an epsilon-move the number of items corresponding to the rules 3. }. most algorithms for CFGs. and other grammar formalisms run much better than the worst case. O(n3 ) holds for grammars with constant or unambiguous indexing. b. .3. m. c. #. B. There is an important multiplicative factor on the complexity computed in terms of the input size which depends on the size of the grammar (see [6]). P ) would produce items proportional to i in each set S i : S → aSd i S → BC B → bB ¯ i B→ C → cC ¯ i C→ L(Gam3 ) = {an bk cm dn |n ≥ 1. All average case results reported are empirical. There are no mathematical average case results. In practice. Complexity results concerning formalisms related to Natural Language (including CFLs) mostly are worst case results (upper bounds) and they do establish polynomial parsing of these grammars. so the following results hold: O(n6 ) is the worst case. m + k = n} Therefore. {i. C}. {a. the similar grammar Gamb3 = ({S.5. This will allow to compare what is the impact of the indexing mechanism as an independent multiplicative factor. The expensive one is the ﬁrst case. k ≥ 0. S. Unambiguous indexing should be understood as those grammars that produce for each string in the language a unique indexing derivation.3. TAGs. Usually. d}. However.2 Time and Space Complexity In this subsection we compute the time and space complexities in terms of the length of the input sentence (n) and the size of the grammar. 7 and 8 would be bounded by the square of the number of b’s scanned so far. 8 Context Free grammars where the set of items in each state set is bounded by a constant. O(n2 ) for unambiguous context free back-bone grammars with unambiguous indexing and O(n) for bounded-state8 context free back-bone grammars with unambiguous indexing. The size of the grammar designated by |G| corresponds to the number of rules and the number of non-terminals. we keep separate the size of the context-free backbone and the indexing mechanism. the real limiting factor in practice is the size of the grammar. push. 5. or pop) through the same derivation CF path and b) a diﬀerent index value used in the same type of stack operation. In the analysis we present here. 4. The properties of Earley’s algorithm for CFGs remain unchanged.

2) and predictor 1. Complete The scanner operation requires constant time. Given there are two stack possible values (∆Ac and ∆In ). A → αa • β. ∆I0 ) and item: for [ . The push (1. ∆3 . j] ∈ S i : for every i-edge (∆In . The same grammar rule may have diﬀerent values for δ. . A → • γ. Predict. i] to S i A grammar rule is added to the state set. ∆In . Completer Case 1. C. p1 ). ∆0 . no recalculation of ∆Ac (No reduction involved) If [∆Ac . B → γ • . The computation of the path in Predictor takes at most O(n3 ) for each vertex. the complexity of the predictor operation is: O(|I|2 · |G| · n4 ). ∆In . j] ∈ S i and (A → γ) ∈ P : δ add every [(δ 2 . k are bounded by n. RECOGNITION AND PARSING OF GILS Analysis of Scan. There might be O(I · ∆In − 1) possible values for each edge and ∆In . p1 ). There is still the need to check for duplicates of the grammar rules. there are at most O(|I| · n) edges in a path and we consider edges to two vertices: the active node and the initial node. A → αB • β.3 operations take constant time regarding the input size. k] to S i The complexity is bound by the number of elements in S j that satisfy the edge condition. ∆I0 . p2 ). B → α • Aβ. We consider now the more simple cases of the Completer operation which have the following shape. It checks the current word (input aj ) against the terminal a expected by the scanner. A → α • aβ. Predictor Operations If [Ac(δ 1 .76 CHAPTER 5. k] ∈ S j add [∆Ac . The same grammar rules may apply at most n2 times (if it is a pop rule): there might be O(I ·n) possible values for Ac(δ 1 . Scanner If [∆A . j] to S i + 1 Predictor operations have in general the following shape. ∆I0 . A → α • Bβ. It depends on k and p0 : O(|I| · |G| · n2 ). j] ∈ S i and wi + 1 = a: add [∆A . ∆In . and for each value there might be O(I · n) path values.

∆In and j : 0 ≤ j. ) ¯ add [∆I0 . Each such item can be combined with at most O(|I|2 · |G| · n3 ) items in each set in S j . k] ∈ S j such that: ∆0 ∈ I ∪ I. ∆IO and k produce give O(n3 )). ∆In . A → α • Bβ. k] ∈ S j such that the following conditions imposed on the edges are satisﬁed: ¯ if pAc1 > pI0 . ∆I0 . ∆I0 . pAc . A → α • Bβ.3. ¯ There are at most O(|I| · |G| · n2 ) items in S j that satisfy this condition. This requires the pA value of ∆Ac to be equal to −pI in ∆In (their integer values are opposites).e Completer E. ∆Ac1 . k] to S i ¯ In each set in S i there might be at most O(|I|·|G|·n2 ) items that satisfy the condition ∆Ac = ∆I . A → αB • β. ∆I0 . ∆I0 . B → γ • . Checking if ∆I0 ∈ ¯ ¯ path2(∆Ac ) or there is an edge (∆Ac . pIn < 0 : Compute path2(∆Ac ) for edge(∆In . Subcase 1 ¯ If [∆Ac . abs(pAc ). Total complexity is then n × O(|I|2 · |G| · n3 ) × O(I · G · n2 ) = O(|I|3 · |G|2 · n6 ) The remaining cases of the Completer involve more complex operations because the value of ∆Ac has to be recalculated. n. We will analyze each of them in turn. Completer Case 2. recalculation of ∆Ac : Completer D and Completer E ¯ 3. These additional operations are performed provided certain constraints are met. so its bound is O(|I| · i3 ) for each set S i (∆Ac ) is bound by i).5. Pop items with Push items that re-compute the value Active node. ∆Ac1 . j] ∈ S i for edge(∆In . ∆In . ∆I0 . given the node ∆Ac1 has to be considered to compute the result item added to the S i set ( the values of ∆Ac . So the total is n × O(|I| · n) × O(|I| · |G| · n2 ) × O(|I| · |G| · n2 ) = O(|I|3 · |G|2 · n6 ) 3. ∆0 ) and ¯ for [∆Ac1 . ∆I0 . abs(pIn ). ∆Ac1 . add [∆Ac1 . There are O(n) possible values for each ∆Ac . ¯ ∆In = ∆Ac1 . performing reductions. ∆I0 ) where for [∆Ac1 . j] ∈ S i such that ∆Ac ∆In ∈ I.d Completer D: Push with Active Node in I If [∆Ac . B → γ • . ) is done in constant time. COMPLEXITY ANALYSIS 77 In each set in S i there might be at most O(|I|2 · |G| · n3 ) items. k] to S i Computing the set path2 for each ∆Ac takes O(|I| · n2 ) time. A → αB • β. ∆IO ∈ I such that ¯ ∆Ac = ∆I . and −pAc > pI0 and ∆I0 ∈ path2(∆Ac ) ¯ ¯ else if −pAc > pI0 and there is an edge (∆Ac .

that involves the combination of three constituents: [A[. k] ∈ S j for edge(∆Ac1 . rs] However the work load can be set either in the indexing mechanisms as is shown in the equivalent completor from [74]. If we compare the algorithm with LIG algorithms. Total complexity is then n × O(|I| · n) × O(|I| · |G| · n2 ) × O(|I| · |G| · n2 ) = O(|I|3 · |G|2 · n6 ) ¯ Finally we have not considered the case of the path2 with diﬀerent values than ∆I0 . ∆I0 . j. j. q] [C → Γ4 • . ∆In . ∆5 . j] ∈ S i such that ∆Ac = ∆In ∈ I: for edge(∆In .γ]Γ2 ..] → Γ1 • B[. Subcase 2 ¯ If [∆Ac . r.}. −. |D. p. |C. k.e Completer E. the only change corresponds to the added size of I. A → α • Bβ. q. k. k] to S i There are at most O(|I| · |G| · n2 ) items in each set S i that satisfy the condition ∆Ac = ∆In ¯ There are at most O(|I| · |G| · n2 ) items in each set S j that satisfy the condition ∆In = ∆Ac1 There are at most O(|I| · n) edges for each ∆Ac1 . i..b. The higher impact of the grammar size would be motivated in the following kind of completer required by LIGs (from [4]). within the same time bounds adding an operation to update the active node reducing all possible paths.γ]Γ2 .] → Γ1 • B[. the impact of the grammar size might be higher for the LIG algorithms and the impact of the indexing mechanism smaller. |D.] → Γ1 B[. γ. RECOGNITION AND PARSING OF GILS Total complexity is then n × O(|I|2 · |G| · n3 ) × O(|I| · |G| · n2 ) = O(|I|3 · |G|2 · n6 ) 3. A[. B → γ • ..... i.78 CHAPTER 5. s] [A[. A → αB • β. p. η.γ]Γ2 . Therefore if the set of indices is relatively small there is not a signiﬁcant change in the inﬂuence of the grammar size. If we compare the inﬂuence of the grammar size on the time complexity of the algorithm for GIGs and the one for CFGs. used to parse TAGs. |−. ∆In . −. We have seen then that O(|I|3 · |G|2 · n6 ) is the asymptotic bound for this algorithm. ∆I0 ) where ¯ ∆In = ∆Ac1 and items for [∆Ac1 . Pop items with Push items that re-compute the value Active node. −] [B → Γ3 • . where the set of nonterminals is {t. η. ) add [∆5 . ∆Ac1 . These can be done as a separate ﬁltering on the completed items in S i .

aj ∗ ∗ S γ A η α β a1 . k.. l A note on Space Complexity The space complexity is determined by the storage of Earley items. and the number of possible nodes is bound by n.η] → t[.5.ai Aγ 2. Given there are four parameter bound by n in each item.. t[. p... i. aj Figure 5. l b[η] → ∆ • .4. ai a i+1 .. i] is inserted in the set S j if and only if the following holds: 1. α ⇒ ai+1 . its space complexity is O(n4 ).. Storage of the graph-structured stack takes O(n3 ). i t[η r ] → Θ • . k t[η] → t[η r ] • . i. S ⇒ a1 .. q. q.ηη r ] 5. therefore it can be done in a n × n × n table. Storing the combination of i-edges and edges involves three nodes. p.20: Earley CFG invariant . j.4 Proof of the Correctness of the Algorithm The correctness of Earley’s algorithm for CFGs follows from the following two invariants (top down prediction and bottom-up recognition) respectively: Proposition 5 An item [A → α • β. −. PROOF OF THE CORRECTNESS OF THE ALGORITHM Type 4 Completor: 79 t[η] → • t[η r ]... j.. −. i.

If A → aX 1 .X n is a production of type (c.. µ = µ [x] or µ = [x]. #δ ⇒ waX k . taking into account the operations on the stack.X n γ. δ be in I ∗ .X n is a production of type (b. 1... i] is a valid item in the Set S j if and only if the following holds: ¯ 1.. S.. . #ν for some γ ∈ V ∗ and some ν ∈ (I ∪ I)∗ .. Deﬁne C ¯ to be the Dyck language over the alphabet I ∪ I (the set of stack indices and their complements). If A → X 1 . #δ and w is in T ∗ .. #δx ⇒ wX 1 . x ∈ I.. RECOGNITION AND PARSING OF GILS The corresponding invariants of Earley’s algorithm for GIGs can be stated in a similar way. ∗ An item [Ac(y. P ) as follows... w be in T ∗ and X i in (N ∪ T ).. C): {w| S.X n γ. # ⇒ a1 .80 CHAPTER 5. If A → X 1 . p0 ). δ is in C }.. We can obtain an explicit control language9 modifying the deﬁnition of derivation for any GIG G = (N.) (i.. If A → X 1 . #δxδ y¯ x Then..X k γ.. x ∈ I.. T. deﬁne the language of a GIG G to be the control language L(G. I.) or pop : µ = x. # ⇒ w. then: µ wAγ.. #δx¯ x ¯ 4.e.X n is a production of type (c. #δ or βAγ.X n γ. Let β and γ be in (N ∪ T )∗ . It is apparent that both deﬁnitions of a GIG language are equivalent...X k γ.. then: ¯ µ wAγ. This is speciﬁed in terms of the Dyck language over ¯ I ∪I 5. #δx ⇒ βX 1 . I(z.) or push: µ = x. L(G) to be: {w|#S ⇒ #w and w is in T ∗ }... 9 See ∗ [25] for control languages pp. #δxδ y ⇒ wX 1 . #δ ⇒ βX 1 . x ∈ I) then: βAγ. Assuming such an alternative deﬁnition of a GIG language. #δx 2.4. and δ y ∈ C then: ¯ µ wAγ. S.) or pop : µ = x. #δx 3. y ∈ I. p1 ). A → α • β....X k is a production of type (a. we address the correctness of the algorithm as follows: Proposition 6 (Invariants) .ai Aγ. x in I. 173-185 and [87] for a control language representation for LIGs.1 Control Languages ∗ We deﬁned the language of a GIG G.. #. x ∈ I.

ν. #νz µy π Such that: a. Condition b. (A → αβ) ∈ P δ 81 3. 76]. z.4. 5. y π A z ai a .aj . a framework that allows high-level speciﬁcation and analysis of parsing algorithms [75. δ ∈ DI iﬀ z µy π = epsilon. This framework enables the analysis of relations between diﬀerent parsing .21: GIG invariant We will use Parsing Schemata to prove this proposition. speciﬁes that the item has a transmitted node from the graph if the empty string was generated in the control language. The remaining conditions specify the properties of the string νz µy π relative to the control language C. #νδ ⇒ ai+1 .2 Parsing Schemata We use Parsing Schemata.. p0 ≤ i + 1 and p1 ≤ j. π ∈ C and νz µy πρ ∈ C for some ρ ∈ (I ∪ I)∗ . Condition a. which naturally embed the invariant properties of the Earley algorithm for CFGs.5. speciﬁes the properties for the diﬀerent types of productions that generated the current item. Condition d. δ = z iﬀ δ ∈ I ∪ I. ∈ cl(δ ).4... Figure 5. µπ ∈ (I ∪ I)∗ .. i+1 aj ν z µ yπ Figure 5. ¯ b. y = y ... d. speciﬁes the constraints related to the position correlation with the strings in the generated language. α. # γ .α η β µ . z. else δ = ¯ ¯ ¯ c. PROOF OF THE CORRECTNESS OF THE ALGORITHM 2. ∗ S ν a 1 . It will also help to understand the implementation of the algorithm we detail in the appendix. y ∈ I ∪ I iﬀ z = z .21 depicts the properties of the invariant. Condition c. speciﬁes the properties of information of the graph-structured stack encoded in the item.

.ai Aγ ∧ ∗ ∗ α ⇒ ai+1 . . DPred . 0. j]}.. k]... DComp . Parsing schemata are closely related to the deductive parsing approach (e. i.an that conforms to the item in question. [a. [A → αB • β. as we already saw are stored in sets according to each. Parsing Schema 1 (Earley Schema for CFGs) .[72]). j]|S ⇒ a1 . j + 1] DPred = {[A → α • Bβ. i.. A ﬁnal item F(PEarley ) ∈ I is correct if there is a parse tree for any string a1 .. n]}.. A Parsing schema extends parsing systems for arbitrary grammars and strings. deﬁned by I Earley below.aj } ∗ .g.an is composed of three parameters a) I as set of items that represent partial speciﬁcations of parse results b) H a ﬁnite set of items (hypothesis) encodes the sentence to be parsed and D a set of deduction steps that allow to derive new items from already known items. This parsing schema is deﬁned by a parsing system PEarley for any CFG G and any a1 . say j. i − 1.. F ∈ I. The corresponding set of items in the Schema is encoded by an additional parameter in the items Schema items.an ∈ Σ∗ by: I Earley = {[A → α • β. Deduction steps are of the form η 1 .. 0. represent the recognition of a [B → • γ.an } The set of valid items is deﬁned by the invariant of the algorithm.. j. Earley operations are deﬁned by the allowed deductions: DScan . i.. 0. k. j]}. i] | a = ai ∧ 1 ≤ i ≤ n}. RECOGNITION AND PARSING OF GILS algorithms by means of the relations between their respective parsing schemata. Earley items. Parsing Schemata are generalizations (or uninstantiations) of a parsing system P. j]. j. We present parsing schemata rather informally here. As an example we introduce the Earley Schema for CFGs. i. 0]}. j + 1]} such that A → αβ ∈ P and 0 ≤ i ≤ j HEarley = {[a. j]} DInit = { [S → • S.. i. i. A parsing system P for a grammar G and a string a1 . j] [A → αa • β. [B → γ • δ. η k sentence.. A set of ﬁnal items.. j] DEarley = DInit ∪ DScan ∪ DPred ∪ DComp F Earley = {[S → S • . ξ which means that if all the required antecedents η i are present. position in the string. The input string is encoded by the set of hypothesis HEarley . j.. n] |S ⇒ a1 . C Earley = {[S → S • . DScan = {[A → α • aβ.82 CHAPTER 5. DComp = {[A → α • Bβ. V(PEarley ) = {[A → α • β. then the consequent ξ is generated by the parser.

3 Parsing Schemata for GIGs The parsing schema for GIGs presented here is an extension of the parsing schema for CFGs given in the previous subsection. and they introduce prediction items η p in IC EarleyGIG . The parsing schema for GIGs corresponds to the algorithm 6 presented in section 5. Therefore IC EGIG . DPrPop1 .5. DPath b . DPath2 a . and DPrPop2 have the following shape. will be used to perform the corresponding deduction steps. Predictor steps can be decomposed as: η ij η ij η jj ηp η ij ηp Completer Steps can be decomposed as: η ik . a diﬀerent set of items. Items in IC EGIG will participate in some restricted deduction steps. DPath2 b .4. DPrPush . It can be observed that the major diﬀerences compared to the CFGs schema are the addition of diﬀerent types of Prediction and Completer deduction steps. η kj η ik . Those items in IC EGIG . DCompF . η ik . A Parsing system is correct if F(P) ∩ V(P) = C(P) 5. A parsing system (P) is complete if F(P) ∩ V(P) ⊇ C(P) (all correct ﬁnal items are valid). PROOF OF THE CORRECTNESS OF THE ALGORITHM 83 Deﬁnition 12 A parsing system (P) is sound if F(P) ∩ V(P) ⊆ C(P) (all valid ﬁnal items are correct).4. and they introduce completion items η p in IC EarleyGIG . Prediction Push and Pop deduction Steps. will represent edges and paths in the graph.2. and DCompG have the following shape. η kj η ij ∧ η p This kind of deduction step can be understood as shortform for two deduction steps. η ij η jj ∧ η p Completers DCompB . and this corresponds to the control language. However there is an additional type of deduction step performed in this parsing schema. η kj Those deduction steps that compute the the Control language are DPath a .

p)|δ ∈ DI ∧ 0 ≤ p ≤ j} and P is in {pop. p1 ). i] | a = ai ∧ 1 ≤ i ≤ n}. j] ∧ ¯ ¯ [pop. A → αβ ∈ P 0 ≤ i.. ∆In ∈ {(δ. 0]}. j] |ν = or ν = [δ Ac ]} ν DPrPush = {[∆Ac1 .84 CHAPTER 5. path. j. i − 1. RECOGNITION AND PARSING OF GILS Parsing Schema 2 (Earley Schema for GIGs) . ∆In . (δ 1 . S → • S$. i. 0). ∆Ac . i. This parsing schema is deﬁned by a parsing system PEGIG for any GIG G = (N. p)|δ ∈ DI. popC. ∆2 ]} such that ∆i ∈ {(δ. −p1 ). ∆I0 ] | δ 2 ∈ I}. (δ 1 . ∆I0 . A → α • aβ. (δ 1 . −p1 ). j + 1).an ∈ Σ∗ by: I EGIG = {[∆Ac . T. 0. i. j] [∆Ac . A → α • Bβ. ∆1 . ∆I0 . B → • γ. cl(∆)I0 . (#. [a. pushC. (δ 2 . i. DPrPop1 = {[(δ 1 . i. DScan = {[∆Ac . I. j] ∧ δ2 [push. j]. ∆In . j + 1] [∆Ac . j + 1). j. A → α • Bβ. ∆In . j. j]} such that ∆Ac . ∆I0 )]} ∪ {[P. ∆Ac1 .. j + 1]} DPrE = {[∆Ac . B → • γ. S. (δ 2 . j. j + 1). path2} HEGIG = {[a. A → α • β. push. i. p1 )+. #. A → αa • β. 0). −p1 ). DInit = { [(#. P ) and any a1 . ∆I0 . B → • γ. ¯ δ1 . p ≤ j and IC EGIG = {[P. or δ = cl(δ )} . ∆I0 ] | δ ∈ I]}. ∆Ac1 . j] [(δ 2 . j] ¯ ¯ [(δ 1 . A → α • Bβ.

∆R3 = ∆R1 . ∆3 +. ∆I0 ] ¯ ¯ [∆Ac1 . i. ∆1 − . ∆2 +. ∆R1 ] | − same conditions P atha } DPrPop2 = {[∆Ac −. DCompB = {[∆Ac +. ∆3 −. k. k] [∆Ac +. B → γ • . ∆R ]. ∆1 − . A → α • Bβ. j] ∧ [pushC. i. ∆Ac −. ∆I . A → αB • β. ∆1 +. ∆1 +. ∆2 +. [P. . i. ∆I0 ] [∆Ac1 . ∆I0 ]} DCompC = {[∆Ac −. j]. ∆3 −. . ∆Ac −. ∆1 +. [∆In . j] ∧ [pop. ∆R3 = ∆R4 . j]. ∆In . P = push) ∨ (∆R1 < ∆1 +. j]. ∆2 −. ∆2 +. ∆I0 . ∆1 . ∆R2 ] ¯ [path. [P. P = push) ∨ (∆R < ∆1 +. A → α • Bβ. ∆R4 ] ¯ [path. [path. ∆R3 = ∆R2 . ∆1 +.4. ∆R2 ] | (∆R = ∆1 +. ∆1 −. k]. ∆3 −. ∆R2 = ∆R . i. P = pushC)} ¯ DPath b = {[pop. ∆1 +. j. ∆I0 ] [∆Ac1 . ∆3 +. ∆R ]. B → γ • . [P. ∆R3 ] | (∆R1 = ∆1 +. ∆1 − . P = pushC)} DCompA = {[∆Ac . B → • γ. [path. PROOF OF THE CORRECTNESS OF THE ALGORITHM ¯ DPath a = {[pop. k] [∆Ac . [pushC. j. ∆In . [path. ∆1 +. ∆I0 . [path. . ¯ [P. ∆1 +. P = pushC)} ¯ DPath d = {[pop. ∆1 −. ∆1 +. ∆2 −. ∆In +. ∆I . ∆I ] . [path. ∆R3 ] | (∆R1 = ∆1 +. ∆1 . ∆I0 . ∆R ]. ∆R3 = ∆R1 . j]}. A → α • Bβ.5. ¯ δ1 85 ¯ DPath c = {[pop. ∆R1 ]. ∆R2 ] ¯ [path. [∆In +. [∆In +. ∆In +. ∆R2 = ∆R1 . P = push) ∨ (∆R1 < ∆1 +. ∆1 +. j]. ∆R ]. ∆4 +. ∆2 −. ∆1 −. ∆R1 ]. ∆]. ∆3 +. ∆3 − . ∆]. i. A → α • Bβ. ∆I ]|δ 1 ∈ I}. ∆1 −. A → αB • β. B → γ • k. CL(∆)I0 . ∆R1 ] ¯ [path. ∆2 +. ∆2 −. ∆R1 ] ¯ ¯ ¯ ¯ [∆1 . ∆In +. k. ∆1 −.

B → γ • . j]} ¯ DCompD = {[∆I −. k. k] [∆Ac1 . i. ∆2 −] ¯ [path2. A → αB • β. i. ∆I0 . j] ∧ [pushC. ∆In . ∆3 −] ¯ [path2. k. ∆1 −. i. ∆I0 . j] ∧ [pushC. ∆1 −. A → α • Bβ. ∆I0 . i. A → α • Bβ. ∆I0 . A → αB • β. B → γ • . [path2. . k] [∆Ac1 . ∆1 +. [∆In −. A → αB • β. RECOGNITION AND PARSING OF GILS [∆Ac +. i. ∆1 +]. A → α • Bβ. A → αB • β. ∆I0 −. CL(∆)I0 . ∆I0 . ∆1 −. [pushC. [∆In −. ∆I0 ] |∆Ac > ∆In } ¯ DPath2 a = [pushC. B → γ • . A → α • Bβ. i. ∆2 −]. ∆1 − . ∆I0 −] [∆Ac1 . i. j] } DCompF = {[∆Ac . j]. ∆1 +. j]. ∆2 −. ∆In −. k. j]. i. . ∆3 −] DCompG = {[∆Ac . ∆I0 +] [∆Ac1 . i. k] [∆Ac . A → αB • β. k] [∆Ac . [∆In −. j] } . [pushC. ∆In +. k. j]. j]} ¯ DCompE = {[∆Ac −. [path2. ∆I0 ] ¯ [∆In −. ∆Ac2 −] [∆Ac2 −. ∆In −. ∆I0 . i. ∆In . k]. ∆I0 ]} DCompH = {[∆Ac1 . ∆I0 .86 CHAPTER 5. ∆In −. [∆Ac1 . A → α • Bβ. ∆1 +]. ∆I0 ] [∆Ac1 . ∆Ac −. ∆I0 +. ∆2 −] ¯ DPath2 b = [pushC. A → αB • β. j]. [∆In +. i. ∆In −. B → γ • . ∆I0 . ∆I0 −. . k. B → γ • .

In other words that the deduction steps preserve the invariant property. · · · . then prove that all ξ with d(ξ) = m. (y. (x. Show that all the viable items (all possible derivations are deduced by the algorithm). (z. η k ξ ∈ D such that {η 1 . it holds that ξ ∈ W . The derivation length function is deﬁned according to the properties of the parsing algorithm. νx = µyπ such that y ∈ I. PROOF OF THE CORRECTNESS OF THE ALGORITHM A correctness proof method for parsing schemata This method is deﬁned in [76] 87 • Deﬁne the set of viable items W ⊆ I as the set of items such that the invariant property holds. Deﬁnition 13 (derivation length function ) 10 Let (P) be a parsing schema. the items corresponding to the control language. #νx for some γ ∈ N V ∗ and some ν ∈ (I ∪ I)∗ and x ∈ I. we need also an invariant for the computation of the control properties.11 Proposition 7 (Invariant of the Path function) .. It has to be shown that for all η1 · · · ηk ξ ∈ D with η i ∈ H ∪ W. and π ∈ C ∗ . (ii) for each ξ ∈ W there is some η 1 . η k } ⊆ W and d(η i ) < d(ξ) for 1 ≤ i ≤ k. to use in the induction proof. 2. An item [path. · · · . ξ ∈ V(P). p0 )] is valid for a string a1 · · · aj if and only if the following holds: ¯ ¯ 1. 1 ≤ i ≤ k..aj γ. Because we introduced another class of items. • Proof of completeness: W ⊆ V(P). −p2 ).4. A function d : H ∪ W → N is a dlf if (i) d(h) = 0 for h ∈ H. p2 > p1 ≥ p0 3. IC EGIG . Assume that any item η in W with derivation length less than m is obtained (if d(η) < m then η ∈ V(P)). • Proof of soundness for all the deduction steps: V(P) ⊆ W. : W ⊆ I a set of items. This proof uses a so-called deduction length function (dlf ). # ⇒ a1 . S.5. p1 ).

(A → αaβ) ∈ P δ ∗ c. Let G = (N. #ν for some γ ∈ V ∗ and some ν ∈ (I ∪ I)∗ .. Predict Completer) . #νz µy π 10 From 11 The ∗ [76]. I(z. where correct means that the proposition 2. Let 0 ≤ i. i] is in S j −1 and η j −1 Since η j −1 is correct... #. i] is in S j if and only if η j −1 : [Ac(y. then scan ηj ¯ a. T.22: Path invariant Lemma 7 (GIG items soundness is preserved under Scan. b. p1 ). correctness of the push items is straightforward. A → αa • β. Proof .. η k item. V(P) ⊆ W.. Scanner. # µ y x γ ρ . µ y aj π π a j Figure 5. For all η 1 · · · η k ξ ∈ D with η i ∈ H ∪ W. RECOGNITION AND PARSING OF GILS S z S zy y a1 # x γ ρ a 1 . n ≥ 0 where each ak ∈ T for 1 ≤ k ≤ n. j ≤ n. η k are correct items. An item η j : [Ac(y. Regarding the pop items it is derived from the path function.. p1 ). S) be a GIG and let w = a1 · · · an .2.. p0 ). p0 ).88 CHAPTER 5.aj −1 . # ⇒ a1 . 1 ≤ i ≤ k it holds that ξ ∈ W This can be rephrased as follows in terms of the algorithm presented in section 5. • Case 1. I(z. α. P. for grammar G and input w and η i . (the invariant property) holds. I. S.. A → α • aβ. η j then η j is a correct • If η i .ai Aγ. . #νδ ⇒ ai+1 . • If η i is a correct item for grammar G and input w and η i η j then η j is a correct item.

. (B → ξ) ∈ P such that δ Since η ij is correct. p0 )) y e. . ij predict η jj ∗ .. #νzµyπx ⇒ y ¯ ∗ . allows us to conclude that η j is a correct item in S j . u = y . j + 1). u = y. (y. #νzµyπx iii. p3 ). p1 = p2 . η push η path [path. #νz µy π by b. p0 )) e. p3 = −p1 . η e. S.. u = x. #νzµyπ y ¯ It should be noted also due to η pop is obtained in this derivation. B → • ξ.. x . δ = . the following derivations follow: η pop . and we conclude the proof for Case1. p1 ). p0 ). j] is in S j if and only if: η ij : [Ac(y.ai Aγ. #νδ ⇒ ai+1 .) and the following deduction steps apply according to the value of δ i. #νzµyπ from (B → ξ) ∈ P ii. p1 ). p3 = j + 1. (z. b. This together with a. . PROOF OF THE CORRECTNESS OF THE ALGORITHM ∗ 89 Now αaj . δ = y . #νzµyπ from η ∗ ij ∗ (a. S. p2 ). δ = x ∈ I.aj . (B → aξ) ∈ P . #ηδ ⇒ (ai+1 . α. #ν for some γ ∈ V ∗ and some ν ∈ (I ∪ I)∗ . • Case 2. (z.4. (x. i] is in S j . −p1 ).(A → αBβ) ∈ P δ c. p3 = p0 . # ⇒ a1 . #νzµy π Therefore: (this is common to all the subcases) d. (y. p1 ). p2 = j + 1 η ij predict η jj ∧ η push η push = [push. I(x. I(z. (B → ξ) ∈ P . y .. #νzµyπ y ⇒ ¯ ∗ . Predictors An item η jj : [Ac(u. (¯. p2 = −p1 ¯ ¯ ¯ η ij predict η jj ∧ η pop η pop = [pop. and c. # ⇒ a1 · · · ai ai+1 · · · aj Bβγ. #νzµyπ ⇒ x . b. x = y . z ) ¯ . and c. ∗ ¯ a. x = cl(z).aj . A → α • Bβ..5.

p1 ). z ] is correct. (This item corresponds to the edges that relate the nodes in η ij and η kj Given η ik and η kj are valid items we obtain: ∗ ¯ a. A → αB • β. (x . in the previous page) . (y. p3 ). #νzµyπ x from (B → ξ) ∈ P ¯ δ such that #νzµyπ x = #ν xπ x from d. ∆Ac1 . x. I(z. ¯ x η ij . p3 < 0. y. ¯ ¯ It should be noted also that as a consequence of η pop . z ) η pop = [pop. the same deductions as in the previous case are triggered: η pop .ai Aγ. x. I1(x. (z. η path1 = [path. p1 ). p0 )] where p is either push or pop. I(z. #ν for some γ ∈ V ∗ and some ν ∈ (I ∪ I)∗ . b. # ⇒ a1 · · · ai ai+1 · · · aj Bβγ. then d. x . p0 ). z ]. A → α • Bβ. . I(z.. η push η path η path2 by Dpath b η pop . i] is in S k and an item η p : [p. B → ξ • . x . y . p0 ). ¯ by Dpath a or η pop . x ∈ I. δ = x . η push η path1 Case 3.90 CHAPTER 5. Completer An item η ij : [Ac(y . y. z ) such that x ∈ I and z is either z or z . p1 ). #νz µy πδ ⇒ ∗ ∗ ij (a. abs(p3 )). abs(p3 )). η path2 = [¯. (x . I1(x. x . z ].. k] is in S j and [Ac1(u. # ⇒ a1 . −p3 ). (y. ¯ ¯ ¯ y x. p2 ). z ). p2 = p3 . z). y. η push η path1 η path2 by Dpath b where η pop = [pop. p1 ). η path predict η jj ∧ η pop η path ((y. z) and η push = [push. y ∈ I. (¯. (B → ξ) ∈ P . y . RECOGNITION AND PARSING OF GILS where η pop = [pop. y. S. p0 )] x Since η path = [path. #νzµyπ = #ν x π such that π ∈ C. ¯ ¯ ¯ iv. #νzµyπ from η . p3 ). u = x. η push = [push. i] is in S j if and only if an item η an item η kj : ik : [Ac(y. x = x . and c. p2 ). Therefore S.

p2 )..4. p0 ). I(z.5.. η p . η kj . the control language spans in positions i. p3 ) in η kj .. ξ. if and only if: z ∈ cl(i).aj . p3 ). PROOF OF THE CORRECTNESS OF THE ALGORITHM b. aj #νz µu πx µy π This derivation together with a. A → αB • β. I(z. η kj . #νz µu πδ ∗ ∗ from (B → ξ) ∈ P δ f. i] is a correct item in S j . p1 ). p2 ). #νδ ⇒ ai+1 . Both substrings are substrings of the Control language but their concatenation might not be. p0 ) in η ik Ac(y. η ik . x ∈ I and p2 ≥ p3 > 0 η pushC = [pushC. B. therefore the Consequently the result subtree contains #ν xµ yπ = which is in the control language. #νδ ⇒ ai+1 . k. η ik . α. η ik . #ν δ for some (B → ξ) ∈ P δ Now compose some of the pieces: d. Those conditions are checked as follows according to the corresponding deduction step: A. (z.ak Bβ.. ηp Complete η ij (η kj initial node:+. η kj . ⇒ ai+1 · · · ak ξ. ⇒ ai+1 · · · ak ak +1 · · · . η p Complete η ij ∧ η pushC (η kj has positive initial and active nodes) if and only if: y. The individual properties of zµu and xµy are checked using the information stored at: Ac1(u. I1(x.. We need to check the information in the corresponding nodes to validate the substring properties. #νz µu π for some (A → αBβ) ∈ P δ ∗ 91 from η ik and ⇒ ak +1 .. The crucial step is checking the consistency of: #νzµuπxµ yπ in f. αB. η p Complete η ij (η ik is a transmitted item). active node:-) if and only if: . #νz µu π e. p0 )] therefore given #ν (xµ (yπ is in the control language for some ρ then #νzµuπxµ yπ is also in the control language for some ρ C. prove that η j : [Ac(y. #ν x µy π ∗ c.ak . (x.

(¯. η ik . η kj .) if and only if: x ∈ I. p0 < 0. . if and only if: η p = [p. p3 ). p2 ). p2 )]. −p3 ). ¯ η path2 guarantees that the result is in the control language. (x. p3 > 0. η p and π ∈ C. x ∈ I.92 CHAPTER 5. p3 > 0. (u. (x. η ik . . p3 )] ¯ z ∈ I. ¯ Therefore #νzµuπ(xµ x)π = #νzµuπ ¯ E. (¯. η path2 Complete η ij ( x reduces u. The current active node is negative). RECOGNITION AND PARSING OF GILS ¯ x ∈ I. y ∈ I. abs(p2 ) ≤ abs(p0 ) x = u. p3 = −p1 ¯ Result string: #νzµ(uπ u)µ y π which is equivalent to #νzµπ µ y π . p0 )] u η path2 = [path2. A reduction is performed. (¯. ηp Complete η ij if and only if x ∈ cl(DI). F. p2 = −p3 . (y. x ∈ I. p3 < 0. (x. p1 ). ηp Complete η ij ∧ η p 2 if and only if η p 2 = [popC. η kj . η ik . ηp Complete η ij ∧ η p if and only if: η p = [popC. η p Complete η ij (xµ yπ is in C. η kj . η ik . p3 ). p3 )] ¯ z. abs(p2 ) < p3 η p = [popC. (x. η kj . y = x. (z. p3 < p2 Result is νzµuπx)µ y π G. Therefore: #νzµuπ(xµ y)π = #νzµuπ(xµ x)µ y)π ¯ D. η kj . η ik . −p3 )] x x requirement that x has to be reduced. (y . the initial node is a transmitted node. −p1 ). Result is νzµuπx)µ y π H.

It states that all the derivations in the grammar will have the corresponding item in the set of states. #νzν yν } where δ = z if δ ∈ I ∪ I else δ = ∗ ξ ∈ D such that {η 1 · · · η k } ∈ W and d(η i ) < d(ξ) for such that #νzν yν satisﬁes the conditions imposed in proposition 2. −) #νzµuπ +:u Table 5. ¯ µ = µ x )µ reduce: #νz µ u π ¯ #νz µ(u π u )µ y π reduce: #νz µ y π #νz µu πx )µ y π pushC(∆In .4. p1 ).(x < y) +/ TARGET ITEM Ac1(u. p0 ). . p1 ) I(z. then an item ξ = [Ac(y.2 and Proposition 6. p2 ) +/+/+ –+ + – + -x=u ¯ cl(xµyπ ) = –: y=x ¯ +/. # ⇒ a1 · · · ai Aγ. p0 ) cl(z µu π) = +/+/+/+/+ +/-. Result x µy π #νz µu π(x µ (y π #νz µu π(x µ y )π . A → α • β. S. p3 ) Ac(y.1: Conditions on the completer Deductions Lemma 8 (Second direction. i] is inserted in the Set S j . If 1. I(z. #νδ ⇒ ai+1 · · · aj . This lemma is equivalent to the following claim in terms of the algorithm presented in section 5. CASE A B C D E F G H COMPLETED ITEM I1(x. Completeness) .1 summarizes the conditions speciﬁed by the Completer Operations. α. For each ξ ∈ W there is some η 1 · · · η k 1 ≤ i ≤ k.5. #ν 2. (A → αβ) ∈ P δ ∗ ¯ 3. PROOF OF THE CORRECTNESS OF THE ALGORITHM cl(x)µ y π = Therefore the result is νzµuπ 93 The following table 5.

p2 ). because of the Completer operation. The derivation length function is based on the treewalk that the Earley algorithm performs. #ν µ λ π 12 ∧ } ⇒ ai+1 · · · aj . I(z. #νδ ⇒ ai+1 · · · aj . Therefore the derivation length function is the same as deﬁned by [76] as follows: d([Ac(y. j − 1. A → α • aβ. # ⇒ a1 · · · ai Aγ . #ν ⇒ a1 · · · ai . i] is in S j . (A → αβ) ∈ P δ ∗ 3. p0 ). #ν ⇒ ai+1 · · · aj . A → αB • β. I(z. 12 Notice that induction on the strict length of the derivation would not work. #νzν yν ∗ ¯ } if δ ∈ I ∪ I else δ = Then η = [Ac(y. The conception of the derivation length function is similar to the kind of induction used by [39] on the order of the items to be introduced in the set S i . #ν zν uν xµyπ with minimal µ + ρ ¯ then if δ = x ∈ I ∪ I η = [Ac(u. • Completers: ξ = [Ac(y. i. p0 ). #ν . d(η) = d(ξ) − 1 and ζ. A → αa • β. #ν zν uν δ ⇒ aj +1 · · · ak . #ν zν uν B. #ν ∧ δ. i] Let 1. # ⇒ a1 · · · ai Aγ . α. p1 ). p0 ). and 3. #ν α. RECOGNITION AND PARSING OF GILS The proof by induction on the derivation length function d applied to the derivations speciﬁed in 1. I(z. A → α • Bβ. The modiﬁcation of the Earley algorithm for GIGs does not modify the treewalk that the algorithm performs. ν zν yν • Scanner: ξ = [Ac(y. i] is in S j −1 and from ζ = [a. S. . # ⇒ δAγ. I(z. i] in S k Let S. A → α • β. j] ∈ HGIG d(ζ) = 0. p0 ). #ν 2. #ν zν uν ⇒ γ. p1 ). p0 ).94 CHAPTER 5. j]) = min{π + 2λ + 2µ + j | S. #ν zν uν δ δ ρ µ ∗ and γ. p1 ). η ξ. p1 ). I(z. α. such that the invariant holds for those items previously introduced in the item set.

p1 ). j] is in S k and d(η) < d(ζ) = d(ξ) − 1. (z. (z. η. I(cl(z). #ν ⇒ αBβ. ζ ξ if δ = and xµyπ = η = [p. ζ = [Ac(y. I(x. η . π. (δ. (u. λ. p2 ). p1 ). η. I(x. j] is in S k and d(η) < d(η ) < d(ζ) = d(ξ) − 1. p3 ). p0 ). p1 ). #ν . B → γ • . #ν ⇒ a1 · · · ai . p3 ). η. ζ if δ = ξ 95 and xµyπ = ζ = [Ac(u. p0 ). A → α • Bβ. B → γ • . p0 )] d(η) = d(ξ) − 1 = d(η p ) . p2 ). (x. γ . µ such that S. (z. p3 ). (u. I(z.4. j] is in S k and d(η) = d(η ) − 1 < d(ζ) = d(ξ) − 1. j] in S j Let S. p1 ). B → γ • .5. p1 ). #ν and let δ. #ν and A. η . (y. p3 ). p3 ). ζ = [Ac(y. #ν δ ⇒ ai+1 · · · aj . p0 ). η . #ν δ δ λ π ∗ α. p0 )] such that p = push or p = pop. ν zν yν µ } with π + 2λ + 2µ minimal. # ⇒ a1 · · · aj Bγ . ζ ξ • Predict: ξ = [Ac(y. p0 )] such that p = push or p = pop. Then η = [Ac(y. PROOF OF THE CORRECTNESS OF THE ALGORITHM η = [p. # ⇒ δAγ . B → • γ. j] η η ξ if δ = ξ ∧ ηp and η p = [p. (x. δ. I(z. p1 ).

The Prolog database is used as a chart which plays the same role as the state sets in Earley’s algorithm. if necessary. chart-based deduction procedure is as follows (from [72]): 1. RECOGNITION AND PARSING OF GILS Therefore from Lemma 7 ( V(P) ⊆ W).96 CHAPTER 5. and remove it. Any new potential items are added to an agenda of items for temporarily recording items whose consequences under the inference rules have not been generated yet. the prototype is not particularly eﬃcient. However. 2. the relation between the abstract inference rules described in the previous section as parsing schema and the implementation we used is extremely transparent. Items should be added to the chart as they are proved. Given that the parsing schema abstracts from implementation details of an algorithm. agenda-based inference engine described in [72]. the inference engine provides the control and data types. The general form of an agenda-driven. 5. and Lemma 8 W ⊆ V(P). Initialize the chart to the empty set of items and the agenda to the axioms of the deduction system. When an item is removed from the agenda and added to the chart. its consequences are computed and themselves added to the agenda for later consideration. However. Repeat the following steps until the agenda is exhausted: (a) Select an item from the agenda. Those new potential items are triggered by items added to the chart.5 Implementation In order to perform some tests and as a proof of concept. (b) Add the trigger item to the chart. called the trigger item. Because the inference rules are stated explicitly. the parsing algorithm described in section 5. The chart holds unique items in order to avoid applying a rule of inference to items to which the rule of inference has already applied before. This is performed using the subsumption capabilities of prolog: those items not already subsumed by a previously generated item are asserted to the database (the chart). as a meta-interpreter. Encodings of the parsing schema as inference rules are interpreted by the inference engine.2 was implemented in Sicstus Prolog on top of a general-purpose. each new item may itself generate new consequences. we have proved the correctness of the Parsing Schema V(P) = W. .

0). The number of items generated for the Mix and the copy languages were as follows: . otherwise it is not. In this implementation the control language was not represented by separate items but as side conditions on the inference rules. 3. S → S • . the goal is proved (and the string recognized). generate all items that are new immediate consequences of the trigger item together with all items in the chart. n]}. Tests on the following languages were performed: • {an bn cn |n ≥ 1}. The axioms correspond to the initial item in the Parsing Schema: DInit = { [(#. {ww|w ∈ {a. (#. b}+ } • Grammar Gamb4 which generates aabbcdcd but does not generate aabbcddc nor aabbdccd. S → • S$. {an bn cn de n |n ≥ 1}. c}∗ and |a|w = |b|w = |c|w ≥ 1} Critically the most demanding was the mix language due to the grammar we chose: Gmix presented in chapter 2. {an bn cm dm en f n g m hm in j n |n ≥ 1} • {an bn wwcn dn |n ≥ 1. • The mix language {w|w ∈ {a. 0).5. and add these generated items to the agenda. (#. If a goal item is in the chart. IMPLEMENTATION 97 (c) If the trigger item was added to the chart. b. b}∗ } • {w(cw)+ |w ∈ {a. 0. The goal corresponds to the ﬁnal item in the Parsing Schema: F EGIG = {[(#. • Grammar Gamb5b which generates aacdbbcd and aadcbbdc but does not generate aacdbbdd nor aacdbbdc (a variation of Gamb5 presented above). b}+ } {an (bn cn )+ |n ≥ 1}. 0). {an bn cn dn |n ≥ 1}. 0]} and the encoding of the input string. • {an bn cm dm en f n g m hm |n ≥ 1}. 0). This grammar has a high degree of ambiguity.5. w ∈ {a. 0. which where performed by procedures which implemented the path function over the graph representation.

800 5.625 104.500 ≈ 2. ≈ 500 ≈ 2. Therefore the set of items has to encode the corresponding top-down prediction that aﬀects the stack of indices.. The set of preﬁxes of right sentential forms that can appear on the stack of a shift-reduce parser are called viable preﬁxes in context free LR-parsing. IN )..000 ≈6. An item A → β 1 • β 2 is valid for a viable preﬁx αβ 1 if there is a derivation S ⇒ αAw ⇒ αβ 1 β 2 w.736 50. the technique we present here converts an LR GIG into a deterministic LR-2PDA according to the deﬁnition presented in Chapter 2..000 20.6.6 LR parsing for GILs An LR parser for a CFL is essentially a compiler that converts an LR CFG into a DPDA automaton (cf. [80]). This approach can be extended to a Generalized LR parsing approach. It is also more complex because GIL derivation requires leftmost derivation for the stack operations. [41]. Both [75] and [3] describe transformations of Earley Parsing Schemata to LR Parsing Schemata. [2]).000 ≈ 9. RECOGNITION AND PARSING OF GILS n4 1296 10. The notion of valid items for GILs is more complex because a GIG LR-item has to encode the possible conﬁgurations of the auxiliary stack. The sets that deﬁne the states in GIG LR parsing are composed by a pair of sets (IT.976 Mix L. We will refer to the connections between Earley parsing and LR parsing to clarify this presentation. [2]). if multiple values are allowed in the parsing table (cf. We will do this in such a way that the set of items contain information not only of what possible items belong to the set but also of the possible indices that might be associated to the set of parsing conﬁgurations that the items describe.000 ≈ 16. We say a GIG item index pair [ δ. The similarities of Earley Parsing and LR parsing are made explicit in those transformations. A → β 1 • β 2 ] where δ is in I ∪ {#} is valid for a viable GIG µ preﬁx αβ 1 if there is a derivation using the GIG context free backbone: S ⇒ αAw⇒ αβ 1 β 2 w and there is a GIG derivation S ⇒ γ i a1 . In the GIG case.000 Copy L. We use this notion of viable preﬁxes to describe the computation of the rm rm ∗ main stack in a LR-2PDA.ai Aβ ⇒ δγ j a1 . ≈ 300 ≈ 1. ∗ ∗ rm rm ∗ .1 LR items and viable preﬁxes We assume the reader has knowledge of LR parsing techniques (cf. ≈ 100 ≈ 400 ≈ 700 ≈ 1. 5.100 ≈5.000 ≈ 28.100 MCopy L..aj β 2 β.98 Length 6 9/10 12 15/16 18 CHAPTER 5.500 ≈2.

ι) = {(B → • γ. For CFG parsing (cf. j}. Example 21 L(Gwcw ) = {wcw |w ∈ {a. S → aS i 2.The transitions of this NFA are of the following form: δ(A → α • Bβ. every item in IT is added to closure(IT ). b}. For the GIG algorithm the set of items and possible index values cannot be determined only by the Closure operation.6. However in Earley’s algorithm this computation is done in run-time while in LR parsing it is precompiled in the LR states. R → [#] 4. If IT is a set of items for a grammar G. or (ii) µ δ B → aγ then add the item B → • γ (case 1) or the item B → • aγ (case 2) to IT if it is not δ δ δ already there. ) = {B → • γ |B → γ is a production } (a NFA transition) In the GIG case the transitions should be as follows. if the index operation is for instance ¯: ι δ(A → α • Bβ. #. {a. then closure(IT ) is the set of items constructed from IT by the two rules: 1. Initially. ¯ Note that the two conditions of the Closure operation rule out the possible index operations δ and [δ] when the right-hand side of the production starts with a non-terminal. The Closure operation is equivalent to the Predict function in Earley parsing (cf. LR PARSING FOR GILS 99 5. S → bS j 3. R → Ra ¯ i 5. R}. R → Rb ¯ j The set of states for the grammar Gwcw should encode the possible conﬁgurations of the stack of indices as follows: . {i. . If A → α • Bβ is in closure(IT ) and (i) B → γ is a production where δ is in I ∪ { }. They are also determined by the Goto operation. Apply this rule until no more new items can be added to the closure of IT . Such productions are considered in case 2 of the Goto function.2 The Closure Operation.[3]). S → cR 6. ) |B → γ is a production } (a PDA transition) ¯ ι ¯ ι It is apparent that the two items should not be conﬂated because there is a change in the stack conﬁguration. P ) and P is: 1. Gwcw = ({S. b}∗ }. S. 2.6. the goto function and the parsing table.5. The following example uses a grammar for the language Lwcw to depict the construction of the set of items. [41]) the Closure operation is equivalent to obtaining the set of states of a NFA that recognizes the viable preﬁxes.

then goto(I. ιj ). We will describe the Goto function adding the possibility of computing the possible stack values of the PDA for each state. Intuitively. #} # # S → c•R R → • Ra R → • Rb ¯ j ¯ i S → • aS S → • bS j S → • aS S → • bS j S → • bS j S → • cR I7 : I 11 : # # S → aS • j S → • cR I8 : I 12 : # # S → bS • j S → • cR I9 : I 13 : # # S → cR • j R→ • [#] R → R•a ¯ i R → R• b ¯ j R → Ra • ¯ i R → Rb • ¯ j Figure 5. is the set of items that are valid of the viable preﬁx-index pairs (γX. s) where i is an index symbol and s is a state deﬁned by a set of items closure. X) is the set of items that are valid for the viable preﬁx γX. 5. is deﬁned to be the closure of the set of all items [A → αX • β] such that [A → α • Xβ] is in IT . j. RECOGNITION AND PARSING OF GILS I1 : i S → a•S i i I2 : j S → b•S j i I3 : I4 : I5 : I6 : I 10 : {i. j. X. The CF Goto function is a DFA transition function where IT is in the state set and X is in the vocabulary. then goto(I.3 The Goto Operation. The operation goto(IT. X). IN ) is deﬁned to be the pair (IT 2 .100 I0 : # S → •S S → • aS i CHAPTER 5. where IT is a set of items and X is a grammar symbol.ιj ) in other words. The CF function goto(IT. ι) = (I j . the Goto function in the GIG case is a PDA and the set of viable preﬁxes with associated indices is a context-free language.ι). #} {i. the new sets I4 and I5 (as compared to context free sets) imply that an index i or j has been consumed from the stack. X. if I is the set of items that are valid for some viable preﬁx-index pairs (γ.23: Set of States for Gwcw In the same way that the dot implies that some input symbols have been consumed. We will say an index i is in IN if (i. #} {i. s) is in IN . In the GIG case. The set I6 requires that the stack be empty.IN 2 ) where either 1 or 2 applies: . if µ µ I is the set of items that are valid for some viable preﬁx γ.6. j. The GIG function Goto has three parameters a) IT is a set of items b) X is a grammar symbol and c) IN is a set of pairs (i.

. IT 2 ).23. LR PARSING FOR GILS 1. [2]). The ﬁrst element of the pair is the symbol X and the second indicates the operation on the PDA stack (e.6. [A → αa • β] is in IT 2 ) µ When the second parameter of the Goto function is 2. IT 2 is the closure of the set of all items [A → αX • β] such that [A → α • Xβ] is in IT µ µ 101 and IN 2 is deﬁned to be the set of indices with an associated state such that: Case A: α is and X is a terminal a (i. the possible values are: a) pairs of shift action and operations on the auxiliary stack: push. The only changes are those made to the Closure and Goto operations as described above. Case C: If α is not X is a terminal a then IN = IN 2 (i.g.: i indicates a push. IN ) is deﬁned to be: β] such that [A → α • Bβ] is in IT and δ is in IN and IN 2 is deﬁned such that µ predecessor(δ. IT i ) in IN is in IN 2 ¯ If µ is δ and δ is in IN then predecessor(δ.24 with a PDA. [#] indicates a transition that requires an empty stack and indicates that i the content of the stack is ignored). IT i ) in IN [B → [δ] • β] such that [A → α • Bβ] is in IT and δ is in IN and IN 2 is deﬁned such that every µ (δ. the auxiliary stack has the conﬁguration corresponding to the completed item B. input (or ) and auxiliary stack. [A → a • β] is in IT 2 ): µ If µ is δ in I then (δ. The action table has three parameters. Case B: If X is a non-terminal B then IN 3 is in IN 2 such that [B → γ • ] is in (IT 3 . If µ is then IN is in IN 2 If µ is [δ] and δ is in IN then every (δ.e. IT i ) in IN is in IN 2 The Goto function for the grammar Gwcw is depicted in ﬁgure 5.5. The construction of an LR parsing table is shown in the following algorithm.e. The construction of the collection of sets of items for a GIG grammar is made following the algorithm used for context free grammars. IT 2 is the closure of the set of all items [B → ¯ δ • then goto(IT. µ In other words. IT i ) is in IN 2 . The indices associated in each state are those indices that are represented also in ﬁgure 5. .g. ¯ indicates a pop. IT 2 ) is in IN 2 and IN is in predecessor(δ. (e. IT i ) is in IN 2 for every (δ. state. IN 3 ).

j. annotated with indices for the grammar Gwcw pop or none.ε ) # I 13 (ε .102 (a. ε ) i. ε) to I 1 to I 3 # I8 (ε . ε) # I 12 ( ε.#) # I 11 to I 6 i. j ) (ε .i) (b. b) reduce action (in this case no operation on the auxiliary stack is performed). ε ) (S. j ) (ε .24: Transition diagram for the PDA recognizing the set of valid preﬁxes.# I3 (ε . The Goto table has the usual properties. ε ) # I9 Figure 5. [δ].j. δ is an index and µ is either δ. i) (c.#) # I 10 to I 6 (a. .j ) ( ε. ε ) (S.j. ε ) ( ε . α is a non empty sequence of non terminals and terminals. B) denote non-terminals lower case letters (a) terminals. β is a possible empty sequence of non terminals and ¯ terminals.j) j I2 (a .i) # I0 i I1 CHAPTER 5.[#]) # I6 (R. The notation used is a follows: capital letters (A.# I4 (R. ε ) (b. i ) i. and no operation on the auxiliary stack. δ.j) to I 2 to I 3 # I7 (c. i ) (c. ε ) (ε .j) (b. RECOGNITION AND PARSING OF GILS (a. i ) (R.# I5 (b.

δ] to (“shift j”. IN j ). If [A → α • aβ] is in I i and goto(I i . A. then δ set action[i. b. IN i ) = (I j . g. a. a. The goto transitions for state i are constructed for all non-terminals A using the rule: If goto(I i . e. $. then set action[i. If [A → • aβ] is in I i and goto(I i . An augmented GIG grammar G’. δ] to (“shift j”. for every index in IN j . Here B must be a non-terminal.2. . LR PARSING FOR GILS 103 Algorithm 7 (Constructing an SLR parsing table) Input. If [S → S • ] is in I i then set action[i. Construct C = {I 0 .. A. δ] to (shift j. then µ set action[i. inj ] = j. a. IN i ) = (I j . f. The parsing actions for state i are determined as follows: a. and δ is in IN i . and δ is in IN i . . State i is constructed from I i . This table is used with an obvious extension of the context free algorithm. . IN i ) = (I j . 3. . IN j ). we say the grammars is not SLR(1). ] to (“shift j”. Here B must be a non-terminal. 4. If [A → • Bβ] is in I i and goto(I i . but it is GLR(1). IN i ) = (I j . IN j ). ] to “reduce A → α” for all a in µ µ FOLLOW(A). a. the collection of sets of LR(0) items for G . IN j ). IN j ). Here a must be a terminal and α must be non-empty. a. c. -). “push δ”). and δ is in IN i and IN j then [δ] set action[i. I n }. δ] to (shift j. where A may not be S . then ¯ δ set action[i. IN j ). the initial state of the parser is the one constructed from the set of items The output transition table for the grammar Gwcw is shown in ﬁgure 5. a. ] to (“shift j”. Here a must be a terminal. adding the additional stack to compute the corresponding actions depicted in the table. IN i ) = (I j . -). If [A → • aβ] is in I i and goto(I i . IN i ) = (I j . IN j ). “pop δ”). If [A → β • ] is in I i . 2. If [A → • aβ] is in I i and goto(I i . i. d. If [A → • aβ] is in I i and goto(I i . .).. The SLR parsing table functions action and goto 1. ] to (“shift j”. Here a must be a terminal. then set action[i. and δ is in IN j . IN j ). a. and δ is in IN i and IN j [δ] then set action[i. I 1 .6. a.. #] to “accept” If any conﬂicting actions are generated by the above rules. h.-). then goto[i. a. IN i ) = (I j . . . IN i ) = (I j . a. “pop δ”). If [A → • Bβ] is in I i and goto(I i . then ¯ δ set action[i.5. Output. a.

pop) (s5. The only diﬀerence is that it takes into account the operations on the auxiliary stack. p i) (s1. ) (s2. (s3.2: Action/Goto Table for Gwcw The parsing algorithm for GIGs is essentially the same algorithm for CFGs. pop) r6 r6 (s5.i) Goto (S. ) (s6.104 State CHAPTER 5. p j) (c.j) ( . pop) (s5. (s3. RECOGNITION AND PARSING OF GILS Action ( . p j) (s2. p i) (s1.#) (R. p i) (b.#) (s4. ) r4 r5 acc Table 5. pop) (s4. ) (s13. ) (s6. pop) (s6.#) ($. p j) (s2. ) r6 r1 r2 r3 (s12. We follow the notation from [2]. (s3. ) (s1. . ) ) ) ) ( . pop) (s4.#) 14 7 8 9 10 11 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 (a.

Output. if action [s.5. Set ip to point to the ﬁrst symbol of w$. else if action [s. i] on top of Stack1 output the production A → β µ 105 else if action [s. a parse for w otherwise an error indication. ) then begin push a then s on top of the Stack1 advance ip to the next input symbol. LR PARSING FOR GILS Algorithm 8 (LR parsing for GIGs) . let s be the state now on top of the stack. A. advance ip to the next input symbol. else if action [s. a. pi )then begin push a then s on top of the Stack1 push i on top of Stack2 . . . a. i] = shift (s . push A then goto[s . pop) then begin push a then s on top of the Stack1 pop i from Stack2 else if action [s. An input string w and an LR parsing action − goto table for a grammar G. Initiate Stack1 with s0 .6. i] = accept then return else error end The following table shows the moves of the LR parser on the input string abcab. Initiate Stack2 with #. a. repeat forever begin let s be the state on top of the Stack1 and i the symbol on top of the Stack2 a the symbol pointed by ip. If w is in L(G). pop) then begin push a then s on top of the Stack1 pop i from Stack2 advance ip to the next input symbol. Input. i] = shift (s . a. (i ∪ )] = shift (s . (i ∪ )] = shift (s . else if action [s. i] = reduce A → β then begin pop 2 ∗ |β| symbols from Stack1. a.

106 CHAPTER 5.3: Trace of the LR-parser on the input abcab and grammar Gwcw . RECOGNITION AND PARSING OF GILS 1 2 3 4 5 6 7 8 9 9 11 12 13 14 15 16 Stack 1 0 0a1 0a1b2 0a1b2c3 0a1b2c35 0a1b2c354 0a1b2c3546 0a1b2c354R10 0a1b2c354R10a 0a1b2c35R11 0a1b2c35R11b 0a1b2c3R9 0a1b2S8 0a1S7 0S14 - Stack2 # #i #ij #ij #i #i # # # # # # # # # # Remaining input abcab$ bcab$ cab$ ab$ ab$ ab$ ab$ ab$ b$ b$ $ $ $ $ $ $ Comments Initial ID Shift and push Shift and push Shift Shift and Pop Shift and Pop Shift Reduce by 6 Shift Reduce by 4 Shift Reduce by 5 Reduce by 3 Reduce by 2 Reduce by 1 Accept Table 5.

1 For the notion of dependent paths see for instance [82] or [44]. The goal of this section is to show how the properties of GILs are related to the peculiarities of the control device that regulates the derivation. because they can produce dependent paths1 . However those dependent paths are not obtained by encoding the dependency in the path itself. They also oﬀer additional descriptive power in terms of the structural descriptions they can generate for the same set of string languages.Chapter 6 Applicability of GIGs 6. at the same computational cost in terms of asymptotic complexity. we review some of the abstract conﬁgurations that are argued for in [29]. His discussion is addressed not in terms of weak generative capacity but in terms of strong-generative capacity. GIGs oﬀer additional descriptive power as compared to LIGs (and weakly equivalent formalisms) regarding the canonical NL problems mentioned above. In this section. Though this mechanism looks similar to the control device in Linear Indexed Grammars .1 Linear Indexed Grammars (LIGs) and Global Index Grammars (GIGs) Gazdar [29] introduces Linear Indexed Grammars and discusses their applicability to Natural Language problems. Similar approaches are also presented in [82] and [44] (see [56] concerning weak and strong generative capacity). the formalisms diﬀer in the kid of trees they generate. 107 .

i] C [] push pop Figure 6. and C is a control set deﬁned by a CFG (a Dyck language): {a1 . the control strings wi are not necessarily connected to each other.. It is easy to see that no control substring obtained in a derivation subtree is necessarily in the control language. where G is a labeled grammar (cf. Gazdar suggests that the conﬁguration in ﬁgure 6. L. >⇒< a1 .108 CHAPTER 6. [87]).2 and 6.. P ).1. S. ai ∈ T ∪ { }. C): {w | S. δ is in C } ¯ C is deﬁned to be the Dyck language over the alphabet I ∪ I (the set of stack indices and their complements). Those control words describe the properties of a path (a spine) in the tree generated by the grammar G.g. the control of the derivation can be distributed over diﬀerent paths.2 The palindrome language CFGs generate structural descriptions for palindrome languages (e.1. In other words. APPLICABILITY OF GIGS 6.an | < S.. C).] B ∗ ∗ A B pop push C A [] B [.. G = (N. (we follow Gazdar’s notation: the leftmost element within the brackets corresponds to the top of the stack)... the language {wwR |w ∈ Σ∗ }) only of the nested (center embedded) sort.1: LIGs: multiple spines (left) and GIGs: leftmost derivation 6.. We gave an alternative deﬁnition of the language of a GIG in chapter 5 to be the control language: L(G.1 at the right.1 Control of the derivation in LIGs and GIGs Every LIL can be characterized by a language L(G. however those paths are connected transversely by the leftmost derivation order. as is depicted in the ﬁgure 6. < an . . wn >.. # ⇒ w. w1 > . In other words.1 at the left. w1 . Those control strings are encoded in the derivation of each spine as depicted in ﬁgure 6.3. and every possible spine is independent. but every substring encoded in a spine has to belong to the control set language. T. CFGs cannot generate the structural descriptions depicted in ﬁgures 6. wn ∈ C}.2 would be necessary to represent Scandinavian . B [.. #δ and w is in T ∗ .

b. {a..e.a] [b.b.b.] [a] [b. LINEAR INDEXED GRAMMARS (LIGS) AND GLOBAL INDEX GRAMMARS (GIGS) 109 [.e. #.a] [c. The corresponding structural description is shown in ﬁgure 6..a] [c. the structure of ﬁgure 6.. AP. c}. (i. [. in productions that are not in Greibach Normal Form).c. A}. A.] Figure 6.b. Such an structure can be obtained using a GIG (and of course an LIG).a] [d.a] [a] [.a] [c.6.a] [d.a] [c. (i.a] [b.2: A non context-free structural description for the language wwR unbounded dependencies. N P.4 at the left.1.3: Another non context-free structural description for the language wwR However GIGs generate a similar structural description as depicted in ﬁgure 6.a] [a] [.3) cannot be generated by a GIG because it would require push productions with a non terminal in the ﬁrst position of the right-hand side.4: Example 22 (Comparative Construction) .b.b.] [a] a b c d d c b a [b. But the exact mirror image of that structure. ¯ Gadj = ({AP. j}. In such structure the dependencies are introduced in the leftmost derivation order. P ) where P is: AP → AP N P A→a i ¯ j ¯ AP → A A→c k ¯ ¯ A→AA NP → a NP ¯ i A→b j NP → b NP NP → c NP ¯ k .c. The English adjective constructions that Gazdar uses to motivate the LIG derivation are generated by the following GIG grammar..] a b c d d c b a Figure 6. b. {i.

3.. could .] NP AP [.d] b [d] c d Figure 6.. APPLICABILITY OF GIGS [.b. as in the LIG case.a] c A A [a.] A [b..c] [c.] a b c d a b c d [b.a] [c.a] [a] [.d] [c.b.c.1..5).c. shown in ﬁgure 6.c.a] c d d a [b.] [.] [a] a b c d [c.a] [a. However.c.] A NP b [c] [a] [b.d] [d] [.a] [a] [b. a similar one can be obtained using the same strategy as we used with the comparative construction.a] [c.5: Two LIG structural descriptions for the copy language Gazdar further argues that the following tree structure.b.4: GIG structural descriptions for the language wwR It should be noted that the operations on indices are reversed as compared to the LIG case shown in ﬁgure 6.c] a b A c [c] b Figure 6..d] a [b. but not the one at the right.c] NP [d.6 at the left.. [... On the other hand.] a A a b [.a] [b.110 CHAPTER 6. 6.c.a] [.] AP AP AP [.3 The Copy Language Gazdar presents the following two possible LIG structural descriptions for the copy language (depicted in ﬁgure 6.b.] [b.b..b.b..a] [d.] NP NP c NP [. the introduction of indices is dependent on the presence of lexical information and its transmission is not carried through a top-down spine. The structural description at the left can be generated by a GIG. The arrows show the leftmost derivation order that is required by the operations on the stack.d] [c.b.

a] [a] a b a c [b.b.c.1.a] [c. [d] [c.a] [b.a] [d.c.a] c [a] b [] a [d.6 at the left either.a] [c.b.c.c.d] b c [d] d [b.b.a] [b. but they can generate the one presented in the ﬁgure 6. LINEAR INDEXED GRAMMARS (LIGS) AND GLOBAL INDEX GRAMMARS (GIGS) 111 be more appropriate for some Natural Language phenomenon that might be modeled with a copy language.d] [d] [d.d] [c.c.a] [c.b. where the arrows depict the leftmost derivation order.a] [b.c.d] [a.a] [d.d] [a.a] [d.d] a b c d [c.a] b c d ε a Figure 6.a] [c. corresponding to the grammar shown in example 10. but can be generated by an IG.6.a] [a.7: A GIG structural description for the multiple copy language .b.b.c.b.b.b.6: An IG and GIG structural descriptions of the copy language GIGs cannot produce the structural description of ﬁgure 6.b.a] [a] [] [d.b.a] a b c d [c.a] [a] a [] b Figure 6.d] [] [d.7.c.b. Such structure cannot be generated by a LIG.c.a] [a] [d.b.b.c.a] d c b [c.c.a] c d d [c.d] [b.b.a] [b.b. [] [a] [b.c.d] [b.c.c.a] [c.6 (right).b. GIGs can also produce similar structural descriptions for the language of multiple copies (the language {ww+ | w ∈ Σ∗ } as shown in ﬁgure 6.a] ε a d [b.b.b.a] [a] [a] [] [b.

] [i. [. L}.8 and 6.i] [i] d [.] c c b [i.10 (at the right). The corresponding structure is depicted in the ﬁgure 6... {a. #.i] b [.4 Multiple dependencies Gazdar does not discuss of the applicability of multiple dependency structures in [29]. It is mentioned in [82] in relation to the deﬁnition of composition in [79] Categorial Grammars. R..9: A LIG and a GIG structural descriptions of 3 dependencies GIGs can also produce other structures that cannot be produced by a LIG. S.] d [. {i}. c.8: LIG and GIG structural descriptions of 4 and 3 dependencies [. f }. e. L(Gsum ) = { an bm cm dl el f n | n = m + l ≥ 1}.. GIGs can generate the same structures as in 6. which permits composition of functions with unbounded number of arguments and generates tree sets with dependent paths..i] d [i] b b [. The following language cannot be generated by LIGs.] [.1.] b Figure 6.] c [i] [i.i] [i.9 (right). Gsum = ({S..] [i] [..9 (left).. d. APPLICABILITY OF GIGS 6.] c c Figure 6..i] d [i] b c d a a [i] b b [.8 and the somehow equivalent in 6.i] [i] c c d [.] [i. as we show in ﬁgures 6. Example 23 (Dependent branches) ..] [i] a a [i. P ) where P is: . F. b. The relevant structures that can be produced by a LIG are depicted in ﬁgures 6.11.10 and 6.112 CHAPTER 6.

. GIGs can produce crossing dependencies with some alternative structures as depicted in the following structures.5 Crossing dependencies Crossing dependencies in LIGs and TAGs have the same structural description as the copy language.i] [i.i] b [i] [i] c [...i] [i] a [i. .] [i] a [.i] a c c [. LINEAR INDEXED GRAMMARS (LIGS) AND GLOBAL INDEX GRAMMARS (GIGS) 113 S → aSf |R i R→F L|F |L F → b F c |b c ¯ i L → d L e |d e ¯ i The derivation of aabcdef f : #S ⇒ i#aSf ⇒ ii#aaSf f ⇒ ii#aaRf f ⇒ ii#aaF Lf f ⇒ i#aabcLf f ⇒ #aabcdef f [.i] [i.i] a b b c [i] [.] d [i] a c d b d e Figure 6.] d d ε b Figure 6.] [.] c [i..i] f [..i] a [i] [i] [i..6.10: GIG structural descriptions of 4 dependencies [. The ﬁrst example is generated by the grammars Gcr presented in Chapter 3 and repeated here.11: GIG structural descriptions of 3 dependencies 6..] c [i] a [i.1.] [i.] [.i] [i.] [i] a f [i...1.

y}. A. e. b. f. The following kind of dependencies can be obtained: Example 25 (Crossing Dependencies 2) .114 Example 24 (Crossing Dependencies) . S. C}. c. A. {a. S. b. B. B → b B | b x D→dD|d x ¯ [] [ii] [] a a a b [ii] b b [iii] [i] c [] c c d d d [i] [] Additional number of crossing dependencies can be obtained (pairs or triples). L(Gcr8 ) = {an bn cm dm en f n g m hm | n. d. where Gcr8 = ({S. h}. {x}. m ≥ 1}. m ≥ 1}. #. B. CHAPTER 6. P ) and P is: S→AD A→aAc|aBc 3. c. d}. APPLICABILITY OF GIGS L(Gcr ) = {an bm cn dm | n. g. {a. P ) and P is: S→AL A→aAf |aBf x B → b B e| b Ce x ¯ C → c C d| c d y L → g L h| g h y ¯ [i] a a b [ii] [i] [] e f f g g [k] h [] h b c [k] e d [kk] c d . where Gcr = ({S. C}. #. {x.

m ≥ 1} 1 2 1 1 2 2 2 1 The language Lcrm is generated by the following GIG: Example 26 (Crossing Dependencies 3) . related to the operation of generalized composition in CCGs. S. a ∈ T and γ ∈ (N ∪ T )∗ : • A[. C. A2 . d1 . L..] → a B[. b2 .i] γ . c1 . d2 }. a2 . D. SET INCLUSION BETWEEN GIGS AND LIGS 115 Such structures might be relevant to be able to generate the following language(discussed in [86]). c2 . P ) and P is: S→AL x ¯ A → a1 A B 1 | a1 A2 B 1 L2 → C D A2 → a2 A2 y y ¯ B 1 → b B| b x L → c1 L d1 | c1 L2 d1 D → d2 d2 y ¯ C → b2 C C 2 | b2 C 2 C 2 → c2 C 2 y The derivation of a1 a1 a2 a2 a2 b1 b1 c1 c1 b2 b2 b2 c2 c2 c2 d2 d2 d2 d1 d1 S ⇒ AL ⇒ #a1 AB 1 L ⇒ #a1 a1 A2 B 1 B 1 L ⇒ yyy#a1 a1 a2 a2 a2 B 1 B 1 L ⇒ xxyyy#a1 a1 a2 a2 a2 b1 b1 L ⇒ yyy#a1 a1 a2 a2 a2 b1 b1 c1 c1 CDd1 d1 ⇒ #a1 a1 a2 a2 a2 b1 b1 c1 c1 b2 b2 b2 C 2 C 2 C 2 Dd1 d1 ⇒ yyy#a1 a1 a2 a2 a2 b1 b1 c1 c1 b2 b2 b2 c2 c2 Dd1 d1 ⇒ #a1 a1 a2 a2 a2 b1 b1 c1 c1 b2 b2 b2 c2 c2 c2 d2 d2 d2 d1 d1 ∗ ∗ ∗ ∗ ∗ ∗ 6. L2 }. {a1 . y}. Gcrm = ({S. we could proceed as follows. If an equivalence between LIGs and LIGs with push productions in GNF could be obtained. {x. b1 . LIGs and Greibach Normal Form The deﬁnition of GIGs requires push productions in Greibach Normal Form.. Deﬁnition 14 A LIG is in push Greibach Normal Formal if every push production is in Greibach Normal Form (where A.2. #. A. Lcrm = {an am bn cn bm cm dm dn |n. Our conjecture is that LILs are properly included in GILs.2 Set Inclusion between GIGs and LIGs The last section showed similarities and diﬀerences between LIGs and GIGs in terms of the structural descriptions. B. B ∈ N.6. In this section we are going to address the issue of whether LILs and GILs are comparable under set inclusion.

.] such that 1 ≤ i ≤ s B[. as long as the left recursion involves the whole spine. S) be obtained from G by deleting the production A → Bα2 from P and adding the productions A → β 1 α2 |β 2 α2 |β r α2 .. T.γ 2 ]α2 | · · · |A[.116 CHAPTER 6. T.3 in [41]. P. from a LIG derivation to a GIG derivation and the equivalence is easy obtained. Let A[.. A[.2. S) be a LIG. Let G1 = (N ∪ {B}. An adaptation of the lemma 4.γ i ] → β i B[. Lemma 11 Let G = (N. The proof of this lemma holds for the GIG case because there is no stack information aﬀected...γ r ]αr be the set of A-productions for which A is the leftmost symbol of the right hand side. Then L(G) = L(G1 ). index γ to I and replacing the A−productions by the productions: A[.γ i ] → β i . S) be a LIG.γ 1 ]α1 |A[.γ i ] → αi . Lemma 10 Deﬁne an A − production to be a production with variable A on the left. A similar lemma for CFGs is lemma 4.] → B[]α be a production in P and B[. the proper inclusion of LILs in GILs would be obtained: • For any LIG there is an equivalent LIG in push-Greibach Normal Formal. I..]β 1 |β 2 | · · · |β r be the set of all B-productions (they do not aﬀect the stack). B[. However we show in the next section that such a claim does not seem to hold. if a lemma such as the following statement could be proved. I.1 LIGs in push-Greibach Normal Form We can apply the techniques for left recursion elimination used in the conversion to Greibach Normal Form in CFGs. 6... APPLICABILITY OF GIGS Lemma 9 For any LIG in push-Greibach Normal Formal there is an Equivalent GIG that generates the same language. P.. Let A[.γ i ] → αi B[. just a change in the interpretation of the derivation. S) be the LIG formed by adding the variable B to N . Let G = (N.. T. T... This is easy to prove.] → A[.γ i ] → β 1 |β 2 | · · · |β s be the remaining A−productions. P. Let A[.4 in [41] as follows also holds for LIGs and it would allow to transform left recursion into right recursion. Therefore... Let G1 = (N. P 1. The following lemma applies to productions that do not carry stack information.] such that 1 ≤ i ≤ r . I. I ∪ {γ }.] → [. GILs contain languages which are proven not to be in the LIL set.

] a b c d a b c d [b...] [.a] [d..14 would require even more additional machinery.a] [b.b.12 involving the palindrome language would be obtained. There is no way that a LIG like the one generating the three dependencies could be transformed into a LIG in push-GNF. second case The structures depicted in ﬁgure 6.13: Left and right recursive equivalence in LIGs.d] [d] [.. the equivalence of the structures in ﬁgure 6.d] a [b. .b.] [b.. such as index renaming: [.] [.] [a] a b c d d c b a [b.2.a] [a.a] [b.a] [b..a] [c.] [a] [b.a] [c.b. [.a] [a] [.c. SET INCLUSION BETWEEN GIGS AND LIGS 117 In this way.] [a] a b c d [c.b.6.c.12: Left and right recursive equivalence in LIGs The previous lemma would not work in the following structure.a] [d. without some mayor changes in the mapping algorithm.a] [c.b.d] [c.c.b.b.b.b.a] [a] [.b..d] b [d] c d Figure 6.a] [c. because it would need some additional changes.a] [a] a b c d d c b a Figure 6.d] [c.a] [c.c.a] [d.c.c.

The problem is that they require the two directions of recursion (i.15: LIGs not in push-GNF II These languages do not seem to be obtainable with a LIG in push-GNF.i] d [i] b b [. both right and left) for push productions.] [i] b [i. APPLICABILITY OF GIGS [.14: LIGs not in push-GNF I Moreover some additional problems arise as in the following languages: {w1 w2 w1 w2 R |wi ∈ Σ∗ } {w1 w2 w2 w1 R |wi ∈ Σ∗ } which can be depicted by the following structures: push push push b1 b2 a1 push push push a2 b3 push a3 push push a1 a2 b1 b2 push push pop pop pop pop push a3 a3 a2 a1 pop b3 pop b3 b2 b1 pop pop pop b3 b 2 a3 a2 pop pop b1 a1 Figure 6.] c c d CHAPTER 6.i] [i] [.] c c d d b Figure 6...16 It seems that some of the above-mentioned issues would still arise if we try to obtain the inclusion of LILs by simulating either an EPDA or Becker’s 2-SA with a LR-2PDA. They are however generated by GIGs as shown in ﬁgure 6.] [i] [i.118 [. However..e.. this alternative .

6. We will allow the productions of a GIG to be annotated with ﬁnite strings in I ∪ I instead of single symbols. 6. Therefore. It is a standard change in PDAs (cf. One of the motivations was the potential to improve the processing eﬃciency of HPSG. [48].16: LIGs not in push-GNF II in GIGs should be considered in detail.2 were correlated to the use of the SLASH feature in GPSGs and HPSGs. There has been some work compiling HPSGs into TAGs (cf. by performing HPSG derivations at compile time. This does not change the power of the formalism. [8]).3 GIGs and HPSGs We showed in the last section how GIGs can produce structural descriptions similar to those of LIGs. Those structural descriptions corresponding to ﬁgure 6. and others which are beyond the descriptive power of LIGs and TAGs. GIGS AND HPSGS 119 pop pop push b pop push 1 a1 a2 b2 push pop pop a3 pop b3 a3 a2 a1 push b 3 push b 2 push b1 Figure 6. This follows from the ability of GIGs to capture dependencies through diﬀerent paths in the derivation. [39]) to allow to push/pop several symbols from the stack. In this section. we will show how the structural descriptive power of GIGs is not only able to capture those phenomena but also additional structural descriptions compatible with those generated by HPSGs [61] schemata. diﬀerent derivations . Also the symbols will be interpreted relative to the elements in the top of the stack (as a Dyck set).3. We will introduce informally some slight modiﬁcations to the operations on the stacks performed ¯ by a GIG. Such compilation process allowed the identiﬁcation of signiﬁcant parts of HPSG grammars that were mildly context-sensitive.

Example 27 (intransitive verb) XP → Y P XP XP → X YP →Y X→x nv ¯ Y →y n . according to what is on the top of the stack. Head-Subj-Schema Figure 6. an how the elements contained in the stack can be correlated to constituents or lexical items (terminal symbols) in a constituent recognition process.120 CHAPTER 6.17 depicts the tree structure corresponding to the Head-Subject Schema in HPSG [61].17: Head-Subject Schema 2 2 33 HEAD 1 6 77 6 6 6 77 6 6 77 6 S 6 L | C 6SUBJ 6 77 6 6 4 55 6 4 6 3 6 COMPS 6 2 6 2 6 6 6 6 6 6 6 6 6 6 HEAD DTR 6 S | L | 6 6 6 6 6 6 4 6D 6 6 6 6 6 6 6 4 4 COMP-DTR S 2 2 3 7 7 7 7 7 7 7 7 2 3337 7 HEAD 1 77 7 6 7777 6 77 6 7777 6SUBJ 2 7777 6 7777 4 5577 77 COMPS 3 77 77 55 (1) Figure 6. HEAD 1 SUBJ < > H SUBJ 2 1 HEAD SUBJ < 2 > Figure 6. obtaining very similar structural descriptions. The arrows indicate how the transmission of features is encoded in the leftmost derivation order.18 shows an equivalent structural description corresponding to the GIG productions and derivation shown in the next example (which might correspond to an intransitive verb). APPLICABILITY OF GIGS might be produced using the same production. in particular in the ﬁrst three cases where nv ¯ [n]v diﬀerent actions are taken (the actions are explained in the parenthesis) : nnδ#wXβ ⇒ vnδ#wxβ (pop n and push v) nv ¯ n¯δ#wXβ ⇒ δ#wxβ v nv ¯ (pop n and v ) vnδ#wXβ ⇒ v¯ vnδ#wxβ (push n and v) nδ#wXβ ⇒ ¯ n ¯ nv ¯ [n]v vnδ#wxβ ( check and push) We exemplify how GIGs can generate similar structural descriptions as HPSGs do in a very oversimpliﬁed and abstract way. This is exempliﬁed with the productions X → x and X → x. We will ignore many details and try give an rough idea on how the transmission of features can be carried out from the lexical items by the GIG stack.

] 121 YP [n.19 shows the tree structure corresponding to the Head-Complement schema in HPSG. GIGS AND HPSGS [.] X x Figure 6. The following GIG productions generate the structural description corresponding to ﬁgure 6.] y [v. XP → X CP The derivation: CP → Y CP X → x nv n ¯ ¯ CP → Y →y n n#XP ⇒ n#XCP ⇒ nv#xCP ⇒ nv#xY CP ⇒ v#xyCP ⇒ v#xy ¯ ¯ The productions of example 29 (which uses some of the productions corresponding to the previous schemas) generate the structural description represented in ﬁgure 6..3.6..18: Head-Subject in GIG format #XP ⇒ #Y P XP ⇒ #yXP ⇒ n#Y XP ⇒ n#yX ⇒ v#yx Head-Comps-Schema HEAD COMP 1 < 2 HEAD 1 6 77 7 6 6 7 6 S 4 L | C 4SUBJ 2 55 7 6 7 6 COMPS 3 6 2 2 2 3337 7 6 HEAD 1 7 6 6 6 6 6 7777 6 6 HEAD DTR 4 S | L | 4SUBJ 2 5577 6D 6 77 6 4 COMPS union 4 . 3 n > Figure 6.] XP [v.] Y [n. corresponding to the deriva- ..19: Head-Comps Schema tree representation Figure 6. where the initial conﬁguration of the stack is assumed to be [n]: Example 28 (transitive verb) .20..21..] XP [v.. 3 57 5 4 COMP-DTR S 4 2 2 33 3 2 > C n-2 3 n H C HEAD 1 COMP < 2 1 .

22 shows how coordination combined with SLASH can be encoded by a GIG.20: Head-Comp in GIG format tion given in example 29. We show the contents of the stack when each lexical item is introduced in the derivation. XP → Y P XP CP → Y P CP X → know nv ¯¯ n XP → X CP X → hates nv n ¯ ¯ nv¯ ¯ v XP → X XP CP → X → claims Y P → Kim|Sandy|Dana|we A derivation of ‘Kim we know Sandy claims Dana hates’: #XP ⇒ #Y P XP ⇒ n#Kim XP ⇒ n#Kim Y P XP ⇒ nn#Kim we XP ⇒ nn#Kim we X XP ⇒ v n#Kim we know XP ⇒ ¯ v n#Kim we know Y P XP ⇒ ¯ n¯n#Kim we know Sandy XP ⇒ v n¯n#Kim we know Sandy X XP ⇒ v v n#Kim we know Sandy claims XP ⇒ ¯ v n#Kim we know Sandy claims Y P XP ⇒ ¯ n¯n#Kim we know Sandy claims Dana XP ⇒ v #Kim we know Sandy claims Dana hates Finally the last example and ﬁgure 6.122 [n] CHAPTER 6. ∗ . APPLICABILITY OF GIGS XP [ v ] X [n v] [n v] CP [ v ] Y [v] CP x y ε Figure 6. Example 29 (SLASH in GIG format) .

6. GIGS AND HPSGS [] 123 XP YP [n] [n] Kim YP [nn] we XP XP X [vn] know YP [nvn] Sandy XP XP X XP [vn] claims YP [nvn] Dana [] hates XP X CP ε Figure 6.3. XP → Y P XP CP → Y P CP X → talk to nv n ¯ ¯ XP → X CP CP → C → and X → did nv ¯¯ XP → X XP X → visit [n¯n]c v CXP → XP CXP Y P → W ho|you n CXP → C XP A derivation of ‘Who did you visit and talk to’: #XP ⇒ #Y P XP ⇒ n#W ho XP ⇒ n#W ho Y P XP ⇒ v n#W ho did XP ⇒ ¯ v n#W ho did Y P XP ⇒ n¯n#W ho did you CXP ⇒ ¯ v n¯n#W ho did you XP CXP ⇒ v cn¯n#W ho did you visit CXP ⇒ v cn¯n#W ho did you visit C XP ⇒ v n¯n#W ho did you visit and XP ⇒ v ∗ .21: SLASH in GIG format Example 30 (SLASH and Coordination2) .

124 #W ho did you visit and talk to XP CHAPTER 6. APPLICABILITY OF GIGS [] YP [n] Who X [nv] did XP XP YP [nvn] you XP [cnvn] visit ε CXP CXP C [ n v n ] XP [] [ n v n] and talk to CP ε Figure 6.22: SLASH and coordination in GIG format .

We showed the equivalence of LR-2PDA and GIGs.Chapter 7 Conclusions and Future Work We have presented LR-2PDAS. multiple agreements and crossed agreements. An Earley type algorithm for the recognition problem of GILs was presented with a bounded polynomial time result O(n6 ) and O(n4 ) space. and that are more limited regarding crossed agreements. The proof of correctness of this algorithm was also presented using the Parsing Schemata framework. it might be diﬃcult to prove it. However we did not discuss the (possible) equivalence of sLR-2PDAs and trGIGs. Finally. We presented a Chomsky-Sch¨tzenberger representation theorem for GILs. We conjectured that trGIGs are not able to capture reduplication phenomena. A proof of semilinearity showed that GILs share mildly context sensitive properties. The strong similarity between GIGs and LIGs suggests that LILs might be included in GILs. We showed u the descriptive power of GIGs regarding the three phenomena concerning natural language context sensitivity: reduplication. We have shown that GIGs generate structural descriptions for the copy and multiple dependency languages which can not be generated by LIGs. corresponds to the ability of GIGs to 125 . We also showed that both the weak and the strong descriptive power of GIGs is beyond LIGs. We introduced trGIGs (and sLR-2PDAs) which are more restricted than GIGs. GIGs. time-complexity and space complexity properties. or it might not be the case and both languages turn out to be incomparable. However. GILs and their properties. We presented a comparison of the structural descriptions that LIGs and GIGs can be generate. We analyzed the algorithm providing an account of grammar-size. we have shown also that the extra power that characterizes GIGs.

which follows as a corollary from the semi-linearity property. They seem to be a proper subset of GILs and they also seem to be closed under complementation (which could be proved following the proof for CFLs). except the emptiness problem. Although they do seem to be. The similarity of GIGs and counter automata. The relationships between GILs LILs and ILs is still an open question. We mention now some of the issues that might be addressed in future research. and the membership problem. GILs and GCSLs are incomparable but trGILs might be a properly included in GCSLs. CONCLUSIONS AND FUTURE WORK generate dependent paths without copying the stack but distributing the control in diﬀerent paths through the leftmost derivation order. We have shown also that those non-local relationships which are usually encoded in HPSGs as feature transmission can be encoded in GIGs using its stack. however it is not clear to us if such a pumping lemma would provide an additional tool beyond the result already obtained on semilinearity. We gave an Earley algorithm for GIGs . it is harder to determine whether GILs with deterministic indexing are a proper subset of the Global Index Languages. however there are other variations on Earley’s algorithm that were not considered and that might improve the impact of the grammar size on the parsing . A candidate pumping lemma for GILs was suggested. this class might not have any theoretical import besides the fact that the recognition problem is in O(n3 ). the proof should be considered in detail. and we gave an algorithm to parse LR(k) GILs. In this case.126 CHAPTER 7. We deﬁned deterministic LR-2PDAs and deterministic GILs. should be addressed. We also mentioned the issue of ambiguity and we deﬁned GILs with deterministic indexing. 7.1 Future Work The results described in the previous section are encouraging enough to continue further work concerning Global Index Languages. We have established some coarse-grain relations with other families of languages (CFLs and CSLs). However. however. exploiting the ability of GIGs to encode dependencies through connected dependent paths and not only through a spine. we did not explore the properties of the class of deterministic GILs. coupled context-free grammars among other formalisms. We have not addressed most of the decision problems.

7.1. FUTURE WORK

127

complexity. There are also some details on the introduction of indices which would improve its performance. Another alternative to be considered is extension of the LR(k) algorithm to generalized LR(k) ` la Tomita. If a Chomsky Normal Form for GILs is obtainable, a CYK bottom-up algorithm a could be considered. We considered some of the issues related to Natural Language from a formal and abstract point of view, i.e. language sets and structural descriptions. In the same perspective it might be interesting to see if GILs are able to describe some phenomena that are beyond mildly-context sensitive power (e.g. scrambling). Also, we only compared GILs with LIGs; there are other formalisms to be considered. Minimalist Grammars [78] share some common properties with GILs. It would be interesting to determine if minimalist grammars can be compiled into GILs. In the area of practical applications, it would be interesting to implement the HPSG compilation ideas. Another relevant question is how much of TAG systems can be compiled into GIGs and how do the performances compare. It should be noted that the capabilities of TAGs to deﬁne extended domains of locality might be lost in the compilation process. We mentioned in the introduction some of the approaches to use generative grammars as models of biological phenomena. The capabilities of GIGs to generate the multiple copies language (or multiple repeats in the biology terminology) as well as crossing dependencies (or pseudo-knots) might be used in the computational analysis of sequence data.

128

CHAPTER 7. CONCLUSIONS AND FUTURE WORK

Bibliography

[1] A. V. Aho. Indexed grammars - an extension of context-free grammars. Journal of the Association for Computing Machinery, 15(4):647–671, 1968. [2] A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. AddisonWesley, Reading, MA, 1986. [3] M. A. Alonso, D. Cabrero, and M. Vilares. Construction of eﬃcient generalized LR parsers. In Derick Wood and Sheng Yu, editors, Automata Implementation, volume 1436, pages 7–24. Springer-Verlag, Berlin-Heidelberg-New York, 1998. [4] M. A. Alonso, E. de la Clergerie, J. Gra˜a, and M. Vilares. New tabular algorithms for LIG n parsing. In Proc. of the Sixth Int. Workshop on Parsing Technologies (IWPT’2000), pages 29–40, Trento, Italy, 2000. [5] J. Autebert, J. Berstel, and L. Boasson. Context-free languages and pushdown automata. In A. Salomaa and G. Rozenberg, editors, Handbook of Formal Languages, volume 1, Word Language Grammar, pages 111–174. Springer-Verlag, Berlin, 1997. [6] G. Barton, R. Berwick, and E. Ristad. Computational Complexity and Natural Language. MIT Press, Cambridge, 1987. [7] T. Becker. HyTAG: a new type of Tree Adjoining Grammars for Hybrid Syntactic Representation of Free Order Languages. PhD thesis, University of Saarbruecken, 1993. [8] T. Becker and P. Lopez. Adapting HPSG-to-TAG compilation to wide-coverage grammars. In Proceedings of TAG+5, pages 47–54. 2000.

129

Italy. 1998. editors. February 16-22. Boullier. Comput. Otto. Research Report RR-3614. Growing context sensitive languages and church-rosser languages. France. volume 900. [16] G. Weakly growing context-sensitive grammars. Buntrock and G. Buntrock and K. Languages and Programming. 1994. Boullier. [17] J. 1992. . INRIA. 2003. 1995. n In Proc. Proceedings of the ACL-2003 Student ¨ Research Workshop. J. pages 77–88. Casta˜o. In TAG Workshop. In In Proceeding of CIAA 2003.. Mach. In Proceedings of the 12th Symposium on Theoretical Aspects of Computer Science. Range concatenation grammars. Lorys. [18] J. mix. Conﬂuent and other types of thue systems. Mexico City. In Proceedings of the Sixth International Workshop on Parsing Technologies (IWPT2000). Buntrock and K. Lecture Notes in Computer Science. 1996. 2003. In Sandra K n ubler Kotaro Funakoshi and Jahna Otterbacher. scrambling. and range concatenation grammars. 29:171–182. January 1999. [11] P. Boullier. Niemann. pages 595–606. Chinese numbers. Philadelphia. GIGs: Restricted context-sensitive descriptive power in bounded polynomial-time. 2003.CA. 1982. [10] P. Chicago Journal of Theoretical Computer Science. [19] J. Casta˜o. 14 pages. [15] G. [12] P. LR Parsing for Global Index Languages (GILs). On growing context-sensitive languages. of Cicling 2003. [13] G. Buntrock and F. Book. In Symposium on Theoretical Aspects of Computer Science. On the applicability of global index grammars. In Automata. Rocquencourt. Lorys. Trento. Casta˜o. Assoc. pages 53–64.130 BIBLIOGRAPHY [9] R. n Santa Barbara. pages 15–22. [14] G. The variable membership problem: Succinctness versus complexity.. February 2000. A generalization of mildly context-sensitive formalisms.

Linguistics and Philosophy. Breveglieri. The complexity of the vocabulary of bambara. 2. Chomsky and M. The Netherlands. June. 1970. An Eﬃcient Context-free Parsing Algorithm. Berlin. In Colloquium on Trees in Algebra and Programming. Pitsch G. 7(3):253–292.. 1988. Natural Language Parsing and Linguistic Theories. Global index grammars and descriptive power. pages 69–94. and S. Citrini. pages 205– 233. The Mathematical Theory of Context Free Languages. Membership for growing context sensitive grammars is polynomial. editors. Dahlhaus and M. Computer Programming and Formal Systems. Bloomington. Earley. Dassow. [29] G. 1989. 1985. [21] A. and A. Sci. Rozenberg a and A. Ginsburg. editors. D. [30] S. Springer. In U. [22] N. [23] C. 1996. [25] J. Vol. Oehrle and J. Warmuth. Rohrer. [24] E. Reghizzi. The algebraic theory of context-free languages. Indiana. 1986. pages 118–161. Salomaa. editors. G. Mc Graw Hill. [27] J. Springer.-P. [28] G. International Journal of Foundations of Computer Science. 8:345–351. C. On parsing coupled-context-free languages. North-Holland. Gazdar. Sch¨tzenberger. Hotz. of Mathematics of Language. 1966. In G. 1996. Applicability of indexed grammars to natural languages. K.BIBLIOGRAPHY 131 [20] J. Rogers. P˘un. L. Dassow and G. In u P. New York. Salomaa. Dordrecht. Culy. n Proc. In R. [26] J. 1997. 13:94– 102. Comp. Casta˜o. Reyle and C. Amsterdam. . Braﬀort and D. editors. pages 85–99. Reidel. Hirschberg. Berlin. Multipushdown languages and grammars. a Heidelberg. Communications of the ACM. 1963. P˘un. New York. Regulated Rewriting in Formal Language Theory. Cherubini. Grammars with controlled derivations. 2003b. MOL 8. Handbook of Formal Languages. Theor.

Bulletin of Mathematical Biology. 5(4):365–396. H. E. 1971. Journal of the Association for Computing Machinery. editors. pages 737–759. MA. Languages. Literal movement grammars. In 104. Harbush. Ginsburg and M. H. Springer. [42] O. [35] A. O. H. [41] J. 25(1):116–133. 4(3):429–453. 2000. 2001. One-way nondeterministic real-time list-storage. Words. Reading. J. No.. 1978. Reversal-bounded multicounter machines and their decision problems. 1966. Journal of the ACM (JACM). AFL with the semilinear property. Groenink. languages: where computer science. In Proceedings of the 7th EACL Conference. 1979. Spanier. ISSN 0169-118X. H. [39] M. and Computation. 1968. University College. biology and linguistics meet. [38] H. Dublin. Massachusetts. Mild context-sensitivity and tuple-based generalizations of context-free grammar. Centrum voor Wiskunde en Informatica (CWI). 1995. Ginsburg and E. Finite-turn pushdown automata. Addison-Wesley Publishing Company. Ibarra. and A. Harkema. regular and context-free selectors. Berling. Ullman. Tokio. 1995. page 579ﬀ. . Groenink. Head. 3:428–446. Decision questions concerning semilinearity. In IWPT 2000. Salomaa. Harrison. In Martin-Vide and V. Harrison. sequences. Hopcroft and Jeﬀrey D. [34] A. In LNCS 2076. a morphisms and commutation of languages. New York. [33] S. Inc. Karhum¨ki. 30 1996.132 BIBLIOGRAPHY [31] S. Formal language theory and dna: An analysis of the generative capacity of speciﬁc recombinant behaviors. Springer. Parsing contextual grammars with linear. Reading. 1987. Introduction to Automata Theory. SIAM Journal on Control. Introduction to Formal Language Theory. [36] K. Harju. 1978. page 22. 2000. [40] T. Ginsburg and E. [37] T. Journal of Computer and System Sciences. Ibarra. [32] S. Addison-Wesley. Mitrana. 15. Spanier. A recognizer for minimalist grammars.

[49] N. 2001. In G. Grammars. Local tree description grammars: A local extension of tag allowing underspeciﬁed dominance relations. Kiefer. Sewing contexts and mildly context-sensitive languages. Netter. [47] Laura Kallmeyer. and D. 1974. Deterministic techniques for eﬃcient non-deterministic parsers. Weir. Languages and Programming. MA. 1997. [45] A. pages 31–81. Joshi and Y. Stuart Shieber. Rozenberg and A. Natural language processing: psycholinguistic. 257. . and A. Dowty. Cambridge. 3.BIBLIOGRAPHY 133 [43] A. A. u [52] Carlos Mart´ ın-Vide and et al. Saarbr¨cken. A geometric hierarchy of languages. Karttunen. Berlin. Cambridge. In Automata. 2001. 2nd Colloquium. Khabbaz. Journal of Computer and System Sciences. editors. [50] Dan Klein and Christopher D. Vol. pages 206– 250. Vijay-Shanker. In Proceedings of the 33rd Annual Meeting of the Association for Computational Linguistics. 2000. Kasper. 8(2):142–157. Tree adjoining grammars: How much context-sensitivity is required to provide reasonable structural description? In D. volume 14 of Lecture Notes in Computer Science. TUCS Technical Report No. New York. Mass. and Thomas Wasow. and K. [46] A. [48] R. Schabes. Foundational issues in natural language processing. Manning. editors. pages 92–99. computational and theoretical perspectives. In Proceedings of the 7th International Workshop on Parsing Technologies. B. Tree-adjoining grammars. In Proceedings of the Fifth International Workshop on Tree Adjoining Grammars and Related Formalisms (TAG+5). Relationship between strong and weak generative power of formal systems. Handbook of Formal Languages. Joshi. MIT Press. K. Vijay-Shanker. L. France. Parsing and hypergraphs. K. 1995. Springer. pages 85–137. [51] B. editors. pages 107–114. Joshi. The convergence of mildly context-sensitive grammatical formalisms. Compilation of HPSG into TAG. In Peter Sells. 1991. Chicago University Press. [44] A. pages 255–269.. 1985. Zwicky. Joshi. 1974. Salomaa. March 1999. Paris. Lang.

1994. PhD thesis. Niemann and F. [56] P. [58] F. In Christian Retor´. PhD thesis. Stanford CA. University of Chicago Press. In Proceedings of Logical Aspects of Computational Linguistics. Journal of the Association for Computing Machinery. Formal and Computational Aspects of Natural Language Syntax. pages [54] J. Strong Generative Capacity. Tree-adjoining language parsing in o(n6 ) time. [55] J. Italy. A. On context-free languages. 1999. Springer-Verlag. Otto. [63] O. 1996. 1998. Kracht. editor. Parikh. An insertion into the chomsky hierarchy? 204–212. CSLI Publications. 1994. IL. USA. Sag. Derivational minimalism is mildly context-sensitive. 13:570–581. LACL’98. 25. SIAM J. n [60] Rohit J. Berlin.A. of Computation. Philadelphia. [57] G. In Rewriting Techniques and Applications: 10th International Conference. The church-rosser languages are the deterministic variants of the growing context-sensitive languages. Trento. pages 329–345. Springer-Verlag. 1999. Stanford University. Rajasekaran. Universidade da Coru˜a. 2000. Alonso Pardo. e LACL’96: First International Conference on Logical Aspects of Computational Linguistics. . Michaelis. 1997. Chicago. [62] S. Grenoble. Head-driven Phrase Structure Grammar. 1998. University of Pennsylvania. [59] M. [61] C. Miller. pages 243–257. McNaughton. In Foundations of Software Science and Computation Structure. 1999. RTA-99. Dept of CIS. Rambow. Michaelis and M. Semilinearity as a syntactic invariant. BIBLIOGRAPHY In Jewels are Forever.134 [53] R. On the connections between rewriting and formal language theory. Pollard and I. LNCS 1631. 1966. Otto. Interpretaci´n Tabular de Aut´matas para lenguajes de Adjunci´n de o o o ´ Arboles.

1994. Sikkel. Theoretical Computer. The computational linguistics of biological sequences. . Schabes. On multiple context-free grammars. 1993. 2000. 1994. Principles and implementation of deductive parsing. [73] S. Sikkel. and T. Parsing schemata.R. Shieber. 2.BIBLIOGRAPHY 135 [64] E. Shieber. Journal of Logic Programming. 199(1–2):87–103. Parsing schemata and correctness of parsing algorithms. Computational Linguistics. 24(1 and 2):73–102.M. A dynamic programming algorithm for rna structure prediction including pseudoknots. 1995. AAAI Press. page 117ﬀ. Shieber and Y. editor. 8:333–343. [68] D. [72] S. 1999. 20:91–124. Marcus. 20. B. pages 334–340. J. DIMACS Series in Discrete Mathematics and Theoretical Computer Science. Rivas and S. Science. In L. Bioinformatics. T. [67] G. [70] D. 1991.B. pages 245–274. Satta. Linguistics and Philosophy. Computational linguistics. 1999. Martin-Vide. pages 2053–2068. Computational Linguistics. [76] K. [69] D. 1985. 1997. Searls. [71] H. Eddy. pages 191–229. Fujii. and F.M. Kasami. 1998. Artiﬁcial Intelligence and Molecular Biology. Journal of Logic Programming. Theoretical Computer Science. Matsumura. Pereira. [65] E. Searls. Contextual grammars as generative models of natural languages. Paun S. 24:3–36. Springer-Verlag. [74] S. Schabes. Mol Biol. Formal language theory and biological macromolecules. An alternative conception of tree-adjoining derivation. Y. Tree-adjoining grammar parsing and boolean matrix multiplication. String variable grammar: A logic grammar formalism for the biological language of DNA. Searls. Rivas and S. M. Evidence against the context-freeness of natural language. C. [66] Gh. Seki. 1998. 1995. Eddy. pages 47–120.B. Hunter.R. [75] K. No. The language of rna: A formal grammar that includes pseudoknots.

. 1998. 1970. D. Information and Control. Deterministic context-sensitive languages: Part II. CA. Tomita. A. pages 259–269. On the concatenation of one-turn pushdowns. Weir. Lecture notes in computer science. Stanford. In Proc. Language. A. pages 104–111. Turn-bounded grammars and their relation to ultralinear languages. J. 17:41–61. Weir. Introduction to the Theory of Computation. pages 1333–1339. A geometric hierarchy beyond context-free languages. pages 523–568. [82] K. P. [85] Ch. Steedman. V. [79] M. Sipser. 1987. 2:188–200. University of Pennsylvania. Derivational minimalism. Grammars. Wartena. [81] E. Characterizing mildly context-sensitive grammar formalisms. Computational linguistics. Boston. 32 No. 1988. 1992. PWS Publishing Company. Workman. Pardo. [88] D. Wartena. 1997. 1976. [87] D. In Proceedings of the Conference on Logical Aspects of Computational Linguistics (LACL ’98). of the 25th ACL. Dependency and coordination in the grammar of dutch and english. 104(2):235–261. K. Walters. Grenoble.136 BIBLIOGRAPHY [77] M. Stabler. Weir. 1998. [84] C. [80] M. 13:31–46. A tabular interpretation of a class of 2-stack automata. [83] D. [86] D. Grammars with composite storages. Information and Control. [78] E. In COLING-ACL. 1997. An eﬃciente augmented-context-free parsing algorithm. 1999. A. de la Clergerie and M. Joshi. Characterizing structural descriptions produced by various grammatical formalisms. Theoretical Computer Science. 1985. PhD thesis. 1987. Massachusetts. Vijay-Shanker. pages 11–14. J. and A. 1328.

Sign up to vote on this title

UsefulNot useful- Context Free Grammers
- MELJUN CORTES Automata Lecture Pushdown Automata 2
- Cliecnt Work
- Assignment 2
- Evaluating Infix Expressions
- Ps Code Presentation
- Circuits 11
- Data Structures
- Stack
- Compiler
- Data Structure and Algorithm Lab Manual
- ec1207 5
- data structure file mpct
- AplicDePilasYColas
- Sri
- The_stack
- 2013 Bcc Solution
- 38731308 C Programming and Data Structures
- ERM358
- Unit7 Data Structures
- D.S
- lecture11 of dsf
- Appendix Q - Answers to Odd-Numbered Review Questions
- Stack Shape Analysis to Detect Obfuscated Calls in Binaries
- CT213_ProgrammingModels
- 26 Stack
- data sructure program made easy
- Appendix Q - Answers to Odd-Numbered Review Questions
- EC_6312_OOPS & DATA_STRUCTURES_LAB_-labmanual-FINAL (1).docx
- testbook2-AOP
- 10.1.1.121.8248

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue reading from where you left off, or restart the preview.

scribd