CSE 2001: Introduction to Theory of Computation Fall 2013

Slides:



Advertisements
Similar presentations
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Advertisements

Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
Decidable languages Sipser 4.1 (pages ). CS 311 Mount Holyoke College 2 Hierarchy of languages All languages Turing-recognizable Turing-decidable.
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 6 Decidability Jan Maluszynski, IDA, 2007
Foundations of (Theoretical) Computer Science Chapter 4 Lecture Notes (Section 4.1: Decidable Languages) David Martin With modifications.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Midterm 2 review Jundong Liu School of EECS
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
CSCI 2670 Introduction to Theory of Computing October 12, 2005.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
Computability Review homework. Video. Variations. Definitions. Enumerators. Hilbert's Problem. Algorithms. Summary Homework: Give formal definition of.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
CSCI 2670 Introduction to Theory of Computing
Turing Machines Alan Turing ( ) mathematician and logician.
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
PARTIAL RECURSIVE FUNCTION
Linear Bounded Automata LBAs
Automata, Grammars and Languages
Context Sensitive Languages and Linear Bounded Automata
Intro to Theory of Computation
CSE 105 theory of computation
BCS 2143 Theory of Computer Science
CS154, Lecture 7: Turing Machines.
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
Intro to Theory of Computation
Jaya Krishna, M.Tech, Assistant Professor
Automata and Formal Languages (Final Review)
CSE 105 theory of computation
Non-Deterministic Finite Automata
Decidable Languages Costas Busch - LSU.
CSC 4170 Theory of Computation Decidable languages Section 4.1.
Decidable and undecidable languages
CSCI 2670 Introduction to Theory of Computing
Reducability Sipser, pages
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
CSE 105 theory of computation
Instructor: Aaron Roth
Theory of Computability
CSE 105 theory of computation
CSE 105 theory of computation
Automata, Grammars and Languages
Intro to Theory of Computation
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

CSE 2001: Introduction to Theory of Computation Fall 2013 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cse.yorku.ca/course/2001 9/17/2018 CSE 2001, Fall 2013

Chapter 4: Decidability We are now ready to tackle the question: What can computers do and what not? We do this by considering the question: Which languages are TM-decidable, Turing- recognizable, or neither? Assuming the Church-Turing thesis, these are fundamental properties of the languages. 9/17/2018 CSE 2001, Fall 2013

Describing TM Programs Three Levels of Describing algorithms: formal (state diagrams, CFGs, et cetera) implementation (pseudo-Pascal) high-level (coherent and clear English) Describing input/output format: TMs allow only strings * as input/output. If our X and Y are of another form (graph, Turing machine, polynomial), then we use X,Y to denote ‘some kind of encoding *’. 9/17/2018 CSE 2001, Fall 2013

Deciding Regular Languages The acceptance problem for deterministic finite automata is defined by: ADFA = { B,w | B is a DFA that accepts w } Note that this language deals with all possible DFAs and inputs w, not a specific instance. Of course, ADFA is a TM-decidable language. 9/17/2018 CSE 2001, Fall 2013

ADFA is Decidable (Thm. 4.1) Proof: Let the input B,w be a DFA with B=(Q, , , qstart, F) and w*. The TM performs the following steps: Check if B and w are ‘proper’, if not: “reject” Simulate B on w with the help of two pointers: Pq  Q for the internal state of the DFA, and Pw  {0,1,…,|w|} for the position on the string. While we increase Pw from 0 to |w|, we change Pq according to the input letter wPw and the transition function value (Pq,wPw). If M accepts w: “accept”; otherwise “reject” 9/17/2018 CSE 2001, Fall 2013

Deciding NFA The acceptance problem for nondeterministic FA ANFA = { B,w | B is an NFA that accepts w } is a TM decidable language. Proof: Let the input B,w be an NFA with B=(Q, , , qstart, F) and w*. Use our earlier results on finite automata to transform the NFA B into an equivalent DFA C. (See Theorem 1.19 how to do this automatically.) Use the TM of the previous result on C,w. This can all be done with one big, combined TM. 9/17/2018 CSE 2001, Fall 2013

Regular Expressions The acceptance problem AREX = { R,w | R is a regular expression that can generate w } is a Turing-decidable language. Proof Theorem 4.3. On input R,w: Check if R is a proper regular expression and w a proper string Convert R into a DFA B Run earlier TM for ADFA on B,w 9/17/2018 CSE 2001, Fall 2013

