Context Sensitive Grammar

Size: px
Start display at page:

Download "Context Sensitive Grammar"

Transcription

1 Context Sensitive Grammar Aparna S Vijayan Department of Computer Science and Automation December 2, 2011 Aparna S Vijayan (CSA) CSG December 2, / 12

2 Contents Aparna S Vijayan (CSA) CSG December 2, / 12

3 Contents 1 Definition of CSG Aparna S Vijayan (CSA) CSG December 2, / 12

4 Contents 1 Definition of CSG 2 Context Sensitive Language(CSL) Aparna S Vijayan (CSA) CSG December 2, / 12

5 Contents 1 Definition of CSG 2 Context Sensitive Language(CSL) 3 Example of CSL Aparna S Vijayan (CSA) CSG December 2, / 12

6 Contents 1 Definition of CSG 2 Context Sensitive Language(CSL) 3 Example of CSL 4 Chomsky Hierachy Aparna S Vijayan (CSA) CSG December 2, / 12

7 Definition Context Sensitive Grammar(Type1 Grammar) A context-sensitive grammar (CSG) is an unrestricted grammar in which every production has the form α β with β α (where α and β are strings of nonterminals and terminals). The concept of context-sensitive grammar was introduced by Noam Chomsky in the In every derivation the length of the string never decreases. The term context-sensitive comes from a normal form for these grammars,where each production is of the form α 1 Aα 2 α 1 βα 2,with β ɛ. They permit replacement of variable A by string β only in the context α 1 - α 2. Aparna S Vijayan (CSA) CSG December 2, / 12

8 Formal Definition A Context Sensitive Grammar is a 4-tuple, G = (N,Σ, P, S) where: Aparna S Vijayan (CSA) CSG December 2, / 12

9 Formal Definition A Context Sensitive Grammar is a 4-tuple, G = (N,Σ, P, S) where: N=Set of non terminal symbols. Aparna S Vijayan (CSA) CSG December 2, / 12

10 Formal Definition A Context Sensitive Grammar is a 4-tuple, G = (N,Σ, P, S) where: N=Set of non terminal symbols. Σ=Set of terminal symbols. Aparna S Vijayan (CSA) CSG December 2, / 12

11 Formal Definition A Context Sensitive Grammar is a 4-tuple, G = (N,Σ, P, S) where: N=Set of non terminal symbols. Σ=Set of terminal symbols. S=Start symbol of the production. Aparna S Vijayan (CSA) CSG December 2, / 12

12 Formal Definition A Context Sensitive Grammar is a 4-tuple, G = (N,Σ, P, S) where: N=Set of non terminal symbols. Σ=Set of terminal symbols. S=Start symbol of the production. P=Finite set of productions. Aparna S Vijayan (CSA) CSG December 2, / 12

13 Formal Definition A Context Sensitive Grammar is a 4-tuple, G = (N,Σ, P, S) where: N=Set of non terminal symbols. Σ=Set of terminal symbols. S=Start symbol of the production. P=Finite set of productions. All rules in P are of the form α 1 Aα 2 α 1 βα 2. A N ( A is a single nonterminal) α 1, α 2, β (N Σ) +. Aparna S Vijayan (CSA) CSG December 2, / 12

14 Context Sensitive Language The language generated by the Context Sensitive Grammar is called context sensitive language. Aparna S Vijayan (CSA) CSG December 2, / 12

15 Context Sensitive Language The language generated by the Context Sensitive Grammar is called context sensitive language. If G is a Context Sensitive Grammar then L(G)= { w (w Σ ) ( S + G w)}. Aparna S Vijayan (CSA) CSG December 2, / 12

16 Context Sensitive Language The language generated by the Context Sensitive Grammar is called context sensitive language. If G is a Context Sensitive Grammar then L(G)= { w (w Σ ) ( S + G w)}. Eg 1 of a context sensitive grammar G = {{S, A, B, C, a, b, c}, {a, b, c}, P, S}where P is the set of rules. S asbc S abc CB BC ab ab bb bb bc bc cc cc The language generated by this grammar is {a n b n c n n 1}. Aparna S Vijayan (CSA) CSG December 2, / 12

