A HIERARCHY OF FORMAL LANGUAGES AND AUTOMATA

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Natural Language Processing - Formal Language - (formal) Language (formal) Grammar.
COGN1001: Introduction to Cognitive Science Topics in Computer Science Formal Languages and Models of Computation Qiang HUO Department of Computer.
Linear Bounded Automata LBAs
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
Normal forms for Context-Free Grammars
Fall 2006Costas Busch - RPI1 The Chomsky Hierarchy.
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Formal Grammars Denning, Sections 3.3 to 3.6. Formal Grammar, Defined A formal grammar G is a four-tuple G = (N,T,P,  ), where N is a finite nonempty.
Week 14 - Friday.  What did we talk about last time?  Exam 3 post mortem  Finite state automata  Equivalence with regular expressions.
::ICS 804:: Theory of Computation - Ibrahim Otieno SCI/ICT Building Rm. G15.
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Section 14.2 A Hierarchy of Languages Context-Sensitive Languages A context-sensitive grammar has productions of the form xAz  xyz, where A is a nonterminal.
Grammars CPSC 5135.
Introduction to Language Theory
CS 3240 – Chapter 11.  They may not halt on every possible input!  And not just because the creator of a specific TM was a doofus  This is related.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
Closure Properties Lemma: Let A 1 and A 2 be two CF languages, then the union A 1  A 2 is context free as well. Proof: Assume that the two grammars are.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Grammars A grammar is a 4-tuple G = (V, T, P, S) where 1)V is a set of nonterminal symbols (also called variables or syntactic categories) 2)T is a finite.
Formal Languages and Grammars
Discrete Structures ICS252 Chapter 5 Lecture 2. Languages and Grammars prepared By sabiha begum.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Theory of Languages and Automata By: Mojtaba Khezrian.
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
Chapter 2. Formal Languages Dept. of Computer Engineering, Hansung University, Sung-Dong Kim.
Theory of Languages and Automata By: Mojtaba Khezrian.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesAlgebraic.
CONTEXT-FREE LANGUAGES
Context-Free Grammars: an overview
Theory of Languages and Automata
Linear Bounded Automata LBAs
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Language and Grammar classes
Complexity and Computability Theory I
Automata and Languages What do these have in common?
Natural Language Processing - Formal Language -
Context Sensitive Grammar & Turing Machines
Context Sensitive Languages and Linear Bounded Automata
Lecture 22 Pumping Lemma for Context Free Languages
The chomsky hierarchy Module 03.3 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Chapter 7 PUSHDOWN AUTOMATA.
OTHER MODELS OF TURING MACHINES
LIMITS OF ALGORITHMIC COMPUTATION
PZ03A - Pushdown automata
Course 2 Introduction to Formal Languages and Automata Theory (part 2)
Chapter 2 FINITE AUTOMATA.
CSE322 Chomsky classification
REGULAR LANGUAGES AND REGULAR GRAMMARS
CSE322 The Chomsky Hierarchy
Jaya Krishna, M.Tech, Assistant Professor
Regular Grammar.
CHAPTER 2 Context-Free Languages
Finite Automata and Formal Languages
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Formal Languages, Automata and Models of Computation
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
The Chomsky Hierarchy Costas Busch - LSU.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
MA/CSSE 474 Theory of Computation
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Presentation transcript:

A HIERARCHY OF FORMAL LANGUAGES AND AUTOMATA Chapter 11 A HIERARCHY OF FORMAL LANGUAGES AND AUTOMATA

Learning Objectives At the conclusion of the chapter, the student will be able to: Explain the difference between recursive and recursively enumerable languages Describe the type of productions in an unrestricted grammar Identify the types of languages generated by unrestricted grammars Describe the type of productions in a context sensitive grammar Give a sequence of derivations to generate a string using the productions in a context sensitive grammar Identify the types of languages generated by context-sensitive grammars Construct a context-sensitive grammar to generate a particular language Describe the structure and components of the Chomsky hierarchy

Recursive and Recursively Enumerable Languages A language L is recursively enumerable if there exists a Turing machine that accepts it (as we have previously stated, rejected strings cause the machine to either not halt or halt in a nonfinal state) A language L is recursive if there exists a Turing machine that accepts it and is guaranteed to halt on every valid input string In other words, a language is recursive if and only if there exists a membership algorithm for it

