Non-emptiness Testing for TMs

Similar documents
Computation Histories

4.2 The Halting Problem

Computability and Complexity

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

CSE 105 THEORY OF COMPUTATION

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

Lecture 12: Mapping Reductions

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

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

Introduction to Languages and Computation

Undecidable Problems and Reducibility

ACS2: Decidability Decidability

Reducability. Sipser, pages

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

1 Showing Recognizability

problem X reduces to Problem Y solving X would be easy, if we knew how to solve Y

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

CSE 105 THEORY OF COMPUTATION

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

V Honors Theory of Computation

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

CS154, Lecture 10: Rice s Theorem, Oracle Machines

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

CSCE 551 Final Exam, Spring 2004 Answer Key

The Power of One-State Turing Machines

Computational Models Lecture 9, Spring 2009

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 10 Nancy Lynch

CS5371 Theory of Computation. Lecture 15: Computability VI (Post s Problem, Reducibility)

Part I: Definitions and Properties

Lecture Notes: The Halting Problem; Reductions

Decidable Languages - relationship with other classes.

Exam Computability and Complexity

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

UNIT-VIII COMPUTABILITY THEORY

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

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

Reductions in Computability Theory

Decidability (intro.)

Chapter 3: The Church-Turing Thesis

Decidability: Reduction Proofs

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

The Unsolvability of the Halting Problem. Chapter 19

CPSC 421: Tutorial #1

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

CS21 Decidability and Tractability

CpSc 421 Homework 9 Solution

Theory of Computation

CSCC63 Worksheet Turing Machines

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

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

Homework Assignment 6 Answers

Turing Machines Part III

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Introduction to Turing Machines. Reading: Chapters 8 & 9

Computability and Complexity

Limits of Computability

Turing Machines. Lecture 8

DM17. Beregnelighed. Jacob Aae Mikkelsen

Further discussion of Turing machines

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Decidability (What, stuff is unsolvable?)

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

Turing Machines, diagonalization, the halting problem, reducibility

ECS 120 Lesson 20 The Post Correspondence Problem

MTAT Complexity Theory October 13th-14th, Lecture 6

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

CP405 Theory of Computation

Theory of Computation

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

CS6901: review of Theory of Computation and Algorithms

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Theory of Computation

CSE 105 THEORY OF COMPUTATION

CS3719 Theory of Computation and Algorithms

Advanced Undecidability Proofs

Introduction to Turing Machines

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

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

Automata and Computability. Solutions to Exercises

TURING MAHINES

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Computational Models Lecture 8 1

CSE 105 Theory of Computation

Automata and Computability. Solutions to Exercises

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

CSCE 551 Final Exam, April 28, 2016 Answer Key

CS 361 Meeting 26 11/10/17

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

15-251: Great Theoretical Ideas in Computer Science Lecture 7. Turing s Legacy Continues

jflap demo Regular expressions Pumping lemma Turing Machines Sections 12.4 and 12.5 in the text

Transcription:

180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to solve problem A If the halting problem were decidable, then the universal language would also be decidable Reducibility says nothing about solving either of the problems alone; they just have this connection We know from other sources that the universal language is not decidable When problem A is reducible to problem B, solving A cannot be harder than solving B because a solution to B gives one to A If an unsolvable problem is reducible to another problem, the latter also must be unsolvable 181 Non-emptiness Testing for TMs (Observe that the book deals with E TM.) The following decision problem is undecidable: ``Does the given Turing machine accept any inputs?' NE TM = { M M is a Turing machine and L(M) } Theorem (5.2) NE TM is Turing-recognizable, but not decidable Proof. The fact that NE TM is Turing-recognizable will be shown in the exercises. Let us assume that NE TM has a decider M T NE Using it we can construct a total Turing machine for the language U Let M be an arbitrary Turing machine, whose operation on input w is under scrutiny 1