17 Context Sensitive Language The derivation for the string aabbcc is Aparna S Vijayan (CSA) CSG December 2, / 12

18 Context Sensitive Language The derivation for the string aabbcc is S asbc Aparna S Vijayan (CSA) CSG December 2, / 12

19 Context Sensitive Language The derivation for the string aabbcc is S asbc aabcbc Aparna S Vijayan (CSA) CSG December 2, / 12

20 Context Sensitive Language The derivation for the string aabbcc is S asbc aabcbc aabcbc Aparna S Vijayan (CSA) CSG December 2, / 12

21 Context Sensitive Language The derivation for the string aabbcc is S asbc aabcbc aabcbc aabbcc Aparna S Vijayan (CSA) CSG December 2, / 12

22 Context Sensitive Language The derivation for the string aabbcc is S asbc aabcbc aabcbc aabbcc aabbcc Aparna S Vijayan (CSA) CSG December 2, / 12

23 Context Sensitive Language The derivation for the string aabbcc is S asbc aabcbc aabcbc aabbcc aabbcc aabbcc Aparna S Vijayan (CSA) CSG December 2, / 12

24 Context Sensitive Language The derivation for the string aabbcc is S asbc aabcbc aabcbc aabbcc aabbcc aabbcc aabbcc Aparna S Vijayan (CSA) CSG December 2, / 12

