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.

.

vii . 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.Al Campris y su eterna perserverancia.

.

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

.

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

.

. . . . .1 Relations to other families of languages . . . . .3 Semilinearity of GILs and the Constant Growth property 4. . . . . . . . .5 Determinism in LR-2PDA . . . . . . . . .1 Natural Language . . 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. . . . . . . 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Contents vii Acknowledgments Abstract List of Figures 1 Introduction 1. . . . . . . . . . . .1 Automata with two Stacks . . . . . . . . . . . . . . . . . . . .1. . . . . . . . . . . . . . . . . 2. . . . . 2. . . . . .1. . . . . . . . . . . . . .4 Pumping Lemmas and GILs . . . 2. . . . . . 4 Global Index Languages Properties 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . .5. . . . . . .5. . . . . . . . . . . . 2. . . .2 Biology and the Language of DNA . . . . . . . . . . . . . .1 Deterministic LR-2PDA . 4. . . . . . . . . . . 1. . . . . . . . .1. . . .1. . . . . . . . . . .2 Left Restricted 2 Stack Push Down Automatas (LR-2PDAs) . . . . . . . . 4. . . . . . . .1 trGIGS . . . . . . . . . . . . . . .3 Our proposal . . . . . . . . . . . . . . . . . 3. . . . . . . . . . . 2. . 3. 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Global Index Grammars . . . . . . . . . . . . . . . . . . . . . . . .1 Indexed Grammars and Linear Indexed Grammars 3. . . 3. . 2. Results . . . . . . . . . . . . . . . . . . . . . 1. . . 4. .2 Shrinking Two Pushdown Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 GILs. . . . . . . 2. . . . . . . .2. . . . . . . . . . . . . . . . . . . . .1 Introduction .2 Closure Properties of GILs . . . . . . . . 1.2. . . .3 Comparison with TM. . . . . . . . .2 GIGs examples . . . . . ﬁnite turn CFGs and Ultralinear GILs . . . . PDA and LR-2PDA . . . . . . . . . . . . . .4 Equivalence of GIGs and LR-2PDA . . . . . 3 Global Index Grammars 3. . . . . . . 2. .3 GILs and Dyck Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 EPDA and equivalent 2 Stack Machines . . . . . . . . . . . . . . . . . . . .4 Examples of LR-2PDAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii . . . . . . . . . . . . . . . . . . .2 Outline of the Thesis and Description of the . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 LR-2PDA with deterministic auxiliary stack . . . . . . . . . . . . . . . . .

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

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

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

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

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

. its descriptive power.g. However. and combinatory categorial grammars (CCGs) which are weakly equivalent. 62]). and the time and space complexity of the recognition problem.. These formalisms have long been used to account for natural language phenomena. 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.1. They have been proven to have recognition algorithms with time complexity O(n6 ) considering the size of the grammar a constant factor ( [67. and in the machine model allowing another level of embeddedness in the stack. A TAG/LIG is a level-2 control grammar. Many diﬀerent proposals for extending the power of LIGs/TAGs have been presented in the recent past.a2 k | n ≥ 0} and {w2 k −1 |w ∈ Σ∗ } but does not contain the languages n n {a1 .. where a CFG controls another CFG. Tree Adjoining languages belong to the class L2 in Weir’s hierarchy. One of the characteristics of mildly context sensitive formalisms is that they can be described by a geometric hierarchy of language classes. Therefore the following relations follow: The family of level-k languages contains the languages n n {a1 . A lemma for level k of the hierarchy involves “pumping” 2k positions in the string.1.. INTRODUCTION – Constant growth property (or semi-linearity. 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. head grammars (HGs). tree adjoining grammars (TAGs).a2 k +1 | n ≥ 0} and {w2 k −1 +1 |w ∈ Σ∗ } . L = {an bn cn dn |n ≥ 1}). an increase in descriptive power is correlated with an increase in time and space parsing complexity. In such hierarchies there is a correlation between the complexity of the formalism (grammar or automata). 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). This is reﬂected in the pumping lemma..

He shows that the language of nucleic acids is not regular. gene structure and expression. Gene regulation. conformation of macromolecules and the computational analysis of sequence data are problems which have been approached from such a perspective. 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. In this case the complexity of the recognition problem is a bound polynomial: O(n6 ) space and O(n9 ) time [36]. recombination. 12].4 CHAPTER 1. that it is ambiguous and that it is not context-free. nor deterministic nor linear. and the related Literal Movement Grammars (LMGs). 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. 54]. 68] proposes a grammar model to capture the language of DNA. Multivalued Linear Indexed Grammars [63]. Contextual Languages do not properly include context-free languages. Contextual Grammars [52. Searls [70. mutation and rearrangements.2 Biology and the Language of DNA Recently. or ordering) the recognition problem is in O(n3 ·2 k −1 ) [86. u ¯ . 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). 66] is another formalism with some mildly context sensitive characteristics. 10. 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. Tree Description Grammars [47] are other such examples. Some of those formalisms are: Minimalist grammars [78. 69]). However.1. and m the number of terms in the productions. Range Concatenative Grammars [34. 38. Direct Repeats (the copy language). Pseudoknots (crossing dependencies) represented as: Lk = {uv¯R v R }. Those problems which are beyond context free are: Tandem Repeats (multiple copies). 1. There are other formalisms related to mildly context-sensitive languages that are not characterized by a hierarchy of grammar levels. 87]. For LMGs the complexity of the recognition problem is O(|G|m(+p)n1 +m+2p ) where p is the arity of the predicates.

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

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

Natural Language Modeling (Chapter 6) We present a comparison of LIGs and GIGs (some of these results were presented in [20]). We also show that GILs are closed under substitution by e-free CFLs. O(|I|3 · |G|2 · n6 ). shows that the size of the grammar has the same impact as in the CFG case. We also show that GILs are closed under intersection with regular languages and inverse homomorphism (proved by construction with LR-2PDAs). concatenation and Kleene star. The result. We also give an LR parsing algorithm for for deterministic GILs. They are also the basis for non-deterministic approaches. but the indexing mechanism could have a higher impact. We also prove that GILs are semi-linear.1. The time complexity of the algorithm is O(n6 ). Deterministic LR parsing techniques are relevant. The space complexity is O(n4 ). 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. 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. This is due to the fact that GILs inherit most of CFL properties. Kleene star. intersection with regular languages. for higher level programming languages or deterministic approaches for shallow parsing in natural language. Most of the properties of GILs shown in these chapters are proved using straightforward extensions of CFL proofs. OUTLINE OF THE THESIS AND DESCRIPTION OF THE RESULTS 7 six operations: union. Tree Adjoining Grammars and Head Grammars are weakly . free morphisms and inverse morphisms. e-free regular sets. LIGs. The graph-structured stack enables the computations of a Dyck language over the set of indices and their complements.2. We evaluated the impact of the size of the grammar and the indexing mechanism separately. for example. e-free homomorphism. 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. catenation. Combinatory Categorial Grammars. such as a non-deterministic Generalized LR parsing.