182 Let M w be a Turing machine that replaces its actual input with the string w = a 1 a 2 a k and then works as M Operation of M w does not depend in any way about the actual input. The TM either accepts or rejects all inputs: L( M * 0,1, ) 0 w if if w L( M ) w L( M ) 183 */A, R */a 2, R */, L */a k, R */*, L A/a 1, L M The Turing machine M w 2

184 Let M ENC be a TM, which Inputs the concatenation of the code M for a Turing machine M and a binary string w, M, w, and Leaves to the tape the code M w of the TM M w M, w M w M ENC By combining M ENC and the decider M T NE for the language NE TM we are now able to construct the following Turing machine M U T 185 M, w M w M T NE M ENC A decider M UT for the universal language U 3

186 M UT is total whenever M T NE is, and L(M U T ) = U because M, w L(M UT ) M w L(M T NE ) = NE TM L(M w ) w L(M) M, w U However, by Theorem G U is not decidable, and the existence of the TM M UT is a contradiction Hence, the language NE TM cannot have a total recognizer M T NE and we have, thus, proved that the language NE TM is not decidable. 187 TMs Recognizing Regular Languages Similarly, we can show that recognizing those Turing machines that accept a regular language is undecidable by reducing the decidability of the universal language into this problem The decision problem is: ' Does the given Turing machine accept a regular language?'' REG TM = { M M is a TM and L(M) is a regular language } Theorem 5.3 REG TM is undecidable. Proof. Let us assume that REG TM has a decider M T REG 4

188 Using M T REG we could construct a decider for the universal language U Let M be an arbitrary Turing machine, whose operation on input w we are interested in The language corresponding to balanced pairs of parenthesis { 0 n 1 n n 0 } is not regular, but easy to decide using a TM Let M parenth be a decider for the language Now, let M ENC be a TM, which on input M, w composes an encoding for a TM M w, which on input x First works as M parenth on input x. If M parenth rejects x, M w operates as M on input w. Otherwise M w accepts x 189 x M parenth start w M Deciding a regular language: the TM M w 5

190 Thus, M w either accepts the regular language { 0, 1 }* or nonregular { 0 n 1 n n 0 } Accepting/rejecting the string w on M reduces to the question of the regularity of the language of the TM M w w 0,1 L( M ) * n n 0 1 n 0 if w L( M ) if w L( M ) Let M ENC be a TM, which inputs the concatenation of the code M for a Turing machine M and a binary string w, M, w, and Leaves to the tape the code M w of the TM M w Now by combining M ENC and M T REG would yield the following Turing machine M T U 191 M, w M w M T REG M ENC A decider M UT for the universal language U 6

192 M UT is total whenever M T REG is and L(M U T ) = U, because M, w L(M UT ) M w L(M T REG ) = REG TM L(M w ) is a regular language w L(M) M, w U By Theorem G, U is not decidable, and the existence of the TM M UT is a contradiction Hence, language REG TM cannot have a decider M T REG Thus, we have shown that the language REG TM is not decidable 193 Rice s Theorem Any property that only depends on the language recognized by a TM, not on its syntactic details, is called a semantic property of the Turing machine E.g. ''M accept the empty string'', ''M accepts some string'' (NE), ''M accept infinitely many strings'', ' The language of M is regular (REG) etc. If two Turing machines M 1 and M 2 have L(M 1 ) = L(M 2 ), then they have exactly the same semantic properties 7

194 More abstractly: a semantic property S is any collection of Turingrecognizable languages over the alphabet { 0, 1 } Turing machine M has property S if L(M) S. Trivial properties are S = and S = TR Property S is solvable, if language codes(s) = { M L(M) S } is decidable. Rice s theorem All non-trivial semantic properties of Turing machines are unsolvable 195 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 history for M on w is a sequence of configurations C 1, C 2,, C l, where C 1 is the start configuration q 0 w, C l an accepting configuration of M, and each C i legally follows from C i-1 according to the rules of M Similarly one can define a rejecting computation history Computation histories are finite sequences if M doesn t halt on w, no accepting or rejecting computation history exists for M on w 8

196 Linear Bounded Automata A linear bounded automaton (LBA) is a Turing machine that cannot use extra working space It can only use the space taken up by the input Because the tape alphabet can, in any case, be larger than the input alphabet, it allows the available memory to be increased up to a constant factor Deciders for problems concerning context-free languages If a LBA has q states g symbols in its tape alphabet, and an input of length n, then the number of its possible configurations is q n g n 197 Theorem 5.9 The acceptance problem for linear bounded automata A LBA = { M, w M is an LBA that accepts string w } is decidable. Proof. As M computes on w, it goes from configuration to configuration. If it ever repeats a configuration, it will go on to repeat this configuration over and over again and thus be in a loop. Because an LBA has only q n g n distinct configurations, if the computation of M has not halted in so many steps, it must be in a loop. Thus, to decide A LBA it is enough to simulate M on w for q n g n steps or until it halts. 9

198 Theorem 5.10 The emptiness problem for linear bounded automata E LBA = { M M is an LBA and L(M) = } is undecidable. Proof. Reduction from the universal language (acceptance problem for general TMs). Counter-assumption: E LBA is decidable; i.e., there exists a decider M ET for E LBA. Let M be an arbitrary Turing machine, whose operation on input w is under scrutiny. Let us compose an LBA B that recognizes all accepting computation histories for M on w. 199 Now we can reduce the acceptance problem for general Turing machines to the emptiness testing for LBAs: L( B) L( B) if if w L( M ) w L( M ) The LBA B must accept input string x if it is an accepting computation history for M on w. Let the input be presented as x = C 1 #C 2 ##C l. 10

200 B checks that x satisfies the conditions of an accepting computation history: C 1 = q 0 w, C l is an accepting configuration for M; i.e. accept is the state in C l, and C i-1 M C i : configurations C i-1 and C i are identical except for the position under and adjacent to the head in C i-1, and the changes correspond to the transition function of M. Given M and w it is possible to construct LBA B mechanically. 201 By combining machines B and M ET as shown in the following figure, we obtain a decider for the acceptance problem of general Turing machines (universal language). M, w L(M UT ) B L(M ET ) L(B) w L(M) M, w U This is a contradiction, and the language E LBA cannot be decidable. 11

202 M, w B B M E T A decider M UT for the universal language U 203 5.3 Mapping Reducibility Let M =(Q,,,, q 0, accept, reject) be an arbitrary standard Turing machine Let us define the partial function f M : * * computed by the TM as follows: f M u, ( w) undefined if q 0 * w M u q, q {accept, reject} otherwise Thus, the TM M maps a string w * to the string u, which is the contents of the tape, if the computation halts on w If it does not halt, the value of the function is not defined in w 12

204 Definition 5.20 Partial function f is computable, if it can be computed with a total Turing machine. I.e. if its value f(w) is defined for every w Let us formulate the idea that problem A is at most as difficult as'' problem B as follows Let A *, B * be two formal languages A is mapping reducible to B, written A m B, if there is a computable function f: * * s.t. w A f(w) B w * The function f is called the reduction of A to B 205 Mapping an instance w of A computably into an instance f(w) of B and ' does w have property A?'' ' does f(w) have property B?'' * f A f B * 13

206 Lemma K For all languages A, B, C the following hold i. A m A, (reflexive) ii. if A m B and B m C, then A m C, (transitive) iii. if A m B and B is Turing-recognizable, then so is A, and iv. if A m B and B is decidable, then so is A Proof. i. Let us choose f(x) = x as the reduction. ii. Let f be reduction of A to B and g a reduction of B to C. In other words, f: A m B, g: B m C. We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C. 207 1. his computable: Let M f and M g be the total Turing machines computing f and g. M REW replaces all symbols to the right of the tape head with and moves the tape head to the beginning of the tape. The total machine depicted in the following figure computes function h. 2. his a reduction: x A f(x) B g(f(x)) = h(x) C, hence, h: A m C. iii. (and iv.) Let f: A m B, M B the recognizer of B and M f the TM computing f. The TM depicted below recognizes language A and it is total whenever M B is. 14

208 x f(x)v f(x) g(f(x))v M M f M REW g h(x) The TM computing the composite mapping 209 x f(x) M f M REW M B The TM recognizing A 15

210 We have already used the following consequence of Lemma K to prove undecidability. Corollary 5.23 If A m B and A is undecidable, then B is undecidable. Let us call language B { 0, 1 }* TR-complete, if 1. Bis Turing-recognizable (TR), and 2. A m B for all Turing-recognizable languages A Theorem L The universal language U is TR-complete. Proof. We know that U is Turing-recognizable. Let B be any Turingrecognizable language. Furthermore, let B = L(M B ). Now, B can be reduced to U with the function f(x) = M B, x, which is clearly computable, and for which it holds x B = L(M B ) f(x) = M B, x U. 211 Theorem M Let A be a TR-complete language, B TR, and A m B. Then also B is a TR-complete language. All ' natural'' languages belonging to the difference of TR and decidable languages are TR-complete, but it contains also other languages The class of TR languages is not closed under complementation, thus it has the dual class co-tr = { A TR } TR co-tr = decidable languages (by Theorem C, 4.22) B { 0, 1 }* is co-tr-complete, if B co-tr and A m B for all A co-tr A language A is co-tr-complete, if and only if the language is TR-complete Language TOT = { M M halts on all inputs } does not belong to either TR or co-tr 16

212 TR-complete co-tr-complete U NE TOT TR decidable co-tr 17