25 Example2 CSG L = (#a = #b = #c) G2 =({S, A, B, C, a, b, c}, {a, b, c}, P, S) S ABC S ABCS AB BA AC CA BC CB BA AB CA AC CB BC A a B b C c Aparna S Vijayan (CSA) CSG December 2, / 12

26 Hierarchy of Formal Languages Aparna S Vijayan (CSA) CSG December 2, / 12

27 Relation between Formal Languages The CFL s not containing ɛ are properly contained in the context sensitive languages Not all Context Sensitive Languages are Context Free. Every Context Sensitive Language is recusive. Aparna S Vijayan (CSA) CSG December 2, / 12

28 Chomsky Hierachy Described by Chomsky in Four classes of language Type 3,Type2,Type1,Type 0 from most restrictive to most general(unestricted). Each level of hierarchy can be characterized by a class of grammar. Aparna S Vijayan (CSA) CSG December 2, / 12

29 Chomsky Hierarchy Type Language productions Device 3 Regular A ab, A a Finite Automaton 2 CFL A α Pushdown Automaton 1 CSL α β, β α Linear Bounded Automaton 0 RE α β Turing Machine A,B Nonterminals α,β string of terminals and nonterminals a terminal symbol Aparna S Vijayan (CSA) CSG December 2, / 12

30 References Introduction to Automata Theory Languages and Computation by JOHN E HOPCROFT, JEFFERY D.ULLMAN. Introduction to Languages and the Theory of Computation JOHN MARTIN grammar Aparna S Vijayan (CSA) CSG December 2, / 12

31 Linear Bounded Automata Indu John Department of Computer Science and Automation Indian Institute of Science, Bangalore December 1, 2011 Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

32 Overview Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

33 Overview Definition Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

34 Overview Definition Results about LBAs Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

35 Overview Definition Results about LBAs CSLs and LBAs Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

36 Definition A Turing machine that uses only the tape space occupied by the input is called a linear-bounded automaton (LBA). A linear bounded automaton is a nondeterministic Turing machine M = (Q, Σ, Γ, δ, s, t, r) such that: There are two special tape symbols < and >(the left end marker and right end marker). The TM begins in the configuration (s, < x >, 0). The TM cannot replace < or > with anything else, nor move the tape head left of < or right of >. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

37 LBA An equivalent definition of an LBA is that it uses only k times the amount of space occupied by the input string, where k is a constant fixed for the particular machine. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

38 LBA An equivalent definition of an LBA is that it uses only k times the amount of space occupied by the input string, where k is a constant fixed for the particular machine. Possible to simulate k tape cells with a single tape cell, by increasing the size of the tape alphabet Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

39 LBA An equivalent definition of an LBA is that it uses only k times the amount of space occupied by the input string, where k is a constant fixed for the particular machine. Possible to simulate k tape cells with a single tape cell, by increasing the size of the tape alphabet Examples: {a n b n c n n 0}; counting number of a s Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

40 LBA An equivalent definition of an LBA is that it uses only k times the amount of space occupied by the input string, where k is a constant fixed for the particular machine. Possible to simulate k tape cells with a single tape cell, by increasing the size of the tape alphabet Examples: {a n b n c n n 0}; counting number of a s This limitation makes the LBA a somewhat more accurate model of computers that actually exist than a Turing machine, whose definition assumes unlimited tape. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

41 History Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

42 History In 1960, Myhill introduced an automaton model today known as deterministic linear bounded automaton. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

43 History In 1960, Myhill introduced an automaton model today known as deterministic linear bounded automaton. Shortly thereafter, Landweber proved that the languages accepted by a deterministic LBA are always context-sensitive. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

44 History In 1960, Myhill introduced an automaton model today known as deterministic linear bounded automaton. Shortly thereafter, Landweber proved that the languages accepted by a deterministic LBA are always context-sensitive. In 1964, Kuroda introduced the more general model of (nondeterministic) linear bounded automata, and showed that the languages accepted by them are precisely the context-sensitive languages. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

45 Number of configurations Suppose that a given LBA M has q states, m characters in the tape alphabet, and the input length is n. Then M can be in at most α(n) = Tapecontents {}}{ m n Headposition {}}{ n State {}}{ q configurations. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

46 Results about LBA Halting Problem The halting problem is solvable for linear bounded automata. Halt LBA = {< M, w > M is an LBA and M halts on w} is decidable. An LBA that stops on input w must stop in at most α( w ) steps Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

47 Results about LBA Halting Problem The halting problem is solvable for linear bounded automata. Halt LBA = {< M, w > M is an LBA and M halts on w} is decidable. An LBA that stops on input w must stop in at most α( w ) steps Membership problem The membership problem is solvable for linear bounded automata. A LBA = {< M, w > M is an LBA and M accepts w} is decidable. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

48 Results about LBA Emptiness Problem The emptiness problem is unsolvable for linear bounded automata. For every Turing machine there is a linear bounded automaton which accepts the set of strings which are valid halting computations for the Turing machine. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

49 LBA Problems Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

50 LBA Problems 1 Is the class of languages accepted by LBA equal to the class of languages accepted by deterministic LBA? Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

51 LBA Problems 1 Is the class of languages accepted by LBA equal to the class of languages accepted by deterministic LBA? Open Problem! Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

52 LBA Problems 1 Is the class of languages accepted by LBA equal to the class of languages accepted by deterministic LBA? Open Problem! 2 Is the class of languages accepted by LBA closed under complement? Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

53 LBA Problems 1 Is the class of languages accepted by LBA equal to the class of languages accepted by deterministic LBA? Open Problem! 2 Is the class of languages accepted by LBA closed under complement? Yes. (Immerman Szelepcsenyi Theorem) Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

54 LBAs and CSLs Theorem(Landweber-Kuroda) A language is accepted by an LBA iff it is context sensitive. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

55 Proof If L is a CSL, then L is accepted by some LBA. Let G = (N, Σ, S, P) be the given grammar such that L(G) = L. Construct LBA M with tape alphabet Σ {N Σ}(2- track machine) First track holds input string w Second track holds a sentential form α of G, initialized to S. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

56 Proof... If w = ɛ, M halts without accepting. Repeat : 1 Non-deterministically select a position i in α. 2 Non-deterministically select a production β γ of G. 3 If β appears beginning in position i of α, replace β by γ there. If the sentential form is longer than w, LBA halts without accepting. 4 Compare the resulting sentential form with w on track 1. If they match, accept. If not go to step 1. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

57 Proof... If there is a linear bounded automaton M accepting the language L, then there is a context sensitive grammar generating L {ɛ}. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

58 Proof... If there is a linear bounded automaton M accepting the language L, then there is a context sensitive grammar generating L {ɛ}. Sketch of proof : Derivation simulates moves of LBA Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

59 Proof... If there is a linear bounded automaton M accepting the language L, then there is a context sensitive grammar generating L {ɛ}. Sketch of proof : Derivation simulates moves of LBA Three types of productions 1 Productions that can generate two copies of a string in Σ, along with some symbols that act as markers to keep the two copies separate. 2 Productions that can simulate a sequence of moves of M. During this portion of a derivation, one of the two copies of the original string is left unchanged; the other, representing the input tape to M, is modified accordingly. 3 Productions that can erase everything but the unmodified copy of the string, provided that the simulated moves of M applied to the other copy cause M to accept. Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

60 References John Martin, Introduction to Languages and the Theory of Computation, Tata McGraw-Hill, Third Edition. John Hopcroft, Jeffery Ullman, Introduction to Automata Theory, Languages and Computation Indu John (Department of CSA) Linear Bounded Automata December 1, / 14

CA320 - Computability & Complexity

CA320 - Computability & Complexity CA320 - Computability & Complexity David Sinclair Context-Sensitive Grammars An unrestricted grammar is a 4-tuple G = (V,Σ,S,P), where V and Σ are disjoint sets of variables and terminals respectively.

More information

UNRESTRICTED GRAMMARS

UNRESTRICTED GRAMMARS 136 UNRESTRICTED GRAMMARS Context-free grammar allows to substitute only variables with strings In an unrestricted grammar (or a rewriting system) one may substitute any non-empty string (containing variables

More information

The Post Correspondence Problem

The Post Correspondence Problem The Post Correspondence Problem - Given a set, P of pairs of strings: where t i, b i Σ P = {[ t 1 b 1 ], t 2 b 2 ],, t k b k ]} - Question: Does there exist a sequence i 1, i 2, i n such that: t i1 t i2

