11 views

Uploaded by Priyanka Verma

automata notes

- Test VI-massages (12.02.2014)
- Verification, Validation and Testing in Software Engineering
- Chapter 3
- Theory of Computation
- Three Models for the Description of Language
- Ls Activity(8 Class) Suneeta Singh
- Syntax 1
- Scarpazza - Notes on the Catalan Problem - Slides 2004-03-16
- MELJUN CORTES Automata Lecture Equivalence of Pda and Cfg Part 1 1
- lexnyacc
- LP Intro
- CS2352-principle-of-Compiler-Degin-notes.pdf
- Segunda Recuperación Inglés
- Examples to Accompany http://www.scribd.com/doc/16033954/Algoppr-Rev (19OR24P Rev)
- 2 Parse
- Closure Properties for Context
- azFatCFG.ppt
- 1st sess comp
- _Mi Sports Bluetooth Earphones
- Automata and Language Theory

You are on page 1of 11

7) The Chomsky hierarchy, named for linguist Noam Chomsky who studied formal grammars, describes a hierarchy of languages, ranging from the very simple regular languages up through the very general recursively enumerable languages. The hierarchy of languages can be described as a hierarchy of languages (sets), or a hierarchy of grammars, or a hierarchy of machines Recursively Enumerable Languages Context-Sensitive Languages Context-Free Languages Regular Languages

Chomsky Hierarchy

Languages Recursively enumerable languages Context-Sensitive Languages Grammars Type 0: Unrestricted grammars Type 1: Context-Sensitive Grammars Machines Turing Machines (deterministic or nondeterministic) Linear-Bounded Automata (nondeterministic) Pushdown Automata (nondeterministic) Finite Automata (deterministic or nondeterministic)

Context-Free Languages

Regular Languages

Chomsky Hierarchy: Grammars Notation: : Set of terminals : Set of nonterminals (variables) Type 0: Phrase-Structure Grammars (Unrestricted Grammars) Productions : , ( )* Type 1: Context-Sensitive Grammars Productions : , ( )* Restriction: || || Type 2: Context-Free Grammars Productions A : A ( )* Type 3: Right-Linear Grammars Productions A : A is either w or wB, where w * B Alternative formulation: xAz xyz A x, y, z ( )*, y

Chomsky Hierarchy: Machines Turing Machines (deterministic or nondeterministic) Memory: A machine state An infinitely long tape Linear-Bounded Automata Memory: A machine state A tape the same length as the input (+ 2 endmarkers) Pushdown Automata Memory: A machine state A stack Finite Automata Memory: A machine state

Context-Sensitive Languages A note on CSGs and : Because of the restriction on increasing length in grammar rules, CSGs cannot generate . Thus, strictly speaking, L is a Context-Sensitive Languages if there is a CSG G such that either L = L(G) or L = L(G) {}. Example: Context-Sensitive Grammar for {anbncn | n > 0} S aAbc | abc A aAbC | abC Cb bC Cc cc Sample derivation of aaabbbccc: S aAbc aaAbCbc aaabCbCbc aaabbCCbc aaabbCbCc aaabbbCCc aaabbbCcc aaabbbccc Example: Linear-bounded Automaton algorithm to accept {anbncn | n 0} Repeatedly: Replace leftmost a by X Replace leftmost b by Y Replace leftmost c by Z Until no more as, bs, cs remain. If this can be done, erase all Xs, Ys, and Zs, write 1, and halt. (Otherwise, halt early with garbage on tape.) This doesnt require any extra tape space beyond space for input.

Copyright 2010 Nancy Lynn Tinkham

S and A generate abc triples. (Each C will become a c eventually.) Cb and Cc rules move cs to the end of the string.

All Context-Sensitive Languages are recursive (Turing-recognizable): It is possible for an LBA computation (or a CSG derivation) to go on forever without halting. However, there is an algorithm to determine whether a given string w can be generated by a given CSG: Construct a tree containing all possible derivations of the grammar: S is the root. The children of S are the strings that can be derived from S in one rule application. The children of Ss children are the strings that can be derived from Ss children in one rule application. Etc. Cut off a tree branch at string x (dont generate children of x) if: x is the input string w (in which case, accept); or x is identical to one of xs ancestors (in this case, any string derivable from x can be derived from xs ancestor); or |x| > |w| ; or No rule is applicable to x This tree is finite.

