Intro to Theory of Computation

Slides:



Advertisements
Similar presentations
The difference -- between Recognizable and decidable If L is decidable, then L is recognized by a TM M that halts on all inputs. Note that, L might be.
Advertisements

1 Introduction to Computability Theory Lecture12: Decidable Languages 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)
Midterm 2 review Jundong Liu School of EECS
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
CSCI 2670 Introduction to Theory of Computing October 12, 2005.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 20 Last time Mapping reductions Computation history method Today Computation history method.
 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.
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
Theory of Computability
Intro to Theory of Computation
CSE 105 theory of computation
BCS 2143 Theory of Computer Science
CSE 105 theory of computation
CSE 2001: Introduction to Theory of Computation Fall 2013
Reducibility The Chinese University of Hong Kong Fall 2010
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
Intro to Theory of Computation
Intro to Theory of Computation
CSE 105 theory of computation
Intro to Theory of Computation
Intro to Theory of Computation
Jaya Krishna, M.Tech, Assistant Professor
Intro to Theory of Computation
Intro to Theory of Computation
Automata and Formal Languages (Final Review)
CSE 105 theory of computation
CSC 4170 Theory of Computation Decidable languages Section 4.1.
Decidable and undecidable languages
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSC 4170 Theory of Computation Mapping Reducibility Section 5.3.
Intro to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CSE 105 theory of computation
CSE 105 theory of computation
Theory of Computability
Instructor: Aaron Roth
CSC 4170 Theory of Computation Mapping Reducibility Section 5.3.
Theory of Computability
More undecidable languages
Intro to Theory of Computation
Instructor: Aaron Roth
CSE 105 theory of computation
CSE 105 theory of computation
Automata, Grammars and Languages
Intro to Theory of Computation
Intro to Theory of Computation
Intro to Theory of Computation
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:

Intro to Theory of Computation LECTURE 13 Last time: Turing Machine Variants Church-Turing Thesis Universal Turing Machine Decidable languages Today Designing deciders CS 332 Sofya Raskhodnikova 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Recall We can encode DFAs, NFAs, regular expressions, PDAs, CFGs, etc into strings of 0s and 1s. We defined the following languages: ADFA = { 〈D,w〉 | D is a DFA that accepts string w } ANFA = { 〈N,w〉 | N is an NFA that accepts string w } ACFG = { 〈G,w〉 | G is a CFG that generates string w } 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Recall: Examples of decidable languages ADFA = { 〈D,w〉 | D is a DFA that accepts string w } ANFA = { 〈N,w〉 | N is an NFA that accepts string w } ACFG = { 〈G,w〉 | G is a CFG that generates string w } 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Decidable languages: more examples EDFA = { 〈D〉 | D is a DFA that recognizes the empty language } EQDFA = { 〈 𝐷 1 , 𝐷 2 〉 | 𝐷 1 , 𝐷 2 are DFAs and 𝐿(𝐷 1 )=𝐿( 𝐷 2 ) } ECFG = { 〈G〉 | G is a CFG that generates the empty language} 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Theorem. EDFA is decidable. EDFA = { ⟨𝑫⟩ | 𝑫 is a DFA that recognizes ∅.} Proof: The following TM M decides EDFA. M = `` On input 〈𝑫〉, where 𝑫 is a DFA: Use BFS to determine if an accepting state of D is reachable from from its start state. Accept if not. O.w. reject.’’ 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Theorem. EQDFA is decidable. EQDFA = { ⟨ 𝑫 𝟏 , 𝑫 𝟐 ⟩| 𝑫 𝟏 , 𝑫 𝟐 are DFAs and 𝑳 𝑫 𝟏 =𝑳( 𝑫 𝟐 )} Proof: The following TM M decides EQDFA. M = `` On input 〈 𝑫 𝟏 , 𝑫 𝟐 〉, where 𝑫 𝟏 , 𝑫 𝟐 are DFAs: Construct a DFA D that recognizes the set difference of 𝑳 𝑫 𝟏 and 𝑳( 𝑫 𝟐 ). Run the decider for EDFA on <D>. If it accepts, accept. O.w. reject.’’ (on the board) 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Theorem. ECFG is decidable. ECFG = { ⟨𝑮⟩ | 𝑮 is a CFG that generates no strings} Proof: The following TM M decides ECFG. M = `` On input 〈𝑮〉, where 𝑮 is a CFG: Mark all terminals in G. Repeat until no new variable is marked: Mark any variable A where G has a rule A→… and each variable/terminal on the RHS is already marked. Accept if the start variable is unmarked. O.w. reject.’’ 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Exercises Prove that the following language is decidable: Formulate the following problem as a language and prove that it is decidable: Given a PDA and a string, determine if the PDA accepts the string. Can a TM just simulate P on w, accept if it accepts and reject o.w.? RDFA = { 〈D,w〉 | D is a DFA that rejects string w } APDA = { 〈P,w〉 | P is a PDA that accepts string w } 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Exercise A decider for APDA can, on input <P, w> simulate P on w, accept if it accepts and reject o.w. convert P to an equivalent CFG G and then run a decider for ACFG, accept if it accepts and reject o.w. convert P to an equivalent CFG G and then run a decider for ACFG, accept if it rejects and reject o.w. None of the above. More than one choice above works. {madam, dad, but, tub, book}