We also show that GIGs can generate trees with dependent paths. There is a long and fruitful tradition that has used those formalisms for Natural Language modeling and processing. and GILs can be represented as in ﬁgure 1. 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. LILs/TALs. LCFRLs LILs CFLs ww anbncn ww + an(bncn ) + GILs Figure 1.2. so the descriptive power of CFGs regarding by natural language phenomena is inherited by GIGs.8 CHAPTER 1.1: Language relations . Finally. We discuss the relationship of LIGs with GILs in depth in section 6. The set inclusion relation between CFLs. we disscuss how some properties of HPSGs can be modeled with GIGs (presented in [19]. INTRODUCTION equivalent. Our conjecture is that it is.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. Other formalisms that might share structural similarities with GIGs could be Minimalist Grammars and Categorial Grammars.

g. 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. but behaves like a PDA. (e. Consequently it is possible to simulate the capacity that a TM 1 See [7. 85].1 Automata with two Stacks Diﬀerent models of 2-Stack Push Down Automata have been proposed.2 It is well known that an unrestricted 2-PDA is equivalent to a Turing Machine (cf.. also generalized models of multistacks (e.Chapter 2 Two Stack Push Down Automata 2. 81. 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. 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. 83.g. 84]). 9].g.. 21. 84.. 2 E. [41]).[7. 9 .[31. 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. 59] [21. or multi-store PDAs as equivalent to n-order EPDA. We need to guarantee that the proposed automaton model does not have the power of a Turing Machine. and n-Stack PDA. Restricted classes of PDA with two stacks (2-PDA) were proposed as equivalent to a second order EPDA1 .

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

1.2. so as to separate diﬀerent sub-stacks. for instance. 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. They also require the use of a symbol for the bottom of the stack. 59].1: Dutch Crossed Dependencies (Joshi & Schabes 97) 2 Stack automata (2-SA) were shown to be equivalent to EPDA [7. 81. Symbols written in the second stack can be accessed only after the preceding stack is empty. It allows the NPDA. The possible moves for a 2-SA automaton are the following [7]: • Read a symbol from the input tape . to recognize crossed dependencies as in the example depicted in the next ﬁgure: Figure 2. they use the additional stack in the same way as the embedded stacks are used in the EPDA.

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

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

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

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

TWO STACK PUSH DOWN AUTOMATA A LR-2PDA: The input can be transversed only once. but unlike a TM. Consider the following transitions (where a is a symbol in Σ). Transfer from one stack to the other is restricted. a. . then the possibility of storing information from the input seen at this move is lost. but it can store again in the second stack (the second copy). (q 2 . . an LR-PDA can recognize the language L3 = {www | w ∈ Σ∗ }. a.16 CHAPTER 2. ) (transfer symbols from auxiliary to main stack) 3. . While recognizing the second copy all the information stored about the ﬁrst copy is lost. consequently what is being read cannot be stored in the main or the auxiliary stack if there is a transferral occurring. (above) . The crucial fact is that transitions type c. This exempliﬁes how many times (and the directions in which) the same substring can be transversed. a. 1. 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. (q 3 . ) = (q 1 . (q 1 .4. . whatever remains at the right is forgotten). if information from the ﬁrst ordered stack is transferred to the second auxiliary stack. a) = (q 2 . the second storage can be written to only when consuming input. In order to avoid the possibility of transferring symbols from one stack to the other indeﬁnitely. 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). There are two work- spaces which also can be transversed only once (as soon there is a move to the left. given the constraints imposed on LR-2PDAs. u) = (q 3 . The corresponding machine is detailed below in the exsection 2. au) (recognize the second copy using the symbols stored in the main stack. However. 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. a) (store the symbols of the ﬁrst copy) 2. 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 ∈ Σ∗ }. from left to right. a. a LR-2PDA is not able to transverse a substring indeﬁnitely. .

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

⊥. $ .$. . $ ) = (ε .a’) = ($. c’) = ( $ . x) = {(q 2 . x⊥. x. c. ⊥. d. ε) ( d . ε ) 3 ( [] . a. c’$) 4 4 ( d . ε ) (c. . x) = {(q 2 . c . ⊥. a.a’) = ($. . c . xx}) 5. x⊥. e. ε ) 4 ( d . x.6: Multiple agreement in an sLR-2PDA 1. c’c’) ( e . ε ) Idem 3 (c. d.. x) = {(q 1 . ⊥) = {(q 1 . d. δ(q 0 . )} 7.. $) = accept (c. δ(q 1 . ε) = (a$. c. x⊥). c ..a. ε ) (b. $) ( d . xx. ⊥. ⊥)} 12.$. )} 6. $) = ( ε.a. $ . $ . δ(q 1 . δ(q 1 . x.18 Three counting dependencies M1 0 CHAPTER 2. ε ) = ( ε. $) = accept 5 5 ( e.a’a’) (c. ⊥)} 3. b. $ . ⊥) = {(q 2 .an | n ≥ 1} 1 2 k . $ . δ(q 1 . $ .. a’ ) = ( ε. x. )} 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 .a’) = (c$.$. x) = {(q 1 . ⊥) = {(q 1 . there is an sLR-2PDA that recognizes the language L(M k ) = {an an . ε ) ( [] . c. ⊥.a’$) Idem 2 (b. . ⊥)} 2. c’) = ( $ . $) = ( ε. ⊥. ε ) 1 (a. .. ak }. δ(q 1 . ε ) ( [] . xx. x. x⊥)} 4. δ(q 2 . ε ) = (aa. )} 11. ⊥)} 8. (q 2 . )} 10. ⊥. b. δ(q 1 . x) = {(q 2 . c . ⊥) = {(q 1 . $) = accept 6 Figure 2. δ(q 2 . where k > 3. c’) = ( ε. x. ). xx} 9. x. δ(q 1 . c . ⊥) = {(q 1 . δ(q 2 . . x) = {(q 1 . .a.a’) = (cc. ⊥. e. δ(q 1 . TWO STACK PUSH DOWN AUTOMATA Four Counting Dependencies M2 Five Counting dependencies M3 (a. x) = {(q 2 . ⊥. (q 1 .

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

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

j) = (q. We can regard to be an abbreviation for all the possible symbols in the top of the stack. the ﬁrst case is not compatible with the third.5. j) 4. ) 2. a. A ∈ Σ and Z. A. and a ∈ Σ ∪ { } does δ(q. I) is nonempty. i) = (q. Condition 2 prevents the choice of move for any equal 4-tuple. Z i . 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. a. Z. or is a deterministic indexing LR-2PDA if and only if: 1. for each q ∈ Q and Z. I ∈ Γ. . I ∈ Γ. i) 3. Z j . a. (q. nor with the fourth. ) is nonempty. ) = (q. then δ(q. . whenever δ(q. Z. j) 2. (q. (q. I) is empty for all I ∈ Γ. If the non-determinism is in the CFG backbone only we can guarantee that the recognition problem is in O(n3 ). 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. . The construction of the LR(k) parsing tables would show whether the indexing mechanism for a given GIG is non-deterministic. Z. (q. I) contain two elements = (q i . Z.5. . for no q ∈ Q. a. because they imply a non-deterministic choice. I) is empty for all a ∈ Σ. b. I i ) and (q j . 3. A. I ∈ Γ. I j ) such that I i = I j . Deﬁnition 5 A LR-2PDA has a deterministic indexing. . a. . . for each q ∈ Q. Z. 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. . whenever δ(q. then δ(q.2.2 LR-2PDA with deterministic auxiliary stack Even if a GIG grammar is non-deterministic. 2. in the following examples of transitions. Therefore. ) = (q. . . 1.

TWO STACK PUSH DOWN AUTOMATA .22 CHAPTER 2.

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

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

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

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

b.. B. E}. A. E.. c}. 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. {i}.. 4 ≤ k} We can generalize the same mechanism even further as follows: Example 8 (Multiple dependencies) L(Ggdp ) = { an (bn cn )+ | n ≥ 1}.Ak → ak Ak 5b. S → a1 S E 2 3a. S → A D 2. C}. e}. P ) such that k ≥ 4 and j = k if k is even or j = k − 1 if k is odd. {a. {a. {a. {a1 . #. O. O3 .an | n ≥ 1. E 2 . k ≥ 4} is in trGIL 1 2 k Proof Construct the GIG grammar Gk = ({S. ak }. . Oi → ai E i+1 If k is even add: If k is odd add: n n 3b. Ak }. 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 .. A.. 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. a j }. S. b. where Gc r = ({S. Ggdp = ({S. #. Ak → ak Ak ak −1 ¯ n 4b. a 4 . b. and P is composed by: 1. g }. GLOBAL INDEX GRAMMARS Example 6 (multiple agreements) L(G5 ) = {an bn cn dn en | n ≥ 1}.... G5 = ({S. {a . {a 2 . . c. Oi → ai Oi E i+1 ai−1 ¯ 6a.. d. {x and P is: 1. 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 . Ak → ak 6b. Ok → ak ak −1 ¯ L(Gn ) = {a1 a2 . D1 .. . A. R. #. B → b B | b x 4. C.. A → a A c | a B c 3.ak | n ≥ 1..3.E i → ai E i ai ai−1 ¯ 2. D.. c. S. m ≥ 1}.2. d}. S→ a1 E 2 4a. L}. S.

S → aS i 2. C}. b}. #. D. {a. j. #. b}∗ } Gww = ({S. S → R 4. #. Example 9 (Copy Language) L(Gww ) = {ww |w ∈ {a. S. S. e. F. {a. {i. S → bS j 3. Above. C. P ) and P = .2 GIGs examples We conjecture that the following languages can be deﬁned with a GIG and cannot be deﬁned using a trGIG. f }. S. b. 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. j}. {a. b}. j}. 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. {i. {i. b}∗ } Gwwn = ({S. E}. B. 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. B. Example 11 (Crossing Dependencies) L(Gcr3 ) = {an bm cl dn em f l } Gcr3 = ({S. #S ⇒ #AR ⇒ #aAER ⇒ #aaER ⇒ i#aabR ⇒ ii#aabbL ⇒ ii#aabbOR ⇒ i#aabbcOER ⇒ #aabbccER ⇒ i#aabbccbRii#aabbccbbL ⇒ ii#aabbccbbC ⇒ i#aabbccbbcC ⇒ #aabbccbbcc 3. d. R → Ra | a ¯ i 5. R}. P ) and P = 1. L. This is not possible in trGIGs because pop rules cannot be left recursive.2. k}. A.28 CHAPTER 3. It is easy to see that by generalizing the same mechanism any ﬁnite number of crossing dependencies can be generated. we mentioned the diﬀerence between push and pop rules in GIGs. c. GLOBAL INDEX GRAMMARS The derivation of the string aabbccbbcc shows ﬁve dependencies. 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 ⇒ k#aS ⇒ #aSbScS ⇒ #abScS ⇒ j#abbcS ⇒ #abbcScSaS ⇒ #abbccSaS ⇒ #abbccaS ⇒ #abbcca We present here the proof that L(Gmix ) = Lmix .g. {a. however it is not so easy to prove or assess whether the 2 A. c}∗ and |a|w = |b|w = |c|w ≥ 1} Example of a derivation for the string abbcca. D → Dd | d This can be even further generalized. 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 . B → bB | bC j ¯ i 2. 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. b. The number of permutations for a string of length n is n!. It allows an incredible number of possible strings of any given length in the language. #. [11] ). We show that GILs are semilinear. S. see e. S → F L ¯ k 29 3. L → Lf | Ef 6. b’s and c’s) are observed. and 1680 strings of length 9). There are also factorial duplicates for the number of times a character occurs in the string. This language though conceptually simple.2. E → Ee | De 7. and at the same time it requires that three dependencies be observed. c}. The number of strings of length 3n is (3n)!/(n!)3 . F → aF | aB i ¯ j 4. obtaining sets of crossing dependencies. b. turns out to be a very challenging problem. therefore ILs and GILs could be incomparable under set inclusion. It was conjectured in [29] that the MIX language is not an IL. k}. GLOBAL INDEX GRAMMARS 1. It is easy to design GIG grammars where the respective languages are in Lmix . 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.3. j. C → cC | c k 5. and the need to ensure that the three dependencies (between a’s. {i. In the mix language each character occurs in one third of the string and there are three characters. Joshi p.c. . 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. Example 12 (MIX language) Gmix = ({S}.

c}∗ and |a|w = |b|w = |c|w ≥ 0}. y = a1 y c1 z. 2. Where ¯ ¯ t1 t2 t3 is any string of length three in Lmix and t designates the terminals that introduce the indices ¯ in the derivation. 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 ). Proof . n = 3: S ⇒ k#a ⇒ #abc k ¯ k ¯ k is clearly in the language. Second direction: Lmix is in L(Gmix ) Basis n = 0. we reach the following point: ∗ ∗ ∗ ∗ . GLOBAL INDEX GRAMMARS language is indeed Lmix . b. This blocking eﬀect can be illustrated by the following hypothetical situation: suppose uwyz might be composed by u = u b1 . 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. and t are members of the pairs that remove indices in the derivation. S ⇒ jδ #u bS ⇒ δ#u bSaScS ⇒ iδ #u bw caScS ⇒ δ #u bw caay bcS If we try to combine the derivation proposed in 1. 1. b s and c s due to the constraint imposed by the indexing mechanism.30 CHAPTER 3. First direction: L(Gmix ) is in Lmix = {w|w ∈ {a. S ⇒ δ#uS ⇒ kδ#uaS ⇒ δ#uaSbScS ⇒ δ #uawbScS But at this point the strings b and c might block a possible derivation. n ≥ 0. with the one proposed in 2. where ¯ ¯ ¯ ¯ |uwyz| = n. w = w c2 and y = a2 y b2 trigger the following derivation (perhaps the only one). 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. We need to prove that ut1 wt2 y t3 z is in L(GMIX ) ( |uti wti y ti z| = n + 3).

because the grammar is highly ambiguous. GLOBAL INDEX GRAMMARS 3.tj . and t are members of the pairs that remove 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. 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. We prove now that such a blocking eﬀect in the indexing is not possible: there are always alternative derivations. 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 . 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 .ti )n ] And this problem is reduced to: ¯¯¯¯ tj ti S tj tj ti ti S i. there are three diﬀerent indices (ti = tj = tk ): ti utj vtk . In other words.: baScacbS where the two non terminal S expand the ti n−1 triples. We need to account whether there is a possible conﬁguration such that a conﬂict of indices arises. Therefore.e.. tk ..2. Case 1. tj are reduced to the case of two conﬂicting indices. ... Case 2.. 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 . there is no guarantee that the necessary sequence of indices are removed.3.(ti . removing the index j.. We show now that this situation is impossible and that therefore Lmix is in L(GMIX ). 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 .. clearly S ⇒ i#ti S ⇒ #ti Stj Stk S and the complements of ti .

This assumption is made based on the previous two claims. z and y do not introduce possible blocking indices (i. 3. given we are considering just two possible conﬂicting indices. x. ¯ ¯ ¯ ¯ 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. GLOBAL INDEX GRAMMARS Assume the possible empty strings u.) 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 . The well-known Chomsky-Sch¨tzenberger theorem [22]. The tests were performed on the strings of length 6 and 9.32 CHAPTER 3. shows that any CFG is u . 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.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. they are also removed in the derivation of the substring). if indices are introduced. 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 . w.e. 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. etc.

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