Emptiness Testing (Thm. 4.4) Another problem relating to DFAs is the emptiness problem: EDFA = {A | A is a DFA with L(A) =  } How can we decide this language? This language concerns the behavior of the DFA A on all possible strings. Less obvious than the previous examples. Idea: check if an accept state of A is reachable from the start state of A. 9/17/2018 CSE 2001, Fall 2013

Proof for DFA-Emptiness Algorithm for EDFA on input A=(Q,,,qstart,F): If A is not proper DFA: “reject” Mark the start state of A qstart Repeat until no new states are marked: Mark any states that can be -reached from any marked state that is already marked If no accept state is marked, “accept”; else “reject” 9/17/2018 CSE 2001, Fall 2013

DFA-Equivalence (Thm. 4.5) A problem that deals with two DFAs: EQDFA = {A,B | L(A) = L(B) } Theorem 4.5: EQDFA is TM-decidable. Proof: Look at the symmetric difference between the two languages: Note: “L(A)=L(B)” is equivalent with an empty symmetric difference between L(A) and L(B). This difference is expressed by standard DFA transformations: union, intersection, complement. 9/17/2018 CSE 2001, Fall 2013

Proof of Theorem 4.5 (cont.) Algorithm on given A,B: If A or B are not proper DFA: “reject” Construct a third DFA C that accepts the language (with standard ‘Chapter 1’ transformations). Decide with the TM of the previous theorem whether or not CEDFA If CEDFA then “accept”; If CEDFA then “reject” 9/17/2018 CSE 2001, Fall 2013

Context-Free language problems Similar languages for context-free grammars: ACFG = { G,w | G is a CFG that generates w } ECFG = { G | G is a CFG with L(G)= } EQCFG = { G,H | G and H are CFGs with L(G)=L(H) } The problem with CFGs and PDAs is that they are inherently non-deterministic. 9/17/2018 CSE 2001, Fall 2013

Recall “Chomsky NF” A context-free grammar G = (V,,R,S) is in Chomsky normal form if every rule is of the form A  BC or A  x with variables AV and B,CV \{S}, and x For the start variable S we also allow “S  ” Chomsky NF grammars are easier to analyze. The derivation S * w requires 2|w|–1 steps (apart from S  ). 9/17/2018 CSE 2001, Fall 2013

Deciding CFGs (1) Theorem 4.6: The language ACFG = { G,w | G is a CFG that generates w } is TM-decidable. Proof: Perform the following algorithm: Check if G and w are proper, if not “reject” Rewrite G to G’ in Chomsky normal form Take care of w= case via S check for G’ List all G’ derivations of length 2|w|–1 Check if w occurs in this list; if so “accept”; if not “reject” 9/17/2018 CSE 2001, Fall 2013

Deciding CFGs (2) Theorem 4.7: The language ECFG = { G | G is a CFG with L(G)= } is TM-decidable. Proof: Perform the following algorithm: Check if G is proper, if not “reject” Let G=(V,,R,S), define set T= Repeat |V| times: Check all rules BX1…Xk in R If BT and X1…XkTk then add B to T If ST then “reject”, otherwise “accept” 9/17/2018 CSE 2001, Fall 2013

Equality of CFGs What about the equality language EQCFG = { G,H | G and H are CFGs with L(G)=L(H) }? For DFAs we could use the emptiness decision procedure to solve the equality problem. For CFGs this is not possible… (why?) … because CFGs are not closed under complementation or intersection. Later we will see that EQCFG is not TM-decidable. 9/17/2018 CSE 2001, Fall 2013

Deciding Languages We now know that the languages: ADFA = { B,w | B is a DFA that accepts w } ACFG = { G,w | G is a CFG that generates w } are TM decidable. What about the obvious next candidate ATM = {M,w | M is a TM that accepts w }? Is one TM capable of simulating all other TMs? 9/17/2018 CSE 2001, Fall 2013

Does there exist a Universal TM? Given a description M,w of a TM M and input w, can we simulate M on w? We can do so via a universal TM U (2-tape): Check if M is a proper TM Let M = (Q,,,,q0,qaccept,qreject) Write down the starting configuration  q0w  on the second tape Repeat until halting configuration is reached: Replace configuration on tape 2 by next configuration according to  “Accept” if qaccept is reached; “reject” if qreject 9/17/2018 CSE 2001, Fall 2013

Next Towards undecidability: The Halting Problem Countable and uncountable infinities Diagonalization arguments 9/17/2018 CSE 2001, Fall 2013