Sofya Raskhodnikova; based on slides by Nick Hopper Examples of decidable languages so far ADFA = { 𝑫, 𝒘 ∣ D is a DFA that accepts string w } EDFA = { 𝑫 ∣ D is a DFA and L(D)=∅} EQDFA = { 𝑫 𝟏 , 𝑫 𝟐 ∣ 𝑫 𝟏 , 𝑫 𝟐 DFAs and 𝑳(𝑫 𝟏 )= 𝑳(𝑫 𝟐 )} ADFA , EDFA, EQDFA, ACFG, ECFG are decidable. 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Classes of languages recognizable decidable CFL regular 10/31/2019

Sofya Raskhodnikova; based on slides by Nick Hopper Theorem. Every CFL is decidable. Proof: Let G be a CFG for L. Design a TM 𝑀 𝐺 that decides L. Is it a good idea to convert G to an equivalent PDA P and have 𝑴 𝑮 simulate P? 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Exercise G is a CFG for L. Design a TM 𝑀 𝐺 that decides L. Is it a good idea to convert G to an equivalent PDA P and have 𝑴 𝑮 simulate P? Yes. Why not? No, we can’t always convert G to an equivalent PDA. No, P might loop on some inputs. No, because we don’t have any input to run P on. None of the above. {madam, dad, but, tub, book}

Exercise G is a CFG for L. Design a TM 𝑀 𝐺 that decides L. A decider for which language is useful as a subroutine? for ADFA for EDFA for EQDFA for ACFG for ECFG {madam, dad, but, tub, book}

Sofya Raskhodnikova; based on slides by Nick Hopper Theorem. Every CFL is decidable. Proof: Let G be a CFG for L. Design a TM 𝑀 𝐺 that decides L. Is it a good idea to convert G to an equivalent PDA P and have 𝑴 𝑮 simulate P? M = `` On input 𝒘: Run the decider for ACFG on input <G,w>. Accept if it accepts. O.w. reject.’’ 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Classes of languages recognizable decidable CFL regular 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Theorem. INFINITEDFA is decidable. INFINITEDFA = { 〈D〉 | D is a DFA and L(D) is infinite} Idea: Let 𝒏 be the number of states in D. L(D) is infinite iff D accepts a string of length ≥𝒏. Proof: The following TM M decides INFINITEDFA. M = `` On input 〈𝑫〉, where 𝑫 is a DFA: Let 𝒏 be the number of states in D. Let C be a DFA for {w | |w| ≥ 𝑛}. Build a DFA B for L(C) ∩ L(D). Run a decider for EDFA on 𝑩 . Accept if it rejects. O.w. reject.’’ 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Theorem. PALDFA is decidable. Formulate the following problem as a language and prove that it is decidable: Given a DFA, determine if it accepts some palindrome. 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Problems in language theory ADFA decidable ACFG decidable EDFA decidable ECFG decidable EQDFA decidable ATM ? ETM ? EQCFG ? EQTM ? 10/31/2019 Sofya Raskhodnikova; based on slides by Nick Hopper