CSE 105 theory of computation

Slides:



Advertisements
Similar presentations
Lecture 24 MAS 714 Hartmut Klauck
Advertisements

1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Reducibility Sipser 5.1 (pages ). CS 311 Fall Reducibility.
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)
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
CSCI 2670 Introduction to Theory of Computing October 12, 2005.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSC312 Automata Theory Nonregular Languages Chapter # 10 by Cohen
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability 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.
CSE 105 theory of computation
CSE 105 theory of computation
Lexical analysis Finite Automata
CSE 105 theory of computation
CSE 105 theory of computation
PDAs Accept Context-Free Languages
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
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
CSE 105 theory of computation
Intro to Theory of Computation
CSE 105 theory of computation
4. Properties of Regular Languages
CSE 105 theory of computation
CSC 4170 Theory of Computation Decidable languages Section 4.1.
Deterministic PDAs - DPDAs
4b Lexical analysis Finite Automata
Closure Properties of Context-Free languages
Decidable and undecidable languages
CSCI 2670 Introduction to Theory of Computing
Chapter 4 Properties of Regular Languages
4b Lexical analysis Finite Automata
Instructor: Aaron Roth
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
Chapter 1 Regular Language
Instructor: Aaron Roth
Theory of Computability
Instructor: Aaron Roth
Instructor: Aaron Roth
CSE 105 theory of computation
CSE 105 theory of computation
Automata, Grammars and Languages
CSE 105 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
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

CSE 105 theory of computation Spring 2019 https://cseweb.ucsd.edu/classes/sp19/cse105-a/

Today's learning goals Sipser Ch 4.1 Explain what it means for a problem to be decidable. Justify the use of encoding. Give examples of decidable problems. Use counting arguments to prove the existence of unrecognizable (undecidable) languages.

At start of CSE 105… Pick a model of computation Classification: is input of type A or not? Decision problem { w | w is of type A} PRIME = { 2, 3, 5, 7, … } SORTED = { <1,3>, <-1, 8, 17> …} Decision problems are coded by sets of strings Pick a model of computation Study what problems it can solve Prove its limits

Encoding input for TMs Sipser p. 159 By definition, TM inputs are strings To define TM M: "On input w … .. … For inputs that aren't strings, we have to encode the object (represent it as a string) first Notation: <O> is the string that represents (encodes) the object O <O1, …, On> is the single string that represents the tuple of objects O1, …, On

Encoding inputs Payoff: problems we care about can be reframed as languages of strings e.g. "Recognize whether a string is a palindrome." { w | w in {0,1}* and w = wR } e.g. "Check whether a string is accepted by a DFA." { <B,w> | B is a DFA over Σ, w in Σ*, and w is in L(B) } e.g. "Check whether the language of a PDA is infinite." { <A> | A is a PDA and L(A) is infinite}

Encoding inputs Payoff: problems we care about can be reframed as languages of strings e.g. "Recognize whether a string is a palindrome." { w | w in {0,1}* and w = wR } This set is regular and decidable. This set is regular and not decidable This set is nonregular and decidable This set is nonregular and not decidable. None of the above

Computational problems A computational problem is decidable iff the language encoding the problem instances is decidable

Computational problems Sample computational problems and their encodings: ADFA "Check whether a string is accepted by a DFA." { <B,w> | B is a DFA over Σ, w in Σ*, and w is in L(B) } EDFA "Check whether the language of a DFA is empty." { <A> | A is a DFA over Σ, L(A) is empty } EQDFA "Check whether the languages of two DFA are equal." { <A, B> | A and B are DFA over Σ, L(A) = L(B)} ..

Computational problems Sample computational problems and their encodings: ADFA "Check whether a string is accepted by a DFA." { <B,w> | B is a DFA over Σ, w in Σ*, and w is in L(B) } EDFA "Check whether the language of a DFA is empty." { <A> | A is a DFA over Σ, L(A) is empty } EQDFA "Check whether the languages of two DFA are equal." { <A, B> | A and B are DFA over Σ, L(A) = L(B)} FACT: all of these problems are decidable!

Proving decidability Claim: ADFA is decidable Proof: WTS that { <B,w> | B is a DFA over Σ, w in Σ*, and w is in L(B) } is decidable. Step 1: construction How would you check if w is in L(B)?

Proving decidability A B <A, 1> is not in ADFA <B, 1> is not in ADFA <B, 01> is not in ADFA More than one of the above

Proving decidability Define TM M1 by: M1 = "On input <B,w> Check whether input is a valid encoding of a DFA and input string for that DFA. If not, reject. Simulate running B on w (by keeping track of states in B, transition function of B, etc.) When the simulation ends, by finishing to process all of w, check current state of B: if it is final, accept; if it is not, reject."

