Decidability 2017/10/31 Chapter 4.1 in Sipser Ø Announcement: q q q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/decidability.pdf Happy Hollaween! Delayed grading for o HW4 group part o Project #1 1
Performance analysis Overall average: 78.5% out of a total of 26.5 graded Midterm 1 average: 59.3% HW average: 86.2% Quiz average: 96.0% 78.5% x 108 = 84.8 2
Performance analysis 28 13 15 6 6 2 2 > 61 > 71 > 81 > 92 > 102 3
Last chapter The church-turing thesis o o Turing machines q Definition of TM q Computation of TM q Design of TM Variants of TMs o Multitape TM o Nondeterminstic TM o Enumerators FA (DFA & NFA) express Regular Expressions (RE) CFL Recursively enumerable 4
Theory of computation Automata Theory abstract machines Computation Computability Theory fundamental capabilities and limitations of abstract machines Complexity Theory why certain problems are harder than others 5
What are algorithms? Ø A process that can be determined in finite number of operations. Why finite? Alonzo Church s lambda-calculus Alan Turing s machines (Turing machine) lambda-calculus M decider Accept Reject 6
What are algorithms? Ø A process that can be determined in finite number of operations. Why finite? Alonzo Church s lambda-calculus Alan Turing s machines (Turing machine) lambda-calculus These two representations are equivalent! M decider Accept Reject 7
Theory of computation decider Automata Theory abstract machines Computation Computability Theory fundamental capabilities and limitations of abstract machines Complexity Theory why certain problems are harder than others 8
Theory of computation decider Automata Theory Hilbert s tenth problem Computation abstract machines Computability Theory fundamental capabilities and limitations of abstract machines Complexity Theory why certain problems are harder than others 9
Why do we care? decider D1 Hilbert s tenth problem D Computation Ø Identify problems that are too hard o change the problem Ø Understand limitations of computers 10
Outline for today Decidability o o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs Context-free languages q Acceptance of CFG q Test emptiness of CFG Ø Goals: o Learn about several solvable problems about RLs 11
Acceptance of DFA Does a DFA accept a given string (the acceptance problem)? problem is solvable algorithmically == the corresponding language is decidable M Accept Reject 12
Acceptance of DFA Does a DFA accept a given string (the acceptance problem)? 13
Acceptance of DFA Does a DFA accept a given string (the acceptance problem)? Implementation level? M Accept Reject (Q,,,q0,F) 14
Acceptance of DFA Does a DFA accept a given string (the acceptance problem)? Encoding of B is (Q,,,q0,F) Check whether input string is a valid finite automaton Simulate B on w TM keeps track of the current state of B and current position on w. Updates are done through δ When having processed the last input symbol, check whether the state is accepting. 15
Outline for today Decidability o o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs Context-free languages q Acceptance of CFG q Test emptiness of CFG Ø Goals: o Learn about several solvable problems about RLs 16
Acceptance of NFA Does a NFA accept a given string? M on input <B, w>: Simulate B nondeterminstically using NTM If the simulation accepts, accept; else, reject. Incorrect since the machine may not stop 17
Acceptance of NFA Does a NFA accept a given string? 18
Acceptance of NFA Does a NFA accept a given string? <B, w> <C, w> Convert NFA to DFA M N Accept Reject Converting NFA to DFA must be done in finite steps always! 19
Outline for today Decidability o o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs Context-free languages q Acceptance of CFG q Test emptiness of CFG Ø Goals: o Learn about several solvable problems about RLs 20
Generation of RE Does an RE generate a string w? M on input <R, w>: 1. Try a possible instantiation of the regular operations so that the strings are in shortlex order (how do we do this?) 2. Compare with w. If match, accept; else, continue to 1. 3. If the length of string generated is longer than w, reject Works but clumsy 21
Generation of RE Does an RE generate a string w? M on input <B, w>: Simulate B nondeterminstically If the simulation accepts, accept; else, reject. 22
Outline for today Decidability next class: o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs o Context-free languages q Acceptance of CFG q Test emptiness of CFG Reading assignment for the o Sipser Sec. 4.1 - Quiz link will be sent out; due date is before the beginning of the next class Ø Goals: o Learn about several solvable problems about RLs 23
Last time Decidability o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs o Context-free languages q Acceptance of CFG q Test emptiness of CFG lambda-calculus M decider solvability == decider Accept Reject Ø Goals: o Learn about several solvable problems about RLs 24
Outline for today Decidability o o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs Context-free languages q Acceptance of CFG q Test emptiness of CFG Ø Goals: o Learn about several solvable problems 25
Test emptiness of RL Is the language of a DFA empty? M on input <A>: For each w in Σ* in shorlex order: Simulate A with w as the input If the simulation accepts, reject Accept Incorrect since the machine would not stop 26
Test emptiness of RL Is the language of a DFA empty? M on input <A>: For each w order in shorlex order: Simulate A with w in If the simulation accepts, reject Accept. 27
Outline for today Decidability o o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs Context-free languages q Acceptance of CFG q Test emptiness of CFG Ø Goals: o Learn about several solvable problems 28
Test equivalence of RLs Are the languages of DFA A and B the same? M on input <A, B>: Keep track of the current states of A and B For each state in the possible current states for A (unchecked), collect all possible next states from the state If there is no a matched state (unchecked) in B s current states (based on its transition structure), reject; otherwise, mark the state in A and the matched state in B as checked and continue Accept if no more states can be checked Incorrect since A and B can have different structures! 29
Test equivalence of RLs Are the languages of DFA A and B the same? L(A) = L(B) if and only if L(C) is empty 30
Test equivalence of RLs Are the languages of DFA A and B the same? 31
Outline for today Decidability o o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs Context-free languages q Acceptance of CFG q Test emptiness of CFG Ø Goals: o Learn about several solvable problems 32
Acceptance of CFG Can a string w be generated by a CFG? How to contruct a Turing machine to decide A CFG? 33
Acceptance of CFG Can a string w be generated by a CFG? What about A PDA? 34
Acceptance of CFG Can a string w be generated by a CFG? What about A PDA? 35
Outline for today Decidability o o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs Context-free languages q Acceptance of CFG q Test emptiness of CFG Ø Goals: o Learn about several solvable problems 36
Acceptance of CFG Is the language generated by a CFG empty? How to construct a Turing machine for E CFG 37
Acceptance of CFG Is the language generated by a CFG empty? What about EQ CFG? 38
Put RL and CFL in scope 39
Undecidability 2017/11/2 Chapter 4.2 in Sipser 40
Undecidability decider Computation Computation Hilbert s tenth problem Recognizable but undecidable languages 41
Undecidability decider Computation Computation Hilbert s tenth problem Unrecognizable languages? 42
Undecidability decider Computation Computation Hilbert s tenth problem Unrecognizable languages? complement of D 43
Undecidability Ø A language is co-turing-recognizable if it is the complement of a Turing-recognizable language. Computation Hilbert s tenth problem Unrecognizable languages? complement of D 44
Non Turing-recognizable Claim: There are an infinite number of languages that are not Turing recognizable 45
Countably infinite {1, 2, 3, } and {2, 4, 6, }, which one has a bigger size? one-to-one onto 46
Diagonalization {1, 2, 3, } and {2, 4, 6, }, which one has a bigger size? Rational numbers is also countable (countably infinite) m/n 47
Diagonalization {1, 2, 3, } and {2, 4, 6, }, which one has a bigger size? Rational numbers is also countable (countably infinite) m/n Is every infinite set countable? 48
Uncountable Ø If such a mapping exists, For any x in R, there must exist a n such that f(n) = x 49
Uncountable Ø If such a mapping exists, For any x in R, there must exist a n such that f(n) = x 50
Uncountable Ø If such a mapping exists, For any x in R, there must exist a n such that f(n) = x x!= f(n) for all n 51
Uncountable Ø If such a mapping exists, For any x in R, there must exist a n such that f(n) = x x!= f(n) for all n why doesn t this work for rational numbers? 52
Non Turing-recognizable Claim: There are an infinite number of languages that are not Turing recognizable Ø Σ * is countable so is the number of Turing machines! Ø The set (power set) of languages for Σ * is uncountable Claim: There are an infinite number of languages that are not Turing recognizable In fact, it is uncountable! why? 53
Non Turing-recognizable Claim: There are an infinite number of languages that are not Turing recognizable Ø Σ * is countable so is the number of Turing machines! Ø The set (power set) of languages for Σ * is uncountable Claim: There are an infinite number of languages that are not Turing recognizable In fact, it is uncountable! why? Ø Way more problems cannot be solved (or even recognized) by TMs than those that can! 54
Undecidable languages Let us now return to reality Hilbert s tenth problem any other problems? Ø Finding them can help us determine other problems 55
Undecidable languages? 56
Undecidable languages is undecidable! <M> D <M, w> H w M Accept Accept Reject Reject Loop Reject Accept 57
Undecidable languages is undecidable! <M> D <M, <M>> H <M> M Accept Accept Reject Reject Loop Reject Accept 58
Undecidable languages is undecidable! <D> D <D, <D>> H <D> D Accept Accept Reject Reject Loop Reject Accept 59
Undecidable languages is undecidable! <D> D <D, <D>> H <D> D Accept Accept Reject Reject Loop Reject Accept Notice any issues? Check out the recursion theorem 6.1 60
Undecidable languages M on w where w = <Mi> H on <Mi, w> where w = <Mj> D on <M> 61
Outline for today Decidability next class: o Regular languages q Acceptance of DFA q Acceptance of NFA q Generation of RE q Test emptiness of RL q Test equivalence of DFAs o Context-free languages q Acceptance of CFG q Test emptiness of CFG Undecidability Ø Goals: o Learn about several solvable problems Reading assignment for the o Learn about undecidability and non turing recognizable languages o Sipser Sec. 6.1 - Quiz link will be sent out; due date is before the beginning of the next class o Second (and last project) based on this o HW6 62