n > 1 then: Case (A) If: #S ⇒ #yB ⇒ #ya S 1 ⇒ zA1 ⇒ za¯ a It is clear that if z ∈ Dr . 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. if p = A → α then p1 = A1 → ¯ 1 iiα [i] L(G1) is a CFL. (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 . The proof is an induction on the length of the computation sequence. φ and the corresponding CFL. Suppose w ∈ φ(Dr ∩ L(G1)). Induction Hypothesis. 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 .34 iα 3. And if φ(z) = y then φ(za¯) = ya a a Case (B) If: #S ⇒ #uA ⇒ i#uaB ⇒ i#uayC ⇒ #uaya by Induction Hypothesis. y ∈ k ¯ ¯ T ∗ ) implies there is a L(G1) derivation u A ⇒ u zB (where u . GLOBAL INDEX GRAMMARS 4. Suppose that if there is a GIL derivation δ#uA ⇒ δ#uyB (where u. so is za¯. We have to show that L = φ(Dr ∩ L(G1)). And if φ(z) = y and φ(u ) = u then φ(u ia¯z¯ a) = uaza a ia¯ a ia¯ The reverse direction φ(Dr ∩ L(G1)) ⊆ L. so we have deﬁned Dr . z ∈ (T T ∪ I ∪ I)∗ ) such that z ∈ Dr k and φ(z) = y for every k < n. z ∈ Dr so is u ia¯z¯ a. First direction L ⊆ φ(Dr ∩ L(G1)). Suppose w ∈ L. if p = A → α then p1 = A1 → ¯ 1 ¯ i CHAPTER 3.