Proving decidability Step 1: construction Define TM M1 by M1 = "On input <B,w> Check input is a valid encoding of a DFA and input string for that DFA. If not, reject. Simulate running B on w (by keeping track of states in B, transition function of B, etc.) When the simulation ends, by finishing to process all of w, check current state of B: if it is final, accept; if it is not, reject." Step 2: correctness proof WTS (1) L(M1) = ADFA and (2) M1 is a decider.

Proving decidability Claim: EDFA is decidable Proof: WTS that { <A> | A is a DFA over Σ, L(A) is empty } is decidable.

Proving decidability Claim: EDFA is decidable Proof: WTS that { <A> | A is a DFA over Σ, L(A) is empty } is decidable. e.g.< > is in EDFA ; < > is not in EDFA TM deciding EDFA should accept and should reject

Proving decidability Claim: EDFA is decidable Proof: WTS that { <A> | A is a DFA over Σ, L(A) is empty } is decidable. Idea: give high-level description Step 1: construction What condition distinguishes between DFA that accept *some* string and those that don't accept *any*?

Proving decidability Claim: EDFA is decidable Proof: WTS that { <A> | A is a DFA over Σ, L(A) is empty } is decidable. Idea: give high-level description Step 1: construction What condition distinguishes between DFA that accept *some* string and those that don't accept *any*? Breadth first search in transition diagram to look for path from start state to an accepting state

Proving decidability Claim: EDFA is decidable Proof: WTS that { <A> | A is a DFA over Σ, L(A) is empty } is decidable. Idea: give high-level description Step 1: construction Define TM M2 by: M2 = "On input <A>: Check whether input is a valid encoding of a DFA; if not, reject. Mark the start state of A. Repeat until no new states get marked: Loop over states of A and mark any unmarked state that has an incoming edge from a marked state. If no final state of A is marked, accept; otherwise, reject.

Proving decidability Step 1: construction Define TM M2 by: M2 = "On input <A>: Check whether input is a valid encoding of a DFA; if not, reject. Mark the state state of A. Repeat until no new states get marked: Loop over states of A and mark any unmarked state that has an incoming edge from a marked state. If no final state of A is marked, accept; otherwise, reject. Step 2: correctness proof WTS (1) L(M2) = EDFA and (2) M2 is a decider.

Proving decidability Will we be able to simulate A and B? Claim: EQDFA is decidable Proof: WTS that { <A, B> | A, B are DFA over Σ, L(A) = L(B) } is decidable. Idea: give high-level description Step 1: construction Will we be able to simulate A and B? What does set equality mean? Can we use our previous work?

Proving decidability Will we be able to simulate A and B? Claim: EQDFA is decidable Proof: WTS that { <A, B> | A, B are DFA over Σ, L(A) = L(B) } is decidable. Idea: give high-level description Step 1: construction Will we be able to simulate A and B? What does set equality mean? Can we use our previous work?

Proving decidability Very high-level: Claim: EQDFA is decidable Proof: WTS that { <A, B> | A, B are DFA over Σ, L(A) = L(B) } is decidable. Idea: give high-level description Step 1: construction Very high-level: Build new DFA recognizing symmetric difference of L(A), L(B). Check if this set is empty.

Proving decidability Claim: EQDFA is decidable Proof: WTS that { <A, B> | A, B are DFA over Σ, L(A) = L(B) } is decidable. Idea: give high-level description Step 1: construction Define TM M3 by: M3 = "On input <A,B>: Check whether input is valid encoding of pair of DFAs; if not, reject. Construct a new DFA, D, from A,B using algorithms for complementing, taking unions of regular languages such that L(D) = symmetric difference of L(A) and L(B). Run machine M2 on <D>. If it accepts, accept; if it rejects, reject."

Proving decidability Step 1: construction Define TM M3 by: M3 = "On input <A,B>: Check whether input is valid encoding of pair of DFAs; if not, reject. Construct a new DFA, D, from A,B using algorithms for complementing, taking unions of regular languages such that L(D) = symmetric difference of L(A) and L(B). Run machine M2 on <D>. If it accepts, accept; if it rejects, reject." Step 2: correctness proof WTS (1) L(M3) = EQDFA and (2) M3 is a decider.

Techniques Sipser 4.1 Subroutines: can use decision procedures of decidable problems as subroutines in other algorithms ADFA EDFA EQDFA Constructions: can use algorithms for constructions as subroutines in other algorithms Converting DFA to DFA recognizing complement (or Kleene star). Converting two DFA/NFA to one recognizing union (or intersection, concatenation). Converting NFA to equivalent DFA. Converting regular expression to equivalent NFA. Converting DFA to equivalent regular expression.

Undecidable? There are many ways to prove that a problem is decidable. How do we find (and prove) that a problem is not decidable?