Indexed Counter Languages Informatique Théorique Et Applications, Tome 26, No 1 (1992), P

Total Page:16

File Type:pdf, Size:1020Kb

Indexed Counter Languages Informatique Théorique Et Applications, Tome 26, No 1 (1992), P INFORMATIQUE THÉORIQUE ET APPLICATIONS J. DUSKE M. MIDDENDORF R. PARCHMANN Indexed counter languages Informatique théorique et applications, tome 26, no 1 (1992), p. 93-113 <http://www.numdam.org/item?id=ITA_1992__26_1_93_0> © AFCET, 1992, tous droits réservés. L’accès aux archives de la revue « Informatique théorique et applications » im- plique l’accord avec les conditions générales d’utilisation (http://www.numdam. org/conditions). Toute utilisation commerciale ou impression systématique est constitutive d’une infraction pénale. Toute copie ou impression de ce fichier doit contenir la présente mention de copyright. Article numérisé dans le cadre du programme Numérisation de documents anciens mathématiques http://www.numdam.org/ Informatique théorique et Applications/Theoretical Informaties and Applications (vol. 26, n° 1, 1992, p. 93 à 113) INDEXED COUNTER LANGUAGES (*) by J. DUSKE (x), M. MIDDENDORF (*) and R. PARCHMANN (*) Communicated by J. BERSTEL Abstract. — Starting with the characterization of context-free counter languages by rightlinear indexed grammars with one index, indexed counter grammars are introduced and investigated. The family of indexed counter languages is a full AFL properly contained in the family of indexed languages and incomparable with the full trio oflinear indexed languages. Furthermore by modifying the dérivation mode, a characterization of type-0 languages by indexed counter grammars is given. Résumé. - Après une caractêrisation des langages algébriques à compteurs par des grammaires indexées linéaires droites d'index 1, on introduit et étudie les grammaires indexées à compteurs. La famille des langages indexés à compteurs est une AFL proprement contenue dans la famille des langages indexés, et incomparable au cône rationnel des langages indexés linéaires. De plus, en modifiant le mode de dérivation, on obtient une caractêrisation des langages de type 0 par des grammaires indexées à compteurs. 1. INTRODUCTION Indexed grammers have been introduced by Aho [1] as an extension of context-free grammars. In the study of indexed grammars the question arises whether the generative power of these grammars dépends on the number of indices. It is obvious, that an indexed grammar with an empty set of indices can only generate context-free languages. On the other hand two indices suffîce to generate ail indexed languages, because the indices of a gênerai indexed grammar can be coded by words of two indices. The concept of indexed grammars permits two principle ways of represen- ting context-free languages; first by using a context-free grammar, which is a special form of an indexed grammar, and second by using a rightlinear (*) Received August 1990, revised November 1990. (*) Institut fur Informatik, Universitât Hannover, D-3000 Hannover, Germany. Informatique théorique et Applications/Theoretical Informaties and Applications 0988-3754/92/01 93 21/S4.10/© AFCET-Gauthier-Villars 94 J. DUSKE, M. MIDDENDORF, R. PARCHMANN indexed grammar, which can be interpreted as a grammatical description of a pushdown automaton. Hence there is a natural way of representing context-free counter languages as rightlinear indexed grammars with only one index and a special "endmar- ker". Extending this concept to the case of a (genera!) indexed grammar, the use of only one index symbol can be interpreted as "counting while perform- ing context-free dérivations". The "endmarker" allows to detect a count of zero and to start counting again. In Section 2 we introducé such grammars formally and give examples. These grammars are called indexed counter grammars or ic-grammars and the corresponding languages are called indexed counter or ic-languages. Our investigations show that this subclass of indexed languages shares many properties with the context-free counter languages. In Section 3 we first give normal forms of ic-grammars. In particular, using regularity properties of the index words appearing in dérivations of indexed grammars, we arrive at the e-free Standard form of ic-grammars. Then it is shown that grammars in this standard form allow dérivations of terminal words such that the lengths of the appearing index words in these dérivations are linear bounded by the lengths of the derived words. With the aid of this result we give in Section 4 an example of an indexed language which is not an ic-language, i. e, the family of ic-languages (which is a full AFL) is properly contained in the family of indexed languages. We also investigate the linear and rightlinear forms of ic-grammars and completely characterize the subset and proper subset relation between the classes of (linear, rightlinear) indexed, (linear, rightlinear) indexed counter and (linear, rightlinear) context-free grammars. In the final Section 5 we consider indexed grammars with another dériva- tion mode introduced in [6]. Under this dérivation mode ic-grammârs generate the same languages as phrase structure grammars. This result shows that type-O languages can be obtained by "counting on leftmost dérivations of a context-free grammar". 2. FORMAL DEFINITIONS AND BASIC PROPERTIES Let us first defme the notion of an (linear, rightlinear) indexed grammar: DÉFINITION 2.1: An indexed grammar is a 5-tuple G = (N,T,I,P,S) where (1) TV, T, ƒ are finite, pairwise disjoint sets; the sets of variables, terminals and indices respectively; Informatique théorique et Applications/Theoretical Informaties and Applications INDEXED COUNTER LANGUAGES 95 (2) P is a finite set of pairs (Af 0), AeN, fel\j {e}, 0e(7V7* U T)*9 the set of productions; (Af 0) is denoted by Af-> 0; (3) S e TV, the start variable. Let ® = u1B1$1u2B2$2. .£„p„wM +1 with WJÊ?* for ie[l:«+l], and PJ.GT* foryefl :n] with n^O, be an element of (NP U T)*9 and let y G 7*, then we set For 0', 0"e(ffur)*, we set 0'=>0" iff ®' = ® X (0:y)02 with®!, ®2e(NI*\JT)* and Af ^QeP,feI{J {e}. n + # => is the ft-fold product, => is the transitive and => is the reflexive, transitive closure of =>. An indexed grammar G = (N, T, /, P, S) is called a linear indexed grammar, iff each production in P is of one of the forms Af-+ uByv or Af^y u with A, BeN,feIU{e}9u, veT* and y e/*. An indexed grammar G = (TV, 71, ƒ, P, 5) is called a rightlinear indexed gram- mar, iff each production in P is of one of the forms Af^uBy or Af^u witlij, £eiV,/e/U {e}, weT* andye/*. The language L(G) generated by an (linear, rightlinear) indexed grammar G = (N,T,I9P9S) is the set L(G) = { w\ we T*9 sXw}. A language L is called an (linear, rightlinear) index language iff L~L(G) for an (linear, rightlinear) indexed grammar G. The index words in a dérivation of such a rightlinear grammar can be interpreted as the pushdown list; the nonterminals can be interpreted as states of a suitable pushdown automaton. Vice versa for a given pushdown automaton a rightlinear indexed grammar can be constructed which générâtes the language that is accepted by that automaton. It follows that the rightlinear indexed languages are exactly the languages accepted by pushdown automata, Le. the context-free languages, as has been shown by Aho [1]. A pushdown automaton with only one pushdown symbol is a counter. Such a device must stop if the pushdown store is empty, Le. it has counted to zero. An iterated counter may count down to zero several times. For this purpose there is a bottom marker # in the pushdown store of an iterated counter. vol. 26, n° 1, 1992 96 J. DUSKE, M. MIDDENDORF, R. PARCHMANN The formai définition of such an automaton is as follows [4]: DÉFINITION 2.2: An iterated counter is a pushdown automaton K= (Z, T, r, Ô, z0, #, F) with r = {ƒ # } and where zeZ and aeTKJ [e] {e dénotes the empty word). The classes of languages accepted by these automata with final state, empty store or both coincide [4]. It is easy to construct a rightlinear indexed grammar for the iterated counter K= (Z, T,T,8,z0, #,F) of Définition 2.2 which générâtes the set of all words accepted by K with final states. Set G = (N9T,I9P9S) with TV- Z U { S }, ƒ = r = {ƒ, # } and the following set of productions: (a) S^zo# (b) if (z', f) e 8 (z, fl, ƒ) then zf -> az' ƒ ' e ƒ> (c) if (z', / # ) G ô (z, a, # ) then z # -> az' ƒ #e? (J) for ail zeF the production z -> e is in P and if (z',e)eS(z,a, #) with z'ef, then z# -+aeP. The productions of the form z# -^az'f(# represent the capability of K to start counting again, i. e, the itération capability. Counting with the help of the pushdown store of K corresponds to counting on dérivations of a rightlinear grammar. It is now interesting to investigate the problem of counting on dérivations of (linear) context-free grammars. This leads to the définition of an (rightlinear, linear) indexed counter grammar. DÉFINITION 2.3: An indexed grammar G = (N,T,I,P,S) is called indexed counter grammar {ic-grammar) iff ƒ== {ƒ, # } and the productions in P are of one of the forms: (a) S where S does not appear in any other production in P (b) Ag^G, ge{f,e}, ®e(Nf*\JT)* (c) A # -> 0, 0 G {NP # U T)*. G is called linear indexed counter grammar {linear ic-grammar) iff in the above définition 0 e 7* Nf* T* U T* in {b) and 0 e T* Nf* # r* U T* in (c). G is called rightlinear indexed counter grammar {rightlinear ic-grammar) iff in the above définition @eT* Nf* \J V in (b) and 0 e r* TV/* # U T* in (c).
Recommended publications
  • The Structure of Index Sets and Reduced Indexed Grammars Informatique Théorique Et Applications, Tome 24, No 1 (1990), P
    INFORMATIQUE THÉORIQUE ET APPLICATIONS R. PARCHMANN J. DUSKE The structure of index sets and reduced indexed grammars Informatique théorique et applications, tome 24, no 1 (1990), p. 89-104 <http://www.numdam.org/item?id=ITA_1990__24_1_89_0> © AFCET, 1990, tous droits réservés. L’accès aux archives de la revue « Informatique théorique et applications » im- plique l’accord avec les conditions générales d’utilisation (http://www.numdam. org/conditions). Toute utilisation commerciale ou impression systématique est constitutive d’une infraction pénale. Toute copie ou impression de ce fichier doit contenir la présente mention de copyright. Article numérisé dans le cadre du programme Numérisation de documents anciens mathématiques http://www.numdam.org/ Informatique théorique et Applications/Theoretical Informaties and Applications (vol. 24, n° 1, 1990, p. 89 à 104) THE STRUCTURE OF INDEX SETS AND REDUCED INDEXED GRAMMARS (*) by R. PARCHMANN (*) and J. DUSKE (*) Communicated by J. BERSTEL Abstract. - The set of index words attached to a variable in dérivations of indexed grammars is investigated. Using the regularity of these sets it is possible to transform an mdexed grammar in a reducedfrom and to describe the structure ofleft sentential forms of an indexed grammar. Résumé. - On étudie Vensemble des mots d'index d'une variable dans les dérivations d'une grammaire d'index. La rationalité de ces ensembles peut être utilisée pour transformer une gram- maire d'index en forme réduite, et pour décrire la structure des mots apparaissant dans les dérivations gauches d'une grammaire d'index. 1. INTRODUCTION In this paper we will further investigate indexed grammars and languages introduced by Aho [1] as an extension of context-free grammars and lan- guages.
    [Show full text]
  • From Indexed Grammars to Generating Functions∗
    RAIRO-Theor. Inf. Appl. 47 (2013) 325–350 Available online at: DOI: 10.1051/ita/2013041 www.rairo-ita.org FROM INDEXED GRAMMARS TO GENERATING FUNCTIONS ∗ Jared Adams1, Eric Freden1 and Marni Mishna2 Abstract. We extend the DSV method of computing the growth series of an unambiguous context-free language to the larger class of indexed languages. We illustrate the technique with numerous examples. Mathematics Subject Classification. 68Q70, 68R15. 1. Introduction 1.1. Indexed grammars Indexed grammars were introduced in the thesis of Aho in the late 1960s to model a natural subclass of context-sensitive languages, more expressive than context-free grammars with interesting closure properties [1,16]. The original ref- erence for basic results on indexed grammars is [1]. The complete definition of these grammars is equivalent to the following reduced form. Definition 1.1. A reduced indexed grammar is a 5-tuple (N , T , I, P, S), such that 1. N , T and I are three mutually disjoint finite sets of symbols: the set N of non-terminals (also called variables), T is the set of terminals and I is the set of indices (also called flags); 2. S ∈N is the start symbol; 3. P is a finite set of productions, each having the form of one of the following: (a) A → α Keywords and phrases. Indexed grammars, generating functions, functional equations, DSV method. ∗ The third author gratefully acknowledges the support of NSERC Discovery Grant funding (Canada), and LaBRI (Bordeaux) for hosting during the completion of the work. 1 Department of Mathematics, Southern Utah University, Cedar City, 84720, UT, USA.
    [Show full text]
  • Infinite Words As Determined by Languages of Their Prefixes
    INFINITEWORDSASDETERMINEDBY LANGUAGESOFTHEIRPREFIXES tim smith A dissertation submitted in partial fulfillment of the requirements for the degree of Ph.D. in computer science College of Computer and Information Science Northeastern University Boston, MA, USA April 2015 ABSTRACT We explore a notion of complexity for infinite words relating them to languages of their prefixes. An infinite language L determines an infinite word α if every string in L is a prefix of α. If L is regular, it is known that α must be ultimately periodic; conversely, every ul- timately periodic word is determined by some regular language. In this dissertation, we investigate other classes of languages and infi- nite words to see what connections can be made among them within this framework. We make particular use of pumping lemmas as a tool for studying these classes and their relationship to infinite words. • First, we investigate infinite words determined by various types of automata. We consider finite automata, pushdown automata, a generalization of pushdown automata called stack automata, and multihead finite automata, and relate these classes to ultimately periodic words and to a class of infinite words which we call mul- tilinear. • Second, we investigate infinite words determined by the parallel rewriting systems known as L systems. We show that certain infi- nite L systems necessarily have infinite subsets in other L systems, and use these relationships to categorize the infinite words deter- mined by a hierarchy of these systems, showing that it collapses to just three distinct classes of infinite words. • Third, we investigate infinite words determined by indexed gram- mars, a generalization of context-free grammars in which nonter- minals are augmented with stacks which can be pushed, popped, and copied to other nonterminals at the derivation proceeds.
    [Show full text]
  • A Formal Model for Context-Free Languages Augmented with Reduplication
    A FORMAL MODEL FOR CONTEXT-FREE LANGUAGES AUGMENTED WITH REDUPLICATION Walter J. Savitch Department of Computer Science and Engineering University of California, San Diego La Jolla, CA 92093 A model is presented to characterize the class of languages obtained by adding reduplication to context-free languages. The model is a pushdown automaton augmented with the ability to check reduplication by using the stack in a new way. The class of languages generated is shown to lie strictly between the context-free languages and the indexed languages. The model appears capable of accommodating the sort of reduplications that have been observed to occur in natural languages, but it excludes many of the unnatural constructions that other formal models have permitted. 1 INTRODUCTION formal language. Indeed, most of the known, convinc- ing arguments that some natural language cannot (or Context-free grammars are a recurrent theme in many, almost cannot) be weakly generated by a context-free perhaps most, models of natural language syntax. It is grammar depend on a reduplication similar to the one close to impossible to find a textbook or journal that exhibited by this formal language. Examples include the deals with natural language syntax but that does not respectively construct in English (Bar-Hillel and Shamir include parse trees someplace in its pages. The models 1964), noun-stem reduplication and incorporation in used typically augment the context-free grammar with Mohawk (Postal 1964), noun reduplication in Bambara some additional computational power so that the class (Culy 1985), cross-serial dependency of verbs and ob- of languages described is invariably larger, and often jects :in certain subordinate clause constructions in much larger, than the class of context-free languages.
    [Show full text]
  • Indexed Languages and Unification Grammars*
    21 Indexed Languages and Unification Grammars* Tore Burheim^ A bstract Indexed languages are interesting in computational linguistics because they are the least class of languages in the Chomsky hierarchy that has not been shown not to be adequate to describe the string set of natural language sent­ ences. We here define a class of unification grammars that exactly describe the class of indexed languages. 1 Introduction The occurrence of purely syntactical cross-serial dependencies in Swiss-German shows that context-free grammars can not describe the string sets of natural lan­ guage [Shi85]. The least class in the Chomsky hierarchy that can describe unlimited cross-serial dependencies is indexed grammars [Aho 68]. Gazdar discuss in [Gaz88] the applicability of indexed grammars to natural languages, and show how they can be used to describe different syntactic structures. We are here going to study how we can describe the class of indexed languages with a unification grammar formalism. After defining indexed grammars and a simple unification grammar framework we show how we can define an equivalent unification grammar for any given indexed grammar. Two grammars are equivalent if they generate the same language. With this background we define a class of unification grammars and show that this class describes the clciss of indexed languages. 2 Indexed grammars Indexed grammars is a grammar formalism with generative capacity between con­ text-free grammars and context-sensitive grammars. Context-free grammars can not describe cross-serial dependencies due to the pumping lemma, while indexed grammars can. However, the class of languages generated by indexed grammars, -the indexed languages, is a proper subset of context-sensitive languages [Aho 68].
    [Show full text]
  • Hairdressing in Groups: a Survey of Combings and Formal Languages 1
    ISSN 1464-8997 493 Geometry & Topology Monographs Volume 1: The Epstein Birthday Schrift Pages 493{509 Hairdressing in groups: a survey of combings and formal languages Sarah Rees Abstract A group is combable if it can be represented by a language of words satisfying a fellow traveller property; an automatic group has a synchronous combing which is a regular language. This article surveys results for combable groups, in particular in the case where the combing is a formal language. AMS Classication 20F10, 20-04, 68Q40; 03D40 Keywords Combings, formal languages, fellow travellers, automatic groups Dedicated to David Epstein on the occasion of his 60th birthday 1 Introduction The aim of this article is to survey work generalising the notion of an automatic group, in particular to classes of groups associated with various classes of formal languages in the same way that automatic groups are associated with regular languages. The family of automatic groups, originally dened by Thurston in an attempt to abstract certain niteness properties of the fundamental groups of hyperbolic manifolds recognised by Cannon in [12], has been of interest for some time. The dening properties of the family give a geometrical viewpoint on the groups and facilitate computation with them; to such a group is associated a set of paths in the Cayley graph of the group (a ‘language’ for the group) which both satises a geometrical ‘fellow traveller condition’ and, when viewed as a set of words, lies in the formal language class of regular languages. (A formal denition is given in section 2.) Epstein et al.’s book [15] gives a full account; the papers [3] and [16] are also useful references (in particular, [16] is very readable and non-technical).
    [Show full text]
  • Abstract Interpretation of Indexed Grammars
    Abstract Interpretation of Indexed Grammars Marco Campion, Mila Dalla Preda, and Roberto Giacobazzi Dipartimento di Informatica, University of Verona fmarco.campion, mila.dallapreda, roberto.giacobazzig @ univr.it Abstract. Indexed grammars are a generalization of context-free gram- mars and recognize a proper subset of context-sensitive languages. The class of languages recognized by indexed grammars are called indexed languages and they correspond to the languages recognized by nested stack automata. For example indexed grammars can recognize the lan- n n n guage fa b c j n > 1g which is not context-free, but they cannot rec- n n ognize f(ab ) j n > 1g which is context-sensitive. Indexed grammars identify a set of languages that are more expressive than context-free languages, while having decidability results that lie in between the ones of context-free and context-sensitive languages. In this work we study indexed grammars in order to formalize the relation between indexed languages and the other classes of languages in the Chomsky hierarchy. To this end, we provide a fixpoint characterization of the languages rec- ognized by an indexed grammar and we study possible ways to abstract, in the abstract interpretation sense, these languages and their grammars into context-free and regular languages. 1 Introduction Chomsky's hierarchy [6] drove most of the research in theoretical computer sci- ence for decades. Its structure, and its inner separation results between formal languages, represent the corner stone to understand the expressive power of sym- bolic structures. In this paper we show how abstract interpretation can be used for studying formal languages, in particular we consider indexed languages as our concrete semantics.
    [Show full text]
  • An Additional Observation on Strict Derivational Minimalism Jens Michaelis
    10 An Additional Observation on Strict Derivational Minimalism Jens Michaelis Abstract We answer a question which, so far, was left an open problem: does— in terms of derivable string languages—the type of a minimalist grammar (MG) as originally introduced in Stabler 1997 defines a proper superclass of the revised type of an MG and, therefore, the type of a strict MG both introduced in Stabler 1999, and known to be weakly equivalent? For both the revised as well as the strict MG-type, the essential difference to the original MG-definition consists in imposing—in addition to the corresponding implementation of the shortest move condition—a second condition on the move-operator providing a formulation of the specifier island condition, and as such, restricting (further) the domain to which the operator can apply. It has been known already that this additional condition, in fact, ensures that—in terms of derivable string languages—the revised and, therefore, the strict MG-type both constitute a subclass of the original MG-type. We here present a string language proving that the inclusion is proper. Keywords (strict) minimalist grammars, specifier island con- dition, multiple context-free grammars/linear context-free rewriting systems, (linear) context-free tree grammars 10.1 Introduction The minimalist grammar (MG) formalism introduced in Stabler 1997 provides an attempt at a rigorous algebraic formalization of the per- spectives currently adopted within the linguistic framework of trans- formational grammar. As has been shown (Michaelis 2001a, 2001b, Harkema 2001), this MG-type determines the same class of derivable string languages as linear context-free rewriting systems (LCFRSs) (Vijay-Shanker et al.
    [Show full text]
  • On Deterministic Indexed Languages
    CORE Metadata, citation and similar papers at core.ac.uk Provided by Elsevier - Publisher Connector INFORMATION AND CONTROL 45, 48--67 (1980) On Deterministic Indexed Languages R. PARCHMANN, J. DUSKE, AND J. SPECHT Institut fiir Informatlk, Universitiit Hannover, D3000 Hannover 1, West Germany A new type of acceptor is introduced for the class of indexed languages. The class of languages recognized by the deterministic version of this acceptor, called deterministic indexed languages, is closed under complemention. The class of deterministic context-free languages is properly contained in the class of deterministic indexed languages, which itself is properly contained in the class of indexed languages. 1. INTRODUCTION Aho (1968) extended the class of context-free languages to the class of indexed languages. The class of indexed languages has properties which are analogous to those of the class of context-free languages. In the area of context-free languages one is particularly interested in deterministic context-free languages, that is, languages which are accepted by deterministic pushdown automata, because this subset of the context-free languages is of interest with regard to programming languages. A new type of recognizer will be introduced for indexed languages, which is a natural model for syntactic analyzers of these languages. A deterministic version of these recognizers singles out a subset of the indexed languages, the determinis- tic indexed languages (DIL's). As in the case of context-free languages, the DIL's are a proper subset of the indexed languages because, as will be shown, the complement of a DIL is likewise a DIL. In addition it will be shown that DIL's properly contain the deterministic context-free languages and that there are DIL's which are not context-free.
    [Show full text]
  • Permutations of Context-Free, ET0L and Indexed Languages Tara Brough, Laura Ciobanu, Murray Elder, Georg Zetzsche
    Permutations of context-free, ET0L and indexed languages Tara Brough, Laura Ciobanu, Murray Elder, Georg Zetzsche To cite this version: Tara Brough, Laura Ciobanu, Murray Elder, Georg Zetzsche. Permutations of context-free, ET0L and indexed languages. Discrete Mathematics and Theoretical Computer Science, DMTCS, 2016, Vol. 17 no. 3 (3), pp.167-178. hal-01352858 HAL Id: hal-01352858 https://hal.inria.fr/hal-01352858 Submitted on 16 Aug 2016 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Discrete Mathematics and Theoretical Computer Science DMTCS vol. 17:3, 2016, 167–178 Permutations of context-free, ET0L and indexed languages Tara Brough1∗ Laura Ciobanu2y Murray Elder3z Georg Zetzsche4x 1 Universidade de Lisboa, Portugal 2 University of Neuchâtel, Switzerland 3 The University of Newcastle, Australia 4 LSV, CNRS & ENS Cachan, Université Paris-Saclay, France received 5th Jan. 2015, revised 19th Apr. 2016, accepted 12th May 2016. For a language L, we consider its cyclic closure, and more generally the language Ck(L), which consists of all words obtained by partitioning words from L into k factors and permuting them. We prove that the classes of ET0L and EDT0L languages are closed under the operators Ck.
    [Show full text]
  • Indexed Languages (And Why You Care)
    Indexed Languages and why you care Presented by Pieter Hooimeijer 2008-02-07 1 Think Way Back... 2 www.xkcd.com ...Far Enough: ... CS NCF DCF REG REG 3 Formal Language Classes ... CS NCF DCF REG REG PDA 4 Formal Language Classes ... CS NCF DCF REG REG PDA DFA 5 Formal Language Classes ... CS NCF DCF REG REG Machines PDA DFA Formalism S → aSb | z a(ab)*b 6 Formal Language Classes ... CS NCF DCF REG REG Pump Pump 7 The Context-Free Pumping Lemma Suppose L = { anbncn | n = 1...} is context- free. By the pumping lemma, any string s with |s| ≥ p can be 'pumped.' p 8 The Context-Free Pumping Lemma What does 'can be pumped' mean? s = uvxyz 1)|vy| > 0 2)|vxy| ≤ p i i 3) uv xy z is in L for all i ≥ 0 9 The Context-Free Pumping Lemma Suppose L = { anbncn | n = 1...} is context-free. Consider s = apbpcp; for any split s = uvxyz, we have: - if v contains a's, then y cannot contain c's - if y contains c's, then v cannot contain a's 0 0 - a problem: uv xy z = uxz will never be in L 10 Moving Right Along 11 Motivation – Some Examples • Can solve problems by phrasing them as 'language' problems: • Finding valid control flow graph paths • Solving set constraint problems • Static string analysis • Lexing, parsing • For fun... 12 Example – String Variables www.xkcd.com 13 The Nugget Some Code: x = 'z'; • We want a context free grammar to model x while(n < 5) { x = '(' .
    [Show full text]
  • On Finite-Index Indexed Grammars and Their Restrictions $
    On Finite-Index Indexed Grammars and Their Restrictions I Flavio D’Alessandroa,1,∗, Oscar H. Ibarrab,2, Ian McQuillanc,3 aDepartment of Mathematics Sapienza University of Rome, 00185 Rome, Italy and Department of Mathematics, Boğaziçi University 34342 Bebek, Istanbul, Turkey bDepartment of Computer Science University of California, Santa Barbara, CA 93106, USA cDepartment of Computer Science, University of Saskatchewan Saskatoon, SK S7N 5A9, Canada Abstract The family, L(INDLIN), of languages generated by linear indexed grammars has been studied in the literature. It is known that the Parikh image of every language in L(INDLIN) is semi-linear. However, there are bounded semi-linear languages that are not in L(INDLIN). Here, we look at larger families of (restricted) indexed languages and study their combinatorial and decidability properties, and their relationships. Keywords: Indexed Languages, Finite-Index, Full Trios, Semi-linearity, Bounded Languages, ET0L Languages 1. Introduction Indexed grammars [1, 2] are a natural generalization of context-free grammars, where variables keep stacks of indices. Although they are included in the context-sensitive languages, the languages generated by indexed grammars are quite broad as they contain some non semi-linear languages. Several restrictions have been studied that have desirable computational properties. Linear indexed grammars were first created, restricting the number of variables on the right hand side to be at most one [6]. Other restrictions include another system named exactly linear indexed grammars [8] (see also [20]), which are different than the first formalism, although both are sufficiently restricted to only generate semi-linear languages. In this paper, we only examine the first formalism of linear indexed grammars.
    [Show full text]