More information

Introduction to Formal Languages, Automata and Computability p.1/42

Introduction to Formal Languages, Automata and Computability p.1/42 Introduction to Formal Languages, Automata and Computability Pushdown Automata K. Krithivasan and R. Rama Introduction to Formal Languages, Automata and Computability p.1/42 Introduction We have considered

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

Turing machines and linear bounded automata

Turing machines and linear bounded automata and linear bounded automata Informatics 2A: Lecture 29 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 25 November, 2011 1 / 13 1 The Chomsky hierarchy: summary 2 3 4 2 / 13

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

More information

CSCE 551: Chin-Tser Huang. University of South Carolina

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Computation History A computation history of a TM M is a sequence of its configurations C 1, C 2,, C l such

More information

Theory of Computation Turing Machine and Pushdown Automata

Theory of Computation Turing Machine and Pushdown Automata Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs

More information

Decidability (intro.)

Decidability (intro.) CHAPTER 4 Decidability Contents Decidable Languages decidable problems concerning regular languages decidable problems concerning context-free languages The Halting Problem The diagonalization method The

More information

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

FLAC Context-Sensitive Grammars

FLAC Context-Sensitive Grammars FLAC Context-Sensitive Grammars Klaus Sutner Carnegie Mellon Universality Fall 2017 1 Context-Sensitive Grammars Linear Bounded Automata LBA and Counting Where Are We? 3 Context-free languages based on

More information

Turing machines and linear bounded automata