Why? All nodes in the tree contain strings over (a finite alphabet) of length |w|. There are only finitely many of these (at most, | | 0 + | | 1 + | |2 + + | | |w| ). A node might be the child of several parents, but the tree has a finite branching factor, and a path has a maximum length of | | |w| .

Illustration of tree of derivations in previous CSL proof Sample grammar: S aSb | ab ab ba ba ab Deriving string: abab Tree of derivations:

S aSb aaSbb (too long) aabb abab (matches) ab ba ab (duplicates ancestor)

Right-Linear Grammars Example: Right-Linear Grammar for a*b(ab)* S aS S bA A abA A Sample derivation for aababab: S aA aaA aabB aababB aabababB aababab Sample derivation for b: S bB b Example: Right-Linear Grammar for (ab*a)* S aB | B bB B aS Sample derivation for abaabba: S aB abB abaS abaaB abaabB abaabbB abaabbaS abaabba Sample derivation for aa: S aB aaS aa Note: The variables in a right-linear grammar correspond approximately to the states in a FA.

Determinism and Nondeterminism For which language families does nondeterminism make a difference? Machine Languages of deterministic machines = Languages of nondeterministic machines? Yes Unknown No Yes

Closure Properties Closed under: Union R.E. languages Recursive languages CSLs CFLs Regular languages Yes Yes Yes Yes Yes Intersection Yes Yes Yes No Yes Complement No Yes Yes No Yes