Languages That Are Not Recursively Enumerable Theorem 11.1 states that, for any nonempty alphabet, there exist languages not recursively enumerable One proof involves a technique called diagonalization, which can be used to show that, in a sense, there are fewer Turing Machines than there are languages More explicitly, Theorem 11.3 describes the existence of a recursively enumerable language whose complement is not recursively enumerable Furthermore, Theorem 11.5 concludes that the family of recursive languages is a proper subset of the family of recursively enumerable languages

Unrestricted Grammars An unrestricted grammar has essentially no restrictions on the form of its productions: Any variables and terminals on the left side, in any order Any variables and terminals on the right side, in any order The only restriction is that  is not allowed as the left side of a production A sample unrestricted grammar has productions S  S1B S1  aS1b bB  bbbB aS1b  aa B  

Unrestricted Grammars and Recursively Enumerable Languages Theorem 11.6: Any language generated by an unrestricted grammar is recursively enumerable Theorem 11.7: For every recursively enumerable language L, there exists an unrestricted grammar G that generates L These two theorems establish the result that unrestricted grammars generate exactly the family of recursively enumerable languages, the largest family of languages that can be generated or recognized algorithmically

Context-Sensitive Grammars In a context-sensitive grammar, the only restriction is that, for any production, length of the right side is at least as large as the length of the left side Example 11.2 introduces a sample unrestricted grammar with productions S  abc | aAbc Ab  bA Ac  Bbcc bB  Bb aB  aa | aaA

Characteristics of Context-Sensitive Grammars An important characteristic of context-sensitive grammars is that they are noncontracting, in the sense that in any derivation, the length of successive sentential forms can never decrease These grammars are called context-sensitive because it is possible to specify that variables may only be replaced in certain contexts For instance, in the grammar of Example 11.2, variable A can only be replaced if it is followed by either b or c

Context-Sensitive Languages A language L is context-sensitive if there is a context- sensitive grammar G, such that either L = L(G) or L = L(G)  {  } The empty string is included, because by definition, a context-sensitive grammar can never generate a language containing the empty string As a result, it can be concluded that the family of context-free languages is a subset of the family of context-sensitive languages The language { anbncn: n ≥ 1 } is context-sensitive, since it is generated by the grammar in Example 11.2

Derivation of Strings Using a Context-Sensitive Grammar Using the grammar in Example 11.2, we derive the string aabbcc S  aAbc  abAc  abBbcc  aBbbcc  aabbcc The variables A and B are effectively used as messengers: an A is created on the left, travels to the right of the first c, where it creates another b and c, as well as variable B the newly created B is sent to the left in order to create the corresponding a

Context-Sensitive Languages and Linear Bounded Automata Theorem 11.8 states that, for every context- sensitive language L not including , there is a linear bounded automaton that recognizes L Theorem 11.9 states that, if a language L is accepted by a linear bounded automaton M, then there is a context-sensitive grammar that generates L These two theorems establish the result that context-sensitive grammars generate exactly the family of languages accepted by linear bounded automata, the context-sensitive languages

Relationship Between Recursive and Context-Sensitive Languages Theorem 11.10 states that every context-sensitive language is recursive Theorem 11.11 maintains that some recursive languages are not context-sensitive These two theorems help establish a hierarchical relationship among the various classes of automata and languages: Linear bounded automata are less powerful than Turing machines Linear bounded automata are more powerful than pushdown automata

The Chomsky Hierarchy The linguist Noam Chomsky summarized the relationship between language families by classifying them into four language types, type 0 to type 3 This classification, which became known as the Chomsky Hierarchy, is illustrated in Figure 11.3

An Extended Hierarchy We have studied additional language families and their relationships to those in the Chomsky Hierarchy By including deterministic context-free languages and recursive languages, we obtain the extended hierarchy in Figure 11.4

A Closer Look at the Family of Context- Free Languages Figure 11.5 illustrates the relationships among various subsets of the family of context-free languages: regular (LREG), linear (LLIN), deterministic context-free (LDCF), and nondeterministic context-free (LCF)