Turing machines and linear bounded automata and linear bounded automata Informatics 2A: Lecture 29 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 27 November 2015 1 / 15 The Chomsky hierarchy: summary Level Language

More information

Automata Theory CS F-13 Unrestricted Grammars

Automata Theory CS F-13 Unrestricted Grammars Automata Theory CS411-2015F-13 Unrestricted Grammars David Galles Department of Computer Science University of San Francisco 13-0: Language Hierarchy Regular Languaes Regular Expressions Finite Automata

More information

Undecidable Problems and Reducibility

Undecidable Problems and Reducibility University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

More information

Turing machines and linear bounded automata

Turing machines and linear bounded automata and linear bounded automata Informatics 2A: Lecture 30 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 25 November 2016 1 / 17 The Chomsky hierarchy: summary Level Language

More information

Theory of Computation - Module 4

Theory of Computation - Module 4 Theory of Computation - Module 4 Syllabus Turing Machines Formal definition Language acceptability by TM TM as acceptors, Transducers - designing of TM- Two way infinite TM- Multi tape TM - Universal Turing

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Push-Down Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability

More information

MTH401A Theory of Computation. Lecture 17

MTH401A Theory of Computation. Lecture 17 MTH401A Theory of Computation Lecture 17 Chomsky Normal Form for CFG s Chomsky Normal Form for CFG s For every context free language, L, the language L {ε} has a grammar in which every production looks

More information

Einführung in die Computerlinguistik

Einführung in die Computerlinguistik Einführung in die Computerlinguistik Context-Free Grammars (CFG) Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Summer 2016 1 / 22 CFG (1) Example: Grammar G telescope : Productions: S NP VP NP

More information

Languages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write:

Languages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write: Languages A language is a set (usually infinite) of strings, also known as sentences Each string consists of a sequence of symbols taken from some alphabet An alphabet, V, is a finite set of symbols, e.g.

More information

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computation (IX) Yijia Chen Fudan University Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and

More information

5 3 Watson-Crick Automata with Several Runs

5 3 Watson-Crick Automata with Several Runs 5 3 Watson-Crick Automata with Several Runs Peter Leupold Department of Mathematics, Faculty of Science Kyoto Sangyo University, Japan Joint work with Benedek Nagy (Debrecen) Presentation at NCMA 2009

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

Introduction to Languages and Computation

Introduction to Languages and Computation Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014

More information

Pushdown Automata: Introduction (2)

Pushdown Automata: Introduction (2) Pushdown Automata: Introduction Pushdown automaton (PDA) M = (K, Σ, Γ,, s, A) where K is a set of states Σ is an input alphabet Γ is a set of stack symbols s K is the start state A K is a set of accepting

More information

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction) CS5371 Theory of Computation Lecture 14: Computability V (Prove by Reduction) Objectives This lecture shows more undecidable languages Our proof is not based on diagonalization Instead, we reduce the problem

More information

CS481F01 Prelim 2 Solutions

CS481F01 Prelim 2 Solutions CS481F01 Prelim 2 Solutions A. Demers 7 Nov 2001 1 (30 pts = 4 pts each part + 2 free points). For this question we use the following notation: x y means x is a prefix of y m k n means m n k For each of

More information

Chapter 7 Turing Machines

Chapter 7 Turing Machines Chapter 7 Turing Machines Copyright 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 A General Model of Computation Both finite automata and pushdown automata are

More information

CS20a: Turing Machines (Oct 29, 2002)

CS20a: Turing Machines (Oct 29, 2002) CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Church s thesis The computable functions are the same as the partial recursive

More information

CISC4090: Theory of Computation

CISC4090: Theory of Computation CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter

More information

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES Contents i SYLLABUS UNIT - I CHAPTER - 1 : AUT UTOMA OMATA Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 2 : FINITE AUT UTOMA OMATA An Informal Picture of Finite Automata,

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