Closure Justification Results for recursive and r.e. languages proved in earlier chapter. Union, for Context-Free Grammar (and Right-Linear Grammar): Rename variables if necessary so no variable occurs in both. Add S S1 | S2 to the grammar. Union, for CSG: Replace each terminal a on the LHS of a production with a variable Xa, and add production Xa a to the grammar. Rename variables if necessary so no variable occurs in both. Add S S1 | S2 to the grammar. Intersection, for LBA: Simulate LBAs M1 and M2 on a 2-track LBA one track for M1, one for M2. (2 tracks, so that we still have access to input string after M1 simulation has ended.) (Complement for LBA is a complicated construction we'll skip it.) Non-intersection for CFLs: requires Pumping Lemma. Non-complement for CFLs follows from non-intersection.

Why? L1 L2 = (L1C L2C)C

Complement of Regular Languages: In FA, make all accepting states non-accepting, and vice versa. Intersection of Regular Languages follows from complement and union.

As above, L1 L2 = (L1C L2C)C

- Test VI-massages (12.02.2014)Uploaded bySlavjanka Paunova Kuculova
- Verification, Validation and Testing in Software EngineeringUploaded bylilbouyin
- Chapter 3Uploaded byRosyWalia71
- Theory of ComputationUploaded byPrakash Koli Moi
- Three Models for the Description of LanguageUploaded byHong Ah
- Ls Activity(8 Class) Suneeta SinghUploaded bySuneeta singh
- Syntax 1Uploaded byAtra
- Scarpazza - Notes on the Catalan Problem - Slides 2004-03-16Uploaded byDiego Gamboa
- lexnyaccUploaded byravi
- MELJUN CORTES Automata Lecture Equivalence of Pda and Cfg Part 1 1Uploaded byMELJUN CORTES, MBA,MPA
- LP IntroUploaded byVan Gunxsword
- CS2352-principle-of-Compiler-Degin-notes.pdfUploaded byVignesh Vicky
- Segunda Recuperación InglésUploaded byDeborah Cohen
- Examples to Accompany http://www.scribd.com/doc/16033954/Algoppr-Rev (19OR24P Rev)Uploaded byJustine Leon A. Uro
- 2 ParseUploaded byJoey Nyl Villamejor Florita
- Closure Properties for ContextUploaded byMaha Zabeen
- azFatCFG.pptUploaded bypaksmiler
- 1st sess compUploaded byapi-3812391
- _Mi Sports Bluetooth EarphonesUploaded byPadmanaban
- Automata and Language TheoryUploaded byMarie Cristine Epa
- JNTUK-DAP-Course Structure and CSE -II YEAR.R10 StudentsUploaded byscribdsiv
- IndexUploaded byKui Mangus
- sentences extraUploaded byapi-290529183
- English Class 3Uploaded byJosef Alonso
- Conditionals (Ingles )Uploaded byAlexa Bermeo
- PAGE 1Uploaded bySudhir Narang
- Geometry MS3Uploaded bymbramanti
- Final Assignment DiscourseUploaded byYeni Purtika
- 1st grade lp phpUploaded byapi-236448821
- Ejercicios VacacionesUploaded byarioli

- 415 Quiz 1 AnswersUploaded byAshley Portega
- Class - 4 English Book - Word Meanings SysnonymsUploaded byPriyanka Verma
- TestingUploaded byPriyanka Verma
- cohesion.docxUploaded byPriyanka Verma
- FormatsUploaded byPriyanka Verma
- Form 002Uploaded bytripathiashish
- MINI Project1Uploaded byPriyanka Verma
- Email etiquetteUploaded byPriyanka Verma
- o - Level CourceUploaded byDebayan Bhattacharya
- Data_warehouse.PPTUploaded byPriyanka Verma
- 18635830 Lesson 1 Introduction to Business CommunicationUploaded byBhuvanesh Kumar
- AssertiveUploaded byPriyanka Verma
- ThesisUploaded byPriyanka Verma

- Filipino Social ThinkersUploaded byJULIVILLE SALINAS
- Making a Case for Quantitative Research in the Study of Modern Chinese History: The New China News Agency and Chinese Policy Views of Vietnam, 1977-1993Uploaded byilamont
- Muhammads ExistenceUploaded byRedza
- Broadsheets vs. Tabloids: neutrality vs. sensationalismUploaded byduneden_1985
- DATA STRUCTURESUploaded byAndrea Bates
- Essay 3 - How Are Language and Identity are connectedUploaded byXie Wenhan
- The Game is Chess Not Checkers SummaryUploaded byDr-Chambers1
- 100 USEFUL CONVERSATIONAL PRHASES AND WORDS IN MANDARINUploaded byPaula Berisso
- Simple Past TenseUploaded byRoxana Alexandru
- Lexicon to AeskyhlosUploaded bySaygın
- English Tenses Worksheet-1Uploaded bybushrapaki21
- 9. Origins of Pashto_v_LII_jan_2016.pdfUploaded byshamroz kakar
- CristianCraciun Resume Eng Projects Oct2010 11 Animation LightUploaded byCristian Craciun
- 18 Present Perfect vs PastUploaded byhiepnhatrang
- datastructure and algorithms in javaUploaded bylgnirmalkumar2009
- Global Scale Grid CEFRUploaded byElliott Alexander Osorio Marquez
- MOS3E-Chapter1-pp1-10 ---Uploaded bytutorial122011
- ADA 2.docxUploaded byGarcía Saidy
- OracleUploaded bytika
- MongoDB Architecture GuideUploaded byKamal Sharma
- PUCIT Database Systems Course OutlineUploaded bymirzamwaqar
- ç13891386-Intercultural-Communicative-Competence-in-the-OU-Level-3-Spanish-course-A-buen-puertoUploaded byMarta Santos
- Introduction to UML 2 Sequence DiagramsUploaded byIvan Arsić
- fd essay copyUploaded byapi-284747169
- AWL and ESP in the 21st CenturyUploaded byJorge Daniel
- METAPHORS IN MIND - Transformation through Symbolic Modelling - James Lawley, Penny Tompkins (ISBN 0-9538751-0-5)(2000).pdfUploaded byevoander
- stephen j so resume dodeaUploaded byapi-300612262
- Boe Xi 31 Sp SolarisUploaded byVijay Suryawanshi
- Escape Magazine Issue 26Uploaded byrustydfa
- benchmark lesson planUploaded byapi-248381771