Grammars Context-Free Languages

Total Page:16

File Type:pdf, Size:1020Kb

Grammars Context-Free Languages Unit 7 Context-free Grammars Context-free Languages Reading: Sipser, chapt. 2.1 Hopcroft et. al. chapt. 5 1 דקד ו ק / דקד ו ק םי Grammar • DFA/NFA describes a regular language in a computational way: Given a word – we run it on the FA and check whether it stopped on an accepting state. • Regular Expression is another method of describing languages in a syntactic way. • A grammar is a set of rules describing languages in a syntactic way: We start with an empty string and form the word according to the grammar rules until we have the desired output (parsing). 2 The Origin of Grammar • The origin of the name grammar for this computational model is in natural languages, where grammar is a collection of rules. • This collection defines what is legal in the language and what is not. 3 Example of a grammar • Symbols: S={a,b}, Variables: V={S,B} • The following grammar generates a*b*. S®aS (S is the starting variable) S®B B®Bb B®e How can we generate ab, aab, e ? 4 The Grammars Formalism A grammar is composed of: 1. Terminals S = symbols of the alphabet of the language being defined 2. Variables V = a finite set of other symbols, each of which represents a language. 3. Start Symbol SÎV = the variable whose language is the one being defined. 4. A collection of production rules. 5 Common Notations • Terminals: Lower case, lower alphabet (a, b, c). • Variables: Upper case, lower alphabet (A, B, C). • String of terminals: Lower case, higher alphabet (x, y, u, v, w). • Mixed strings: (terminals + variables): Lower case, Greek letters (a, b, g) • Starting Variable: S 6 Production Rules • A production rule has the form: a®b • It means: – a can be replaced by b – a constructs b – a produces b 7 Example • Symbols: S={0,1}, Variables: V={S} • The language: L = 0$1$ & > 0}. S®0S1 (S is the starting variable) S®01 8 Another Example • S={a,b,#} • The following grammar generates {"#$%#$%"# | (, * ≥ 0}. S®aSa S®B B®bBb B®# 9 Derivation of a word 1. Write down the start variable. 2. Find a variable A that is written down and a rule A®a. 3. Replace the variable A with the string a. 4. Repeat steps 2+3 until no variables remain. 10 Þ notation • We use the notation “Þ” to represent an actual derivation: a Þ b • It means: the string b was derived from a using a production rule. • We can derive a!b ⇒ agb , if ! → $ is a production rule. • Example: % → 01; % → 0%1. % ⇒ 0%1 ⇒ 00%11 ⇒ 000111. 11 Production w=aacb can be written 1. S®aS S®aS | bS | cS | e 2. S®bS 3. S®cS When a variable has various 4. S®e production rules, they can all be written in one line. • How can the word w=aacb be produced? (1) (1) (3) (2) (4) S ÞaS ÞaaS ÞaacS ÞaacbS Þaacb 12 Parsing / Parsing Tree • Producing a word according to a given grammar is called parsing. • We can represent the same production sequence by a parsing tree. • Each node in the tree is either a variable or a terminal. • A terminal node is a leaf. • The resulting word is a concatenation of the labels of the leaves in left-to-right order (preorder traversal) • This is called the yield of the parsing tree. 13 Parsing Tree of w=aacb S a S a S c S b S e 14 Parsing Tree of w=aacb Or a step by step derivation: S S S a S a S a S 15 Parsing w=aacb (cont.) S S S a S a S a S a S a S a S bc S c S c S b S b S e 16 דקד ו ק רסח רשקה Context-Free Grammar (CFG) A context-free grammar (CFG) G is a 4-tuple G = (V, S, S, R), where 1. V is a finite set called the variables. 2. S is a finite set, disjoint from V, called the terminals. 3. ( ∈ * is a start symbol. 4. R is a finite set of production rules of the form: A®a where AÎV and aÎ(VÈS)* 17 Derivation in CFG • Let a, b and g be strings of variables and terminals • If A®g is a rule in the grammar, we say that aAb derives agb, written aAb Þ agb. • We write x Þ* y if there exists a sequence x1, x2, ..xk, k³0 and x Þ x1 Þ x2 Þ...Þ y . Þ means derives in one step Þ+ means derives in one or more steps Þ* means derives in zero or more steps 18 פש ו ת רסח ו ת רקהש Context Free Languages • The language of the grammar is L(G) = {wÎS* | S Þ* w} • The language generated by a Context Free Grammar (CFG) is Called a context-free language (CFL). 19 Examples over S={0,1} • Construct a grammar for the following language: L = {0,00,1} • G = (V={S},S={0,1},S, R) • R: S ® 0 Alternatively S ® 00 S ® 0 | 00 | 1 S ® 1 20 Examples over S={0,1} • Construct a grammar for the following language L = {0n1n |n³0} • G = (V={S},S={0,1},S, R) where R: S®0S1 | e • Example: let’s parse the word 0011 ! ⟹ 0!1 ⟹ 00!11 ⟹ 0011 21 Examples over S={0,1} • Construct a grammar for the following language L = {0n1n |n³1} • G = (V={S},S={0,1},S, R) where R: S ® 0S1 | 01 • Let’s parse the word w=00001111 22 Examples over S={0,1} • Construct a grammar for the following language L = {0n1m |m ³n>0} • G = (V={S},S={0,1},S, R) where R: S ® 0S1 | 0B1 B ® B1 | e 23 Examples over S={0,1} • Construct a grammar for the following language L = {0*1+} • G = (V={S,B},S={0,1},S, R) where R: S ®0S | 1B What about 0*1* ? B ®1B | e 24 Examples over S={0,1} • Construct a grammar for the following language L = {02i+1 | i³0} • G = (V={S},S={0,1},S, R) where R: S ®00S | 0 Alternatively: S ®0S0 | 0 25 Examples over S={0,1} • Construct a grammar for the following language L = {0i+11i | i³0} • G = (V={S},S={0,1},S, R) where R: S ®0S1 | 0 26 Examples over S={0,1} • Construct a grammar for the following language L = {w Î{0,1}* | |w| mod 2 = 1} • G = (V={S},S={0,1},S, R) where R: S ®0 | 1| 1S1| 0S0 |1S0 | 0S1 Let’s parse: 011100101 • Alternatively: S ®DSD | D ; D ® 0 | 1 • Alternatively: S ®DDS | D ; D ® 0 | 1 27 Examples over S={0,1} • Construct a grammar for the following language L = {0n1n |n>0}È {1n0n | n³0} • G = (V={S,A,B},S={0,1},S, R) where R: S ® A | B A ® 0A1 | 01 B ® 1B0 | e 28 Exercise Construct grammars for the following languages over S={0,1} 1. L1= {w | #1(w) is even} 2. L2= {w | #1(w) is odd} 3. L3= {w| #1(w) = #0(w)} n m n+m 4. L4= {0 10 10 | n,m ³ 0} Solution: In class 29 Define the Language for a CFG • Give a description of L(G) for the following grammar G: S ® 0S0 | 1 • L(G) = {0n10n | n³0} 30 Define the Language for a CFG • Give a description of L(G) for the following grammar G: S ® 0S0 | 1S1 | e – " # = % ∈ 0,1 ∗ % = %+, % ,- ./.0 } S ® 0S0 | 1S1 | 1 | 0 | e – " # = % ∈ 0,1 ∗ % = %+} 31 Define the Language for a CFG • Give a description of L(G) for the following grammar G: S ® 0A | 0B A®1S B®1 • L(G) = {(01)n |n³1 } • Simpler version S ® 01S | 01 32 Define the Language for a CFG • Give a description of L(G) for the following grammar G: S ® 0S11 | 0 • L(G) = {0n+112n |n³0 } 33 Define the Language for a CFG • Give a description of L(G) for the following grammar G: S ® E | NE N ® D | DN D ® 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 E ® 0 | 2 | 4 | 6 • L(G) = {w | w represents an even octal number} 34 Define the Language for a CFG • Give a description of L(G) for the following grammar G: S ® N.N | -N.N N ® D | DN D ® 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 • L(G) = {w | w represents a decimal rational number (that has a finite representation) } 35 Exercise Give a description for L(G) for each of the following grammars over S={a,b,$} : G1: S ® aSb | A A ® Aa | e G2: S ® aSb | SS | e G3: S ® aSa | bSb | aS | bS | $ Solution: In class 36 Exercise Give a description for L(G) for the following grammars over S={a} : E®E+E | ExE | D D®0|1|2|..|9 • Let’s parse the string 3+4x5 – E Þ E+E Þ D+E Þ 3+E Þ 3+ExE Þ… 3+4x5 – E Þ ExE Þ ExD Þ Ex5 Þ E+Ex5 Þ… 3+4x5 37 Exercise (cont.) • The string 3+4*5 can be E®E+E | ExE | D produced in several ways: D®0|1|2|..|9 E E E E + E x E D x E + E E E D D D D D 3 5 3 4 4 5 38 Ambiguous Production • So if we use this grammar to produce a programming language then we will have several computations for 3+4*5.
Recommended publications
  • The Mathematics of Syntactic Structure: Trees and Their Logics
    Computational Linguistics Volume 26, Number 2 The Mathematics of Syntactic Structure: Trees and their Logics Hans-Peter Kolb and Uwe MÈonnich (editors) (Eberhard-Karls-UniversitÈat Tubingen) È Berlin: Mouton de Gruyter (Studies in Generative Grammar, edited by Jan Koster and Henk van Riemsdijk, volume 44), 1999, 347 pp; hardbound, ISBN 3-11-016273-3, $127.75, DM 198.00 Reviewed by Gerald Penn Bell Laboratories, Lucent Technologies Regular languages correspond exactly to those languages that can be recognized by a ®nite-state automaton. Add a stack to that automaton, and one obtains the context- free languages, and so on. Probably all of us learned at some point in our univer- sity studies about the Chomsky hierarchy of formal languages and the duality be- tween the form of their rewriting systems and the automata or computational re- sources necessary to recognize them. What is perhaps less well known is that yet another way of characterizing formal languages is provided by mathematical logic, namely in terms of the kind and number of variables, quanti®ers, and operators that a logical language requires in order to de®ne another formal language. This mode of characterization, which is subsumed by an area of research called descrip- tive complexity theory, is at once more declarative than an automaton or rewriting system, more ¯exible in terms of the primitive relations or concepts that it can pro- vide resort to, and less wedded to the tacit, not at all unproblematic, assumption that the right way to view any language, including natural language, is as a set of strings.
    [Show full text]
  • Probabilistic Grammars and Their Applications This Discretion to Pursue Political and Economic Ends
    Probabilistic Grammars and their Applications this discretion to pursue political and economic ends. and the Law; Monetary Policy; Multinational Cor- Most experiences, however, suggest the limited power porations; Regulation, Economic Theory of; Regu- of privatization in changing the modes of governance lation: Working Conditions; Smith, Adam (1723–90); which are prevalent in each country’s large private Socialism; Venture Capital companies. Further, those countries which have chosen the mass (voucher) privatization route have done so largely out of necessity and face ongoing efficiency problems as a result. In the UK, a country Bibliography whose privatization policies are often referred to as a Armijo L 1998 Balance sheet or ballot box? Incentives to benchmark, ‘control [of privatized companies] is not privatize in emerging democracies. In: Oxhorn P, Starr P exerted in the forms of threats of take-over or (eds.) The Problematic Relationship between Economic and bankruptcy; nor has it for the most part come from Political Liberalization. Lynne Rienner, Boulder, CO Bishop M, Kay J, Mayer C 1994 Introduction: privatization in direct investor intervention’ (Bishop et al. 1994, p. 11). After the steep rise experienced in the immediate performance. In: Bishop M, Kay J, Mayer C (eds.) Pri ati- zation and Economic Performance. Oxford University Press, aftermath of privatizations, the slow but constant Oxford, UK decline in the number of small shareholders highlights Boubakri N, Cosset J-C 1998 The financial and operating the difficulties in sustaining people’s capitalism in the performance of newly privatized firms: evidence from develop- longer run. In Italy, for example, privatization was ing countries.
    [Show full text]
  • Grammars and Normal Forms
    Grammars and Normal Forms Read K & S 3.7. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no, AND if yes, describe the structure a + b * c Now it's time to worry about extracting structure (and doing so efficiently). Optimizing Context-Free Languages For regular languages: Computation = operation of FSMs. So, Optimization = Operations on FSMs: Conversion to deterministic FSMs Minimization of FSMs For context-free languages: Computation = operation of parsers. So, Optimization = Operations on languages Operations on grammars Parser design Before We Start: Operations on Grammars There are lots of ways to transform grammars so that they are more useful for a particular purpose. the basic idea: 1. Apply transformation 1 to G to get of undesirable property 1. Show that the language generated by G is unchanged. 2. Apply transformation 2 to G to get rid of undesirable property 2. Show that the language generated by G is unchanged AND that undesirable property 1 has not been reintroduced. 3. Continue until the grammar is in the desired form. Examples: • Getting rid of ε rules (nullable rules) • Getting rid of sets of rules with a common initial terminal, e.g., • A → aB, A → aC become A → aD, D → B | C • Conversion to normal forms Lecture Notes 16 Grammars and Normal Forms 1 Normal Forms If you want to design algorithms, it is often useful to have a limited number of input forms that you have to deal with. Normal forms are designed to do just that.
    [Show full text]
  • CS351 Pumping Lemma, Chomsky Normal Form Chomsky Normal
    CS351 Pumping Lemma, Chomsky Normal Form Chomsky Normal Form When working with a context-free grammar a simple and useful form is called the Chomsky Normal Form (CNF). A CFG in CNF is one where every rule is of the form: A ! BC A ! a Where a is any terminal and A,B, and C are any variables, except that B and C may not be the start variable. Note that we have two and only two variables on the right hand side of the rule, with the exception that the rule S!ε is permitted where S is the start variable. Theorem: Any context free language may be generated by a context-free grammar in Chomsky normal form. To show how to make this conversion, we will need to do three things: 1. Eliminate all ε rules of the form A!ε 2. Eliminate all unit rules of the form A!B 3. Convert remaining rules into rules of the form A!BC Proof: 1. First add a new start symbol S0 and the rule S0 ! S, where S was the original start symbol. This guarantees that the start symbol doesn’t occur on the right hand side of a rule. 2. Remove all ε rules. Remove a rule A!ε where A is not the start symbol For each occurrence of A on the right-hand side of a rule, add a new rule with that occurrence of A deleted. Ex: R!uAv becomes R!uv This must be done for each occurrence of A, so the rule: R!uAvAw becomes R! uvAw and R! uAvw and R!uvw This step must be repeated until all ε rules are removed, not including the start.
    [Show full text]
  • Hierarchy and Interpretability in Neural Models of Language Processing ILLC Dissertation Series DS-2020-06
    Hierarchy and interpretability in neural models of language processing ILLC Dissertation Series DS-2020-06 For further information about ILLC-publications, please contact Institute for Logic, Language and Computation Universiteit van Amsterdam Science Park 107 1098 XG Amsterdam phone: +31-20-525 6051 e-mail: [email protected] homepage: http://www.illc.uva.nl/ The investigations were supported by the Netherlands Organization for Scientific Research (NWO), through a Gravitation Grant 024.001.006 to the Language in Interaction Consortium. Copyright © 2019 by Dieuwke Hupkes Publisher: Boekengilde Printed and bound by printenbind.nl ISBN: 90{6402{222-1 Hierarchy and interpretability in neural models of language processing Academisch Proefschrift ter verkrijging van de graad van doctor aan de Universiteit van Amsterdam op gezag van de Rector Magnificus prof. dr. ir. K.I.J. Maex ten overstaan van een door het College voor Promoties ingestelde commissie, in het openbaar te verdedigen op woensdag 17 juni 2020, te 13 uur door Dieuwke Hupkes geboren te Wageningen Promotiecommisie Promotores: Dr. W.H. Zuidema Universiteit van Amsterdam Prof. Dr. L.W.M. Bod Universiteit van Amsterdam Overige leden: Dr. A. Bisazza Rijksuniversiteit Groningen Dr. R. Fern´andezRovira Universiteit van Amsterdam Prof. Dr. M. van Lambalgen Universiteit van Amsterdam Prof. Dr. P. Monaghan Lancaster University Prof. Dr. K. Sima'an Universiteit van Amsterdam Faculteit der Natuurwetenschappen, Wiskunde en Informatica to my parents Aukje and Michiel v Contents Acknowledgments xiii 1 Introduction 1 1.1 My original plan . .1 1.2 Neural networks as explanatory models . .2 1.2.1 Architectural similarity . .3 1.2.2 Behavioural similarity .
    [Show full text]
  • The Complexity of Narrow Syntax : Minimalism, Representational
    Erschienen in: Measuring Grammatical Complexity / Frederick J. Newmeyer ... (Hrsg.). - Oxford : Oxford University Press, 2014. - S. 128-147. - ISBN 978-0-19-968530-1 The complexity of narrow syntax: Minimalism, representational economy, and simplest Merge ANDREAS TROTZKE AND JAN-WOUTER ZWART 7.1 Introduction The issue of linguistic complexity has recently received much attention by linguists working within typological-functional frameworks (e.g. Miestamo, Sinnemäki, and Karlsson 2008; Sampson, Gil, and Trudgill 2009). In formal linguistics, the most prominent measure of linguistic complexity is the Chomsky hierarchy of formal languages (Chomsky 1956), including the distinction between a finite-state grammar (FSG) and more complicated types of phrase-structure grammar (PSG). This dis- tinction has played a crucial role in the recent biolinguistic literature on recursive complexity (Sauerland and Trotzke 2011). In this chapter, we consider the question of formal complexity measurement within linguistic minimalism (cf. also Biberauer et al., this volume, chapter 6; Progovac, this volume, chapter 5) and argue that our minimalist approach to complexity of derivations and representations shows simi- larities with that of alternative theoretical perspectives represented in this volume (Culicover, this volume, chapter 8; Jackendoff and Wittenberg, this volume, chapter 4). In particular, we agree that information structure properties should not be encoded in narrow syntax as features triggering movement, suggesting that the relevant information is established at the interfaces. Also, we argue for a minimalist model of grammar in which complexity arises out of the cyclic interaction of subderivations, a model we take to be compatible with Construction Grammar approaches. We claim that this model allows one to revisit the question of the formal complexity of a generative grammar, rephrasing it such that a different answer to the question of formal complexity is forthcoming depending on whether we consider the grammar as a whole, or just narrow syntax.
    [Show full text]
  • What Was Wrong with the Chomsky Hierarchy?
    What Was Wrong with the Chomsky Hierarchy? Makoto Kanazawa Hosei University Chomsky Hierarchy of Formal Languages recursively enumerable context- sensitive context- free regular Enduring impact of Chomsky’s work on theoretical computer science. 15 pages devoted to the Chomsky hierarchy. Hopcroft and Ullman 1979 No mention of the Chomsky hierarchy. 450 INDEX The same with the latest edition of Carmichael, R. D., 444 CNF-formula, 302 Cartesian product, 6, 46 Co-Turing-recognizableHopcroft, language, 209 Motwani, and Ullman (2006). CD-ROM, 349 Cobham, Alan, 444 Certificate, 293 Coefficient, 183 CFG, see Context-free grammar Coin-flip step, 396 CFL, see Context-free language Complement operation, 4 Chaitin, Gregory J., 264 Completed rule, 140 Chandra, Ashok, 444 Complexity class Characteristic sequence, 206 ASPACE(f(n)),410 Checkers, game of, 348 ATIME(t(n)),410 Chernoff bound, 398 BPP,397 Chess, game of, 348 coNL,354 Chinese remainder theorem, 401 coNP,297 Chomsky normal form, 108–111, 158, EXPSPACE,368 198, 291 EXPTIME,336 Chomsky, Noam, 444 IP,417 Church, Alonzo, 3, 183, 255 L,349 Church–Turing thesis, 183–184, 281 NC,430 CIRCUIT-SAT,386 NL,349 Circuit-satisfiability problem, 386 NP,292–298 CIRCUIT-VALUE,432 NPSPACE,336 Circular definition, 65 NSPACE(f(n)),332 Clause, 302 NTIME(f(n)),295 Clique, 28, 296 P,284–291,297–298 CLIQUE,296 PH,414 Sipser 2013Closed under, 45 PSPACE,336 Closure under complementation RP,403 context-free languages, non-, 154 SPACE(f(n)),332 deterministic context-free TIME(f(n)),279 languages, 133 ZPP,439 P,322 Complexity
    [Show full text]
  • LING83600: Context-Free Grammars
    LING83600: Context-free grammars Kyle Gorman 1 Introduction Context-free grammars (or CFGs) are a formalization of what linguists call “phrase structure gram- mars”. The formalism is originally due to Chomsky (1956) though it has been independently discovered several times. The insight underlying CFGs is the notion of constituency. Most linguists believe that human languages cannot be even weakly described by CFGs (e.g., Schieber 1985). And in formal work, context-free grammars have long been superseded by “trans- formational” approaches which introduce movement operations (in some camps), or by “general- ized phrase structure” approaches which add more complex phrase-building operations (in other camps). However, unlike more expressive formalisms, there exist relatively-efficient cubic-time parsing algorithms for CFGs. Nearly all programming languages are described by—and parsed using—a CFG,1 and CFG grammars of human languages are widely used as a model of syntactic structure in natural language processing and understanding tasks. Bibliographic note This handout covers the formal definition of context-free grammars; the Cocke-Younger-Kasami (CYK) parsing algorithm will be covered in a separate assignment. The definitions here are loosely based on chapter 11 of Jurafsky & Martin, who in turn draw from Hopcroft and Ullman 1979. 2 Definitions 2.1 Context-free grammars A context-free grammar G is a four-tuple N; Σ; R; S such that: • N is a set of non-terminal symbols, corresponding to phrase markers in a syntactic tree. • Σ is a set of terminal symbols, corresponding to words (i.e., X0s) in a syntactic tree. • R is a set of production rules.
    [Show full text]
  • The Logic of Categorial Grammars: Lecture Notes Christian Retoré
    The Logic of Categorial Grammars: Lecture Notes Christian Retoré To cite this version: Christian Retoré. The Logic of Categorial Grammars: Lecture Notes. RR-5703, INRIA. 2005, pp.105. inria-00070313 HAL Id: inria-00070313 https://hal.inria.fr/inria-00070313 Submitted on 19 May 2006 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. INSTITUT NATIONAL DE RECHERCHE EN INFORMATIQUE ET EN AUTOMATIQUE The Logic of Categorial Grammars Lecture Notes Christian Retoré N° 5703 Septembre 2005 Thème SYM apport de recherche ISRN INRIA/RR--5703--FR+ENG ISSN 0249-6399 The Logic of Categorial Grammars Lecture Notes Christian Retoré ∗ Thème SYM — Systèmes symboliques Projet Signes Rapport de recherche n° 5703 — Septembre 2005 —105 pages Abstract: These lecture notes present categorial grammars as deductive systems, and include detailed proofs of their main properties. The first chapter deals with Ajdukiewicz and Bar-Hillel categorial grammars (AB grammars), their relation to context-free grammars and their learning algorithms. The second chapter is devoted to the Lambek calculus as a deductive system; the weak equivalence with context free grammars is proved; we also define the mapping from a syntactic analysis to a higher-order logical formula, which describes the seman- tics of the parsed sentence.
    [Show full text]
  • Reflection in the Chomsky Hierarchy
    Journal of Automata, Languages and Combinatorics 18 (2013) 1, 53–60 c Otto-von-Guericke-Universit¨at Magdeburg REFLECTION IN THE CHOMSKY HIERARCHY Henk Barendregt Institute of Computing and Information Science, Radboud University, Nijmegen, The Netherlands e-mail: [email protected] Venanzio Capretta School of Computer Science, University of Nottingham, United Kingdom e-mail: [email protected] and Dexter Kozen Computer Science Department, Cornell University, Ithaca, New York 14853, USA e-mail: [email protected] ABSTRACT The class of regular languages can be generated from the regular expressions. These regular expressions, however, do not themselves form a regular language, as can be seen using the pumping lemma. On the other hand, the class of enumerable languages can be enumerated by a universal language that is one of its elements. We say that the enumerable languages are reflexive. In this paper we investigate what other classes of the Chomsky Hierarchy are re- flexive in this sense. To make this precise we require that the decoding function is itself specified by a member of the same class. Could it be that the regular languages are reflexive, by using a different collection of codes? It turns out that this is impossi- ble: the collection of regular languages is not reflexive. Similarly the collections of the context-free, context-sensitive, and computable languages are not reflexive. Therefore the class of enumerable languages is the only reflexive one in the Chomsky Hierarchy. In honor of Roel de Vrijer on the occasion of his sixtieth birthday 1. Introduction Let (Σ∗) be a class of languages over an alphabet Σ.
    [Show full text]
  • Appendix A: Hierarchy of Grammar Formalisms
    Appendix A: Hierarchy of Grammar Formalisms The following figure recalls the language hierarchy that we have developed in the course of the book. '' $$ '' $$ '' $$ ' ' $ $ CFG, 1-MCFG, PDA n n L1 = {a b | n ≥ 0} & % TAG, LIG, CCG, tree-local MCTAG, EPDA n n n ∗ L2 = {a b c | n ≥ 0}, L3 = {ww | w ∈{a, b} } & % 2-LCFRS, 2-MCFG, simple 2-RCG & % 3-LCFRS, 3-MCFG, simple 3-RCG n n n n n ∗ L4 = {a1 a2 a3 a4 a5 | n ≥ 0}, L5 = {www | w ∈{a, b} } & % ... LCFRS, MCFG, simple RCG, MG, set-local MCTAG, finite-copying LFG & % Thread Automata (TA) & % PMCFG 2n L6 = {a | n ≥ 0} & % RCG, simple LMG (= PTIME) & % mildly context-sensitive L. Kallmeyer, Parsing Beyond Context-Free Grammars, Cognitive Technologies, DOI 10.1007/978-3-642-14846-0, c Springer-Verlag Berlin Heidelberg 2010 216 Appendix A For each class the different formalisms and automata that generate/accept exactly the string languages contained in this class are listed. Furthermore, examples of typical languages for this class are added, i.e., of languages that belong to this class while not belonging to the next smaller class in our hier- archy. The inclusions are all proper inclusions, except for the relation between LCFRS and Thread Automata (TA). Here, we do not know whether the in- clusion is a proper one. It is possible that both devices yield the same class of languages. Appendix B: List of Acronyms The following table lists all acronyms that occur in this book. (2,2)-BRCG Binary bottom-up non-erasing RCG with at most two vari- ables per left-hand side argument 2-SA Two-Stack Automaton
    [Show full text]
  • Noam Chomsky
    Noam Chomsky “If you’re teaching today what you were teaching five years ago, either the field is dead or you are.” Background ▪ Jewish American born to Ukranian and Belarussian immigrants. ▪ Attended a non-competitive elementary school. ▪ Considered dropping out of UPenn and moving to British Palestine. ▪ Life changed when introduced to linguist Zellig Harris. Contributions to Cognitive Science • Deemed the “father of modern linguistics” • One of the founders of Cognitive Science o Linguistics: Syntactic Structures (1957) o Universal Grammar Theory o Generative Grammar Theory o Minimalist Program o Computer Science: Chomsky Hierarchy o Philosophy: Philosophy of Mind; Philosophy of Language o Psychology: Critical of Behaviorism Transformational Grammar – 1955 Syntactic Structures - 1957 ▪ Made him well-known within the ▪ Big Idea: Given the grammar, linguistics community you should be able to construct various expressions in the ▪ Revolutionized the study of natural language with prior language knowledge. ▪ Describes generative grammars – an explicit statement of what the classes of linguistic expressions in a language are and what kind of structures they have. Universal Grammar Theory ▪ Credited with uncovering ▪ Every sentence has a deep structure universal properties of natural that is mapped onto the surface human languages. structure according to rules. ▪ Key ideas: Humans have an ▪ Language similarities: innate neural capacity for – Deep Structure: Pattern in the mind generating a system of rules. – Surface Structure: Spoken utterances – There is a universal grammar that – Rules: Transformations underlies ALL languages Chomsky Hierarchy ▪ Hierarchy of classes of formal grammars ▪ Focuses on structure of classes and relationship between grammars ▪ Typically used in Computer Science and Linguistics Minimalist Program – 1993 ▪ Program NOT theory ▪ Provides conceptual framework to guide development of linguistic theory.
    [Show full text]