More information

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages and and Department of Computer Science and Information Systems Birkbeck, University of London ptw@dcs.bbk.ac.uk Outline and Doing and analysing problems/languages computability/solvability/decidability

More information

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

More information

Chapter 8. Turing Machine (TMs)

Chapter 8. Turing Machine (TMs) Chapter 8 Turing Machine (TMs) Turing Machines (TMs) Accepts the languages that can be generated by unrestricted (phrase-structured) grammars No computational machine (i.e., computational language recognition

More information

(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3},

(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3}, Code No: 07A50501 R07 Set No. 2 III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All

More information

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage? Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage? What is the most powerful of automata? In this lecture we will introduce

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

ECS 120 Lesson 15 Turing Machines, Pt. 1

ECS 120 Lesson 15 Turing Machines, Pt. 1 ECS 120 Lesson 15 Turing Machines, Pt. 1 Oliver Kreylos Wednesday, May 2nd, 2001 Before we can start investigating the really interesting problems in theoretical computer science, we have to introduce

More information

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013 Q.2 a. Prove by mathematical induction n 4 4n 2 is divisible by 3 for n 0. Basic step: For n = 0, n 3 n = 0 which is divisible by 3. Induction hypothesis: Let p(n) = n 3 n is divisible by 3. Induction

More information

Automata Theory - Quiz II (Solutions)

Automata Theory - Quiz II (Solutions) Automata Theory - Quiz II (Solutions) K. Subramani LCSEE, West Virginia University, Morgantown, WV {ksmani@csee.wvu.edu} 1 Problems 1. Induction: Let L denote the language of balanced strings over Σ =

More information

Homework 8. a b b a b a b. two-way, read/write

Homework 8. a b b a b a b. two-way, read/write Homework 8 309 Homework 8 1. Describe a TM that accepts the set {a n n is a power of 2}. Your description should be at the level of the descriptions in Lecture 29 of the TM that accepts {ww w Σ } and the

More information

ECS 120 Lesson 20 The Post Correspondence Problem

ECS 120 Lesson 20 The Post Correspondence Problem ECS 120 Lesson 20 The Post Correspondence Problem Oliver Kreylos Wednesday, May 16th, 2001 Today we will continue yesterday s discussion of reduction techniques by looking at another common strategy, reduction

More information

Section 1 (closed-book) Total points 30

Section 1 (closed-book) Total points 30 CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes

More information

Introduction to Turing Machines

Introduction to Turing Machines Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability

More information

X-machines - a computational model framework.

X-machines - a computational model framework. Chapter 2. X-machines - a computational model framework. This chapter has three aims: To examine the main existing computational models and assess their computational power. To present the X-machines as

More information

Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x where

Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x where Recitation 11 Notes Context Free Grammars Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x A V, and x (V T)*. Examples Problem 1. Given the

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Problems of CFLs and beyond Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable

More information

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages CS533 Class 04a: 1 c P. Heeman, 2017 Introduction: Decidability Overview Decidable Problems of Regular Languages Decidable Problems of Context-Free Languages Preliminaries to Halting Problem CS533 Class

More information

On Rice s theorem. Hans Hüttel. October 2001

On Rice s theorem. Hans Hüttel. October 2001 On Rice s theorem Hans Hüttel October 2001 We have seen that there exist languages that are Turing-acceptable but not Turing-decidable. An important example of such a language was the language of the Halting

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Turing Machines Part III

Turing Machines Part III Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's

More information

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions? Before We Start The Pumping Lemma Any questions? The Lemma & Decision/ Languages Future Exam Question What is a language? What is a class of languages? Context Free Languages Context Free Languages(CFL)

More information

Theory & Practice Book. Computer Science & IT. for. Public Sector Exams

Theory & Practice Book. Computer Science & IT. for. Public Sector Exams Theory & Practice Book Computer Science & IT for Public Sector Exams ISRO, DRDO, BARC, BEL, HAL, NTPC, ONGC, BHEL, SAIL, GAIL, MTNL, FCI, ECL, ATC, DMRC, HLL, UPRVNL, CSPEB, OPTCL... Corporate Office:

More information

Computation Histories

Computation Histories 208 Computation Histories The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input. An accepting computation

More information

On the Sizes of DPDAs, PDAs, LBAs. by Richard Beigel and William Gasarch

On the Sizes of DPDAs, PDAs, LBAs. by Richard Beigel and William Gasarch On the Sizes of DPDAs, PDAs, LBAs by Richard Beigel and William Gasarch Abstract There are languages A such that there is a Pushdown Automata (PDA) that recognizes A which is much smaller than any Deterministic

More information

Pushdown Automata (Pre Lecture)

Pushdown Automata (Pre Lecture) Pushdown Automata (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Pushdown Automata (Pre Lecture) Fall 2017 1 / 41 Outline Pushdown Automata Pushdown

More information

SCHEME FOR INTERNAL ASSESSMENT TEST 3

SCHEME FOR INTERNAL ASSESSMENT TEST 3 SCHEME FOR INTERNAL ASSESSMENT TEST 3 Max Marks: 40 Subject& Code: Automata Theory & Computability (15CS54) Sem: V ISE (A & B) Note: Answer any FIVE full questions, choosing one full question from each

More information

Automata Theory (2A) Young Won Lim 5/31/18

Automata Theory (2A) Young Won Lim 5/31/18 Automata Theory (2A) Copyright (c) 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later

More information

Reducability. Sipser, pages

Reducability. Sipser, pages Reducability Sipser, pages 187-214 Reduction Reduction encodes (transforms) one problem as a second problem. A solution to the second, can be transformed into a solution to the first. We expect both transformations

More information

Lecture 17: Language Recognition

Lecture 17: Language Recognition Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 13 CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing

More information

ACS2: Decidability Decidability

ACS2: Decidability Decidability Decidability Bernhard Nebel and Christian Becker-Asano 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem

More information

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu Part 4 out of 5 ETH Zürich (D-ITET) October, 12 2017 Last week, we showed the equivalence of DFA, NFA and REX

More information

Pushdown Automata (2015/11/23)

Pushdown Automata (2015/11/23) Chapter 6 Pushdown Automata (2015/11/23) Sagrada Familia, Barcelona, Spain Outline 6.0 Introduction 6.1 Definition of PDA 6.2 The Language of a PDA 6.3 Euivalence of PDA s and CFG s 6.4 Deterministic PDA

More information

Parsing. Context-Free Grammars (CFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 26

Parsing. Context-Free Grammars (CFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 26 Parsing Context-Free Grammars (CFG) Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Winter 2017/18 1 / 26 Table of contents 1 Context-Free Grammars 2 Simplifying CFGs Removing useless symbols Eliminating

More information

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) Objectives Recall that decidable languages are languages that can be decided by TM (that means,

More information

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 10 More examples of problems in P Closure properties of the class P The class NP given by Jiri Srba Lecture 10 Computability and Complexity 1/12 Example: Relatively

More information

Theory of Computation (Classroom Practice Booklet Solutions)

Theory of Computation (Classroom Practice Booklet Solutions) Theory of Computation (Classroom Practice Booklet Solutions) 1. Finite Automata & Regular Sets 01. Ans: (a) & (c) Sol: (a) The reversal of a regular set is regular as the reversal of a regular expression

More information

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4 Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is

More information

Problems, and How Computer Scientists Solve Them Manas Thakur

Problems, and How Computer Scientists Solve Them Manas Thakur Problems, and How Computer Scientists Solve Them PACE Lab, IIT Madras Content Credits Introduction to Automata Theory, Languages, and Computation, 3rd edition. Hopcroft et al. Introduction to the Theory

More information

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF)

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF) CS5371 Theory of Computation Lecture 7: Automata Theory V (CFG, CFL, CNF) Announcement Homework 2 will be given soon (before Tue) Due date: Oct 31 (Tue), before class Midterm: Nov 3, (Fri), first hour

More information

Pushdown Automata. Reading: Chapter 6

Pushdown Automata. Reading: Chapter 6 Pushdown Automata Reading: Chapter 6 1 Pushdown Automata (PDA) Informally: A PDA is an NFA-ε with a infinite stack. Transitions are modified to accommodate stack operations. Questions: What is a stack?

More information

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY RYAN DOUGHERTY If we want to talk about a program running on a real computer, consider the following: when a program reads an instruction,

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 3: Finite State Automata Motivation In the previous lecture we learned how to formalize

More information

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: Mapping Reducibility 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/mapping.pdf 1 Last time Reducibility

More information

Variants of Turing Machine (intro)

Variants of Turing Machine (intro) CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples, Turing-recognizable and Turing-decidable languages Variants of Turing Machine Multi-tape Turing machines, non-deterministic

More information

4.2 The Halting Problem

4.2 The Halting Problem 172 4.2 The Halting Problem The technique of diagonalization was discovered in 1873 by Georg Cantor who was concerned with the problem of measuring the sizes of infinite sets For finite sets we can simply

More information

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #2 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 1 Lecture 2: Overview Recall some basic definitions from Automata Theory.

More information

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT. Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite

More information

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1 Turing Machines a n b n c The anguage Hierarchy n? ww? Context-Free anguages a n b n egular anguages a * a *b* ww Courtesy Costas Busch - PI a n b n c n Turing Machines anguages accepted by Turing Machines

More information

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable? } We ll now take a look at Turing Machines at a high level and consider what types of problems can be solved algorithmically and what types can t: What languages are Turing-decidable? What languages are

More information

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

More information

CSCE 551: Chin-Tser Huang. University of South Carolina

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan

More information

Computational Models - Lecture 4

Computational Models - Lecture 4 Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 28 Alexis Maciel Department of Computer Science Clarkson University Copyright c 28 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo INF28 1. Introduction and Regular Languages Daniel Lupp Universitetet i Oslo 18th January 218 Department of Informatics University of Oslo INF28 Lecture :: 18th January 1 / 33 Details on the Course consists

More information

How to Pop a Deep PDA Matters

How to Pop a Deep PDA Matters How to Pop a Deep PDA Matters Peter Leupold Department of Mathematics, Faculty of Science Kyoto Sangyo University Kyoto 603-8555, Japan email:leupold@cc.kyoto-su.ac.jp Abstract Deep PDA are push-down automata

More information

Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. The stack

Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. The stack A pushdown automata (PDA) is essentially: An NFA with a stack A move of a PDA will depend upon Current state of the machine Current symbol being read in Current symbol popped off the top of the stack With

More information

UNIT-VI PUSHDOWN AUTOMATA

UNIT-VI PUSHDOWN AUTOMATA Syllabus R09 Regulation UNIT-VI PUSHDOWN AUTOMATA The context free languages have a type of automaton that defined them. This automaton, called a pushdown automaton, is an extension of the nondeterministic

More information

There are two main techniques for showing that problems are undecidable: diagonalization and reduction

There are two main techniques for showing that problems are undecidable: diagonalization and reduction Reducibility 1 There are two main techniques for showing that problems are undecidable: diagonalization and reduction 2 We say that a problem A is reduced to a problem B if the decidability of A follows

More information

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines Definition of Algorithm:

More information

A Universal Turing Machine

A Universal Turing Machine A Universal Turing Machine A limitation of Turing Machines: Turing Machines are hardwired they execute only one program Real Computers are re-programmable Solution: Universal Turing Machine Attributes:

More information

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman Equivalence of TMs and Multitape TMs Theorem 3.13 and Corollary 3.15 By: Joseph Lauman Turing Machines First proposed by Alan Turing in 1936 Similar to finite automaton, but with an unlimited and unrestricted

More information