¯ i. and we construct GwwD from Gww as follows: GwwD = ({S. {i. a. i. . S →S a¯¯ ai 3. The proof is an extension of the equivalence proof between CFGs and PDAs. S }. j}. This is on our view a consequence of the fact that GIGs are a natural extension of CFGs. #.4 Equivalence of GIGs and LR-2PDA In this section we show the equivalence of GIGs and LR-2PDA. S → a¯iS a 6. Theorem 2 If L is a GIL. ¯ j.3. {a. ¯ 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. P ) and P = 1. S → aS i 2. S → S b¯¯ bj 1. S → S a ¯ i 7. i.4. S → S b ¯ j 6. ¯ j. S → S ¯ a ia¯ 5. {a. S → S a ¯ i 5. #. b}. ¯ = Σ∪Σ. a. b. b. S →S b¯¯ bj 4. S }. 2. ¯ i. 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 . b}∗ } Given Gww = ({S. S → S b ¯ j ¯ Let D4 be the semi-Dyck set deﬁned over Σ0 = {a. j} ¯ b. j}. S → 4. j} CF Lww = L(GwwD ). 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 . S → 3. then there exists a LR-2PDA M such that L= L(M). ¯ S. S → b¯ bjS 7. P ) and P = ¯ b. S. Σ = T = {a. b}∪I = {i. S → bS j 3.

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

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

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

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

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

The relation to Growing Context Sensitive languages is interesting for a similar reason. 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. GILs are incomparable to the Growing Context Sensitive Languages (GCSLs). However GCSLs might include trGILs. 41 . Most of other relations are more diﬃcult to determine. • Proper inclusion of GILs in CSLs. GILs might include LILs and perhaps LCFRLs. corresponds to an amount of tape equal to the input in a LBA. another family of languages that has some similarities with GILs. The corresponding automaton is another two stack machine. Moreover. Therefore a LBA can simulate a LR-2PDA. and the constraints imposed on the use of the additional stack in the GIL automaton might be seen as a shrinking property. 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. We do not address possible relationship with the counter languages [42] however.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.Chapter 4 Global Index Languages Properties 4. The additional stack in GIGs/LR-2PDA. GILs and ILs might be incomparable. the relation to LILs is interesting because of their similarities both in the grammar and the automaton model.

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

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

GLOBAL INDEX LANGUAGES PROPERTIES Note that the requirement that the substituting grammar be in GNF implies that it is an -free CFL. Y ) contains (q . q 0 ]. δ. Parikh [60] showed that CFLs are semilinear. GILs do not tolerate an substitution due to the constraints on type b. Σ. γ. Σ. in which case p = p and η = i or η = Y It is easy to see that ([p0 . Z. w) = p i Proposition 4 Global Index Languages are closed under inverse homomorphism. q ]. X. ⊥. η). q]. Γ. X. q]. GILs are also closed under intersection with regular languages and inverse homomorphism. Construct an LR-2PDA M 1 accepting h−1 (L) in the following way. 4. F G ) and let R be L(A) for a DFA A = (QA . Proof Let h : Σ → ∆ be a homomorphism and let L be a GIL. Γ. Let L = L(M ) where M is the LR-2PDA (Q. η) if and only if: δ A (p.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. F A ×F G ) such that δ is deﬁned as follows: δ([p. η) and δ(p0 . [p0 . ⊥) (q.44 CHAPTER 4. . On input a M 1 generates the string h(a) stores it in a buﬀer and simulates M on h(a). γ. Proof Let L be L(M ) for an LR-2PDA M =(QG . q 0 ]. . q 0 . a) = p and δ G (q. Note that a may be . Y ) contains ([p . Γ. δ A . δ. (push) productions which require Greibach normal form. q 0 . F A ). Therefore L(M 1) = {w | h(w) ∈ L}. Again. ⊥. Proposition 3 If L is a Global Index Language and R is a regular set. ⊥) ([p. Σ. . a. p0 . ⊥. F ). a. η) if and only if (an induction proof is given by [41] for the CFL case) (q 0 . Construct M’ = (QA ×QG . w. γ. δ G . w. γ. 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). L ∩ R is a Global Index Language. Σ.

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

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

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

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

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

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

C 1 )) s. C 2 = C 1 + 1 if δ = ¯ and i = δ 1 then O2 = O1 + 1 and i (δ 2 . k] ∈ S j where δ 2 = i if µ = ¯ i: δ add [∆1 . This implementation used Shieber’s deduction engine backbone [72]. O. C 2 ) and O1 = O2 ( move) if δ = [δ 1 ] then (δ 1 . j] to S i + 1 µ 3. to perform the corresponding operations on the graph-structured stack. As we said. we represent nodes in the graph-structured stack with pairs (δ. 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 (#. Completer A If [∆1 . 1. O − 1. O2 .2 add every [(δ 2 . j] ∈ S i and wi + 1 = a: µ add [∆. C 2 ). CHAPTER 5. (δ 1 . Scanner If [∆. Predictor If [(δ 1 . A → • γ. B → α • Aβ. C 2 ) and O1 = O2 2.t. RECOGNITION AND PARSING OF GILS If i = n and Sn+1 = {[(#. Completer B If [∆1 . scanner. The example . O2 = O1 + 1 and push( (δ 2 . O. C 1 ) ) s. A → αa • β. i] to S i δ such that: if δ ∈ I then δ 2 = δ. B → γ • . k] to S i δ 3. C 2 ). C) such that C ≤ n. O.54 3 4 If S i+1 is empty. 0). k] ∈ S j where δ 2 = i if µ = [i]: add [∆1 . A → α • aβ. 0. O. A → αB • β. The operations predictor. C 2 ) ∈ pop((δ 1 . A → αB • β. 0). O − 1. A → α • Bβ. C 1 ) = (δ 2 . C 1 ). A → α • Bβ. B → γ • . completer used in the For loop in 2 are modiﬁed as follows. O. C 2 ). O. C 2 ). j] ∈ S i and (A → γ) ∈ P : µ δ 1. C 2 = C 1 − 1 if δ = then (δ 1 .t. j] ∈ S i where µ = µ δ or µ = [i]: for [(δ 2 . 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. j] ∈ S i : µ for [(δ 2 . O1 . S → S$ • . Reject. and have the corresponding initial order in the derivation.

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

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

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

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

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

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

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

∆ + 2 . ∆R ): ¯ ¯ ¯ where ∆ − 1 . ∆ + 2 . ∆ + 2 ∈ I. The interpretation of these edge is that there is a path connecting the two ∆In nodes. ∆ − 3 . ∆R ) to Pathset . therefore we will call them I-edges. This kind of edge relates ∆In nodes. B I−edge α push or pop edge A Figure 5. and ∆ − 1 . ∆ − 3 ∈ I. ∆R 2) add Path(∆ − 1 . ∆ + 2 . ∆R2 ) add Path(∆ − 1 ∆ − 3 . ∆R2 ) to Pathset ¯ else if ∆ − 1 > ∆R ¯ For edgeC(∆ − 1 . ∆R ) to Pathset ¯ For edgeC (∆−1 . RECOGNITION AND PARSING OF GILS As we mentioned when we introduced the Push operation Push(newnode. Algorithm 5 . by the following Push function.64 CHAPTER 5. I-edges are depicted in ﬁgure 5.initialnode). ∆ − 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). ∆ + 2 .12. ∆R2 ) to Pathset ¯ For edge(∆−1 . ∆R2 ∈ I ∪ I. ∆ + 2 . StorePath(∆ − 1 . ∆ − 3 ) and For Path(∆ − 3 . ∆R . These edges will be introduced in the predict operation. we will make use of an additional type of edge.oldactivnode. ∆R2 ) add Path(∆ − 1 . ∆ + 2 . I the set of indices.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. ∆ + 2 ) such that ∆ + 2 ≥ ∆R add Path(∆ − 1 . 1 2 3 4 5 6 7 8 9 10 11 12 ¯ If ∆ − 1 = ∆R : ¯ For edge(∆ − 1 . Notice that an I-edge can be identical to a push or pop edge.

0). 0). #. pop or e-move). (#.2. 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. Initialize the graph-structured stack with the node (#. 0). p1 ) designates an item active node (∆Ac ) and I(δ 0 . T. The operations predictor. [δ] . I. p0 ) designates an item initial node. Reject. These subcases are constrained by the type of production applied (push.b) where the active node is in I. the function path is used.2. Let G = (N.a): ¯ the active node in the triggering item is in I or (1. This is also required for productions ¯ that check the top of the stack: (A → γ) when the triggering item Active node is in I.5. we represent nodes in the graph-structured stack with pairs (δ ± . GILS RECOGNITION USING EARLEY ALGORITHM Algorithm 6 (Earley Recognition for GIGs) . 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. S → S$ • . 0).an in which the index δ + in I was introduced. 0). (#. Create the Sets S i : 1 S0 = [(#. In the second case. Prediction and Scanner Operations Prediction Operations will be divided in diﬀerent subcases... to retrieve the active nodes in I. S → • S$. δ ∈ DI and the absolute value of p (abs(p)) refers to the position in w = a1 . In the pop case there are two subcases (1. 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: (#. 0). and ai ∈ T for 1 ≤ i ≤ n. Let w = a1 a2 · · · an be an input string. S. n ≥ 0.2. Ac(δ 1 . scanner. p) such that −n ≤ p ≤ n. If i = n and Sn+1 = {[(#. P ) be a GIG.

A → • γ. p0 )) ¯ 1. p0 ). p2 ). p1 ). i] to S i such that: p2 = i + 1. pr )) and δ 2 = δ 3 and p3 = −p2 and push( (δ 2 .3 Predictor e-move If [Ac(δ 1 . (δ 0 . (δ 0 . A → • γ. p0 ). ¯ such that: δ 2 = δ 1 and p2 = −p1 (A → γ) ∈ P δ2 and ¯ δ 2 ∈ I = δ¯ : 1 add every [Ac(δ 2 .2. p1 ). p1 ). (δ 1 . I(δ 2 . I(δ 0 . j] ∈ S i and (A → γ) ∈ P and δ 1 . A → αa • β. p3 ).1 Predictor Push CHAPTER 5. i] to S i and push( (δ 2 . p2 ). (δ 0 . δ 2 ∈ I: δ2 add every [Ac(δ 2 . p0 ) ) StorePath((δ 2 . j] ∈ S i . p2 ). p0 ) ) StorePath((δ 2 . δ r . 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 ). δ 1 ∈ I and δ 2 = δ add every [Ac(δ 1 .2. B → α • Aβ. p2 ). p0 ).a Predictor Pop: Active Node is in I If [Ac(δ 1 . j] ∈ S i . i] to S i 2. B → α • Aβ. B → α • Aβ. and push( (δ 2 . p0 ). p1 ). A → • γ. p2 ). A → α • aβ. RECOGNITION AND PARSING OF GILS If [Ac(δ 1 . p1 ). pr )) 1. A → • γ. p0 ). j] ∈ S i and wi + 1 = a: add [∆A . j] ∈ S i δ= and (A → γ) ∈ P such that δ ¯ or δ = [δ 1 ] or (δ 2 . I(δ 0 . (A → γ) ∈ P δ2 and δ 2 ∈ I: add every [Ac(δ 2 . (δ 1 . p2 ). p2 ). (δ 1 .b Predictor Pop: Active Node is in I ¯ If [Ac(δ 1 . ∆In . I(δ 0 . ∆In . I(cl(δ 0 ). p1 ). I(δ 2 . p2 ) ∈ path(δ 1 . (δ 0 . p2 ). p0 ) ) 1. (δ 3 . p1 ). p2 ). I(δ 2 . i] to S i ¯ such that: (δ 3 . (δ r . p1 ). B → α • Aβ. I(δ 0 .66 1. p1 ). p2 ). Scanner If [∆Ac . p1 ). All the completer operations . p3 ) ∈ path((δ 1 . p2 ).

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

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

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

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

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

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

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

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

push. .3. k ≥ 0. The properties of Earley’s algorithm for CFGs remain unchanged. 5. b.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. 8 Context Free grammars where the set of items in each state set is bounded by a constant. S. In practice. the similar grammar Gamb3 = ({S. The expensive one is the ﬁrst case. However. 7 and 8 would be bounded by the square of the number of b’s scanned so far. 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. {i. Usually. TAGs. In the analysis we present here. 4. #. O(n3 ) holds for grammars with constant or unambiguous indexing.5. }. c. C}. and other grammar formalisms run much better than the worst case. 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 sources of increase in the time complexity are a) ambiguity between mode of operation in the stack ( . Unambiguous indexing should be understood as those grammars that produce for each string in the language a unique indexing derivation.3. m + k = n} Therefore. 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. {a. All average case results reported are empirical. This will allow to compare what is the impact of the indexing mechanism as an independent multiplicative factor. d}. The size of the grammar designated by |G| corresponds to the number of rules and the number of non-terminals. so the following results hold: O(n6 ) is the worst case. 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. the real limiting factor in practice is the size of the grammar. B. or pop) through the same derivation CF path and b) a diﬀerent index value used in the same type of stack operation. we keep separate the size of the context-free backbone and the indexing mechanism. most algorithms for CFGs. There are no mathematical average case results. m. 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]).

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

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

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

i] is inserted in the set S j if and only if the following holds: 1.5. i. −.. l b[η] → ∆ • ..η] → t[... i..20: Earley CFG invariant . ai a i+1 ... p. its space complexity is O(n4 ). p. t[.ai Aγ 2. Given there are four parameter bound by n in each item. k t[η] → t[η r ] • . aj Figure 5. j.. and the number of possible nodes is bound by n.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 → α • β.ηη r ] 5. Storage of the graph-structured stack takes O(n3 ). Storing the combination of i-edges and edges involves three nodes. q. q. therefore it can be done in a n × n × n table. S ⇒ a1 . l A note on Space Complexity The space complexity is determined by the storage of Earley items.. PROOF OF THE CORRECTNESS OF THE ALGORITHM Type 4 Completor: 79 t[η] → • t[η r ].. i t[η r ] → Θ • . i.4. k. −.aj ∗ ∗ S γ A η α β a1 . j. α ⇒ ai+1 .

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

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

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

DPrPop1 . η ik . η ij η jj ∧ η p Completers DCompB . and DPrPop2 have the following shape. Predictor steps can be decomposed as: η ij η ij η jj ηp η ij ηp Completer Steps can be decomposed as: η ik .4. DPath b .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. Items in IC EGIG will participate in some restricted deduction steps. DPath2 a . DPrPush . However there is an additional type of deduction step performed in this parsing schema. Prediction Push and Pop deduction Steps. A Parsing system is correct if F(P) ∩ V(P) = C(P) 5. and this corresponds to the control language. DCompF . The parsing schema for GIGs corresponds to the algorithm 6 presented in section 5. and they introduce completion items η p in IC EarleyGIG . 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. A parsing system (P) is complete if F(P) ∩ V(P) ⊇ C(P) (all correct ﬁnal items are valid). will be used to perform the corresponding deduction steps. DPath2 b . η kj η ik . and they introduce prediction items η p in IC EarleyGIG . a diﬀerent set of items. Therefore IC EGIG . η kj Those deduction steps that compute the the Control language are DPath a . will represent edges and paths in the graph. and DCompG have the following shape. Those items in IC EGIG .2.4. 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).5. η kj η ij ∧ η p This kind of deduction step can be understood as shortform for two deduction steps.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

976 Mix L.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. The sets that deﬁne the states in GIG LR parsing are composed by a pair of sets (IT.. We use this notion of viable preﬁxes to describe the computation of the rm rm ∗ main stack in a LR-2PDA. [2]). The similarities of Earley Parsing and LR parsing are made explicit in those transformations. We will refer to the connections between Earley parsing and LR parsing to clarify this presentation.500 ≈2.98 Length 6 9/10 12 15/16 18 CHAPTER 5. ≈ 300 ≈ 1. 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..000 ≈6. In the GIG case.. 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. This approach can be extended to a Generalized LR parsing approach.500 ≈ 2. 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 . ≈ 500 ≈ 2. RECOGNITION AND PARSING OF GILS n4 1296 10. 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. 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. ≈ 100 ≈ 400 ≈ 700 ≈ 1. Both [75] and [3] describe transformations of Earley Parsing Schemata to LR Parsing Schemata..100 ≈5.6. 5.000 Copy L.ai Aβ ⇒ δγ j a1 . 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. ∗ ∗ rm rm ∗ . We say a GIG item index pair [ δ.625 104.800 5.000 ≈ 16.000 ≈ 28. It is also more complex because GIL derivation requires leftmost derivation for the stack operations.aj β 2 β. Therefore the set of items has to encode the corresponding top-down prediction that aﬀects the stack of indices. [80]).000 ≈ 9. if multiple values are allowed in the parsing table (cf.100 MCopy L. [2]). [41].1 LR items and viable preﬁxes We assume the reader has knowledge of LR parsing techniques (cf. IN ).

Apply this rule until no more new items can be added to the closure of IT .The transitions of this NFA are of the following form: δ(A → α • Bβ. Such productions are considered in case 2 of the Goto function. Initially. if the index operation is for instance ¯: ι δ(A → α • Bβ. [41]) the Closure operation is equivalent to obtaining the set of states of a NFA that recognizes the viable preﬁxes. j}. ) |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. S → bS j 3. For CFG parsing (cf. However in Earley’s algorithm this computation is done in run-time while in LR parsing it is precompiled in the LR states.6. b}. If IT is a set of items for a grammar G. R → [#] 4. 2. then closure(IT ) is the set of items constructed from IT by the two rules: 1.2 The Closure Operation. The Closure operation is equivalent to the Predict function in Earley parsing (cf. the goto function and the parsing table. {i. {a.6. Gwcw = ({S. 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. The following example uses a grammar for the language Lwcw to depict the construction of the set of items. R → Rb ¯ j The set of states for the grammar Gwcw should encode the possible conﬁgurations of the stack of indices as follows: . R}. LR PARSING FOR GILS 99 5. ¯ 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.[3]). . Example 21 L(Gwcw ) = {wcw |w ∈ {a.5. #. S → aS i 2. For the GIG algorithm the set of items and possible index values cannot be determined only by the Closure operation. 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. R → Ra ¯ i 5. every item in IT is added to closure(IT ). ι) = {(B → • γ. S. S → cR 6. ) = {B → • γ |B → γ is a production } (a NFA transition) In the GIG case the transitions should be as follows. P ) and P is: 1. b}∗ }.

ι). #} # # 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. j. then goto(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. if µ µ I is the set of items that are valid for some viable preﬁx γ. We will say an index i is in IN if (i. The set I6 requires that the stack be empty. is the set of items that are valid of the viable preﬁx-index pairs (γX. ι) = (I j . X. j. The operation goto(IT. 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. The CF Goto function is a DFA transition function where IT is in the state set and X is in the vocabulary. if I is the set of items that are valid for some viable preﬁx-index pairs (γ. 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. where IT is a set of items and X is a grammar symbol. ιj ).100 I0 : # S → •S S → • aS i CHAPTER 5. #} {i. The CF function goto(IT. 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. s) where i is an index symbol and s is a state deﬁned by a set of items closure. 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. X). is deﬁned to be the closure of the set of all items [A → αX • β] such that [A → α • Xβ] is in IT . IN ) is deﬁned to be the pair (IT 2 .23: Set of States for Gwcw In the same way that the dot implies that some input symbols have been consumed.6.3 The Goto Operation. #} {i. X.IN 2 ) where either 1 or 2 applies: . 5.ιj ) in other words. X) is the set of items that are valid for the viable preﬁx γX. In the GIG case. s) is in IN . Intuitively.

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

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

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

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

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

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.106 CHAPTER 5.

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

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

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

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

c.c.c.c.a] [c.a] c [a] b [] a [d.a] [c.a] a b c d [c.a] [b.c.a] b c d ε a Figure 6.b.b.a] [b.b. 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.a] [a.a] c d d [c.b.d] [c. but they can generate the one presented in the ﬁgure 6.c.c. corresponding to the grammar shown in example 10.b.c.6.d] [a.b.b.d] [] [d.a] [a] [] [d.a] [a] [a] [] [b.d] [b.b.d] [d] [d. Such structure cannot be generated by a LIG.b.a] [d.6 at the left either.a] ε a d [b.c.b.a] [a] a b a c [b.c.b.a] [b.7.a] [a] a [] b Figure 6.b.6: An IG and GIG structural descriptions of the copy language GIGs cannot produce the structural description of ﬁgure 6. [d] [c. [] [a] [b.a] [b.a] [c.b. where the arrows depict the leftmost derivation order.b. GIGs can also produce similar structural descriptions for the language of multiple copies (the language {ww+ | w ∈ Σ∗ } as shown in ﬁgure 6.a] [d.b.a] d c b [c.c.b.b.c.b.7: A GIG structural description for the multiple copy language .a] [d.6 (right).b.a] [c. but can be generated by an IG.d] a b c d [c.1.d] [a.d] [b.a] [c.c.c.d] b c [d] d [b.a] [a] [d.

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

.] d [i] a c d b d e Figure 6..i] f [.i] a [i] [i] [i.i] a b b c [i] [.5 Crossing dependencies Crossing dependencies in LIGs and TAGs have the same structural description as the copy language.] [i] a f [i.] d d ε b Figure 6.] c [i..i] [i.6.i] a c c [.i] [i.10: GIG structural descriptions of 4 dependencies [..] [i.11: GIG structural descriptions of 3 dependencies 6.. .. 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] a [.1.i] [i] a [i.1. The ﬁrst example is generated by the grammars Gcr presented in Chapter 3 and repeated here..] [.i] [i.] c [i] a [i.i] b [i] [i] c [. GIGs can produce crossing dependencies with some alternative structures as depicted in the following structures..] [.

A. where Gcr = ({S. {x}. 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). S. d}.114 Example 24 (Crossing Dependencies) . P ) and P is: S→AD A→aAc|aBc 3. e. B. CHAPTER 6. {x. #. f. C}. The following kind of dependencies can be obtained: Example 25 (Crossing Dependencies 2) . g. APPLICABILITY OF GIGS L(Gcr ) = {an bm cn dm | n. c. m ≥ 1}. B. 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 . {a. d. h}. m ≥ 1}. S. C}. A. b. c. #. b. L(Gcr8 ) = {an bn cm dm en f n g m hm | n. where Gcr8 = ({S. y}. {a.

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

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

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

118 [.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.e.i] d [i] b b [.i] [i] [.] c c d CHAPTER 6. this alternative . The problem is that they require the two directions of recursion (i...] [i] b [i. However. APPLICABILITY OF GIGS [.] [i] [i. They are however generated by GIGs as shown in ﬁgure 6. both right and left) for push productions..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.15: LIGs not in push-GNF II These languages do not seem to be obtainable with a LIG in push-GNF.] c c d d b Figure 6..

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

This is exempliﬁed with the productions X → x and X → x.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). an how the elements contained in the stack can be correlated to constituents or lexical items (terminal symbols) in a constituent recognition process. The arrows indicate how the transmission of features is encoded in the leftmost derivation order. according to what is on the top of the stack.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. Example 27 (intransitive verb) XP → Y P XP XP → X YP →Y X→x nv ¯ Y →y n . obtaining very similar structural descriptions. 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.17 depicts the tree structure corresponding to the Head-Subject Schema in HPSG [61]. Head-Subj-Schema Figure 6.120 CHAPTER 6. 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. APPLICABILITY OF GIGS might be produced using the same production.

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 .. corresponding to the deriva- . GIGS AND HPSGS [.] 121 YP [n. where the initial conﬁguration of the stack is assumed to be [n]: Example 28 (transitive verb) ....] y [v.21. 3 n > Figure 6.] X x Figure 6.20.] XP [v.6.19 shows the tree structure corresponding to the Head-Complement schema in HPSG.] Y [n. 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 .19: Head-Comps Schema tree representation Figure 6.3. The following GIG productions generate the structural description corresponding to ﬁgure 6. 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.] XP [v...

APPLICABILITY OF GIGS XP [ v ] X [n v] [n v] CP [ v ] Y [v] CP x y ε Figure 6. We show the contents of the stack when each lexical item is introduced in the derivation.22 shows how coordination combined with SLASH can be encoded by a GIG.122 [n] CHAPTER 6. Example 29 (SLASH in GIG format) . ∗ .20: Head-Comp in GIG format tion given in example 29. 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.

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.6.21: SLASH in GIG format Example 30 (SLASH and Coordination2) . 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 ∗ .

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 .

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

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

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

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

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

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

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

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

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

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

Sign up to vote on this title

UsefulNot useful- Lab Prgrms30
- Algorithms by Codewell
- npdadoc
- 141353-LM
- english
- TESOL-Program.pdf
- They Are Rapid Methods for the Investigation of the Language
- 9A05407 Formal Languages and Automata Theory
- H6-sol
- Teaching Children
- Capitolul II Corectat Final
- Hybrid Systems Modeling
- Writing Rubric
- dikarezkyana
- Chapter 1
- Help Sts Enjoy Grammar
- MELJUN CORTES CS113_StudyGuide_chap7
- CS301_2nd_Assignment Idea Solution Fall 2011
- Data Structures & System Programming Lab File
- Reviewing the Puzzle of CLIL
- Reviewing the Puzzle of CLIL, Ioannou Georgiou READ
- Current Issues in Linguistic Theory 5th Printing Janua Linguarum Series Minor 38
- Getting People to Say Yes
- ESP
- teaching grammar.docx
- BI Teacher Guidebook Year 2
- english
- Teacher's Guide Year 3 SK & SJK
- PANDUAN GURU
- English_Teacher_Guidebook_Year_2.pdf
- 10.1.1.121.8248