Chapter 7 Uncomputability



Similar documents
The Halting Problem is Undecidable

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Computational Models Lecture 8, Spring 2009

Turing Machines: An Introduction

3515ICT Theory of Computation Turing Machines

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Computability Theory

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

CHAPTER 7 GENERAL PROOF SYSTEMS

4.6 The Primitive Recursive Functions

Automata and Computability. Solutions to Exercises

1 Definition of a Turing machine

The Classes P and NP

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

Overview of E0222: Automata and Computability

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Introduction to Turing Machines

24 Uses of Turing Machines

Introduction to Automata Theory. Reading: Chapter 1

Notes on Complexity Theory Last updated: August, Lecture 1

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Hilberts Entscheidungsproblem, the 10th Problem and Turing Machines

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

How To Understand The Theory Of Computer Science

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Lecture summary for Theory of Computation

Hypercomputation: computing more than the Turing machine

GENERIC COMPUTABILITY, TURING DEGREES, AND ASYMPTOTIC DENSITY

Notes on Complexity Theory Last updated: August, Lecture 1

On the Relationship between Classes P and NP

Lecture 2: Universality

How To Know If A Domain Is Unique In An Octempo (Euclidean) Or Not (Ecl)

3. Computational Complexity.

Automata and Formal Languages

Theory of Computation Chapter 2: Turing Machines

Chapter 1. Computation theory

Complexity Classes P and NP

Universal Turing Machine: A Model for all Computational Problems

The Classes P and NP. mohamed@elwakil.net

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN

Models of Sequential Computation

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

CS 301 Course Information

6.080/6.089 GITCS Feb 12, Lecture 3

On the Structure of Turing Universe: The Non-Linear Ordering of Turing Degrees

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

INTRODUCTORY SET THEORY

The P versus NP Solution

A logical approach to dynamic role-based access control

Basics of Polynomial Theory

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Algebraic Computation Models. Algebraic Computation Models

Computability Classes for Enforcement Mechanisms*

Simulation-Based Security with Inexhaustible Interactive Turing Machines

Two-dimensional Languages

About the inverse football pool problem for 9 games 1

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Reading 13 : Finite State Automata and Regular Expressions

Is Sometime Ever Better Than Alway?

Theoretical Computer Science (Bridging Course) Complexity

CAs and Turing Machines. The Basis for Universal Computation

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Continued Fractions and the Euclidean Algorithm

Fast nondeterministic recognition of context-free languages using two queues

Regular Expressions and Automata using Haskell

THE SEARCH FOR NATURAL DEFINABILITY IN THE TURING DEGREES

Turing Machines, Part I

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Notes from February 11

How To Compare A Markov Algorithm To A Turing Machine

Formal Grammars and Languages

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Putnam Notes Polynomials and palindromes

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

Degrees that are not degrees of categoricity

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

NP-Completeness and Cook s Theorem

Quantum and Non-deterministic computers facing NP-completeness

Introduction to Logic in Computer Science: Autumn 2006

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

Math Abstract Algebra I Questions for Section 23: Factoring Polynomials over a Field

The Division Algorithm for Polynomials Handout Monday March 5, 2012

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

C H A P T E R Regular Expressions regular expression

On the Decidability and Complexity of Query Answering over Inconsistent and Incomplete Databases

3. Mathematical Induction

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

Turing Machines and Understanding Computational Complexity

Model 2.4 Faculty member + student

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313]

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

Regular Languages and Finite Automata

Transcription:

Chapter 7 Uncomputability 190

7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction technique. Properties of languages accepted by Turing machines. 191

7.2 Proving undecidability Undecidability classes Correspondence between a problem and the language of the encodings of its positive instances. Definition The decidability class R is the set of languages that can be decided by a Turing machine. The class R is the class of languages (problems) that are decided by a Turing machine, recursive, decidable, computable, algorithmically solvable. 192

Definition The decidability class RE is the set of languages that can be accepted by a Turing machine. The class RE is the class of languages (problems) that are accepted by a Turing machine, partially recursive, partially decidable, partially computable, partially algorithmically solvable, recursively enumerable. Lemma The class R is contained in the class RE (R RE) 193

A first undecidable language A w 0 w 1 w 2... w j... M 0 Y N N... Y... M 1 N N Y... Y... M 2 Y Y N... N........... M i N N Y... N........... A[M i, w j ] = Y (yes) if the Turing machine M i accepts the word w j ; A[M i, w j ] = N (no) if the Turing machine M i does not accept the word w j (loops or rejects the word). is not in the class RE. L 0 = {w w = w i A[M i, w i ] = N}. 194

A second undecidable language Lemma The complement of a language in the class R is also in the class R. Lemma If a language L and its complement L are both in the class RE, then both L and L are in R. Three situations are thus possible: 1. L and L R, 2. L RE and L RE, 3. L RE and L RE R. 195

Lemma The language L 0 = {w w = w i M i accepts w i } is in the class RE. Theorem The language L 0 is undecidable (is not in R), but is in RE. L 0 L 0 RE R 196

The reduction technique 1. One proves that, if there exists an algorithm that decides the language L 2, then there exists an algorithm that decides the language L 1. This is done by providing an algorithm (formally a Turing machine that stops on all inputs) that decides the language L 1, using as a sub-program an algorithm that decides L 2. This type of algorithm is called a reductionfrom L 1 to L 2. Indeed, it reduces the decidability of L 1 to that of L 2. 2. If L 1 is undecidable, one can conclude that L 2 is also undecidable (L 2 R). Indeed, the reduction from L 1 to L 2 establishes that if L 2 was decidable, L 1 would also be decidable, which contradicts the hypothesis that L 1 is an undecidable language. 197

The universal language UL is undecidable. UL = {< M, w > M accepts w} Reduction from L 0 : to check if a word w is in L 0, proceed as follows. 1. Find the value i such that w = w i. 2. Find the Turing machine M i. 3. Apply the decision procedure for UL to the wprd < M i, w i >: if the result is positive, w is accepted, if not it is rejected. Note : UL RE 198

More undecidable problems The halting problem is undecidable. Reduction from UL. H = {< M, w > M stops on w} 1. Apply the algorithm deciding H to < M, w >. 2. If the algorithm deciding H gives the answer no (i.e. the machine M does not stop), answer no (in this case, we have indeed that < M, w > UL). 3. If the algorithm deciding H gives the answer yes, simulate the execution of M on w and give the answer that is obtained (in this case, the execution of M on w terminates and one always obtains an answer). 199

The problem of determining if a program written in a commonly used programming language (for example C or, Java) stops for given input values is undecidable. This is proved by reduction from the halting problem for Turing machines. 1. Build a C program P that, given a Turing machine M and a word w, simulates the behaviour of M on w. 2. Decide if the program P stops for the input < M, w > and use the result as answer. 200

The problem of deciding if a Turing machine stops when its input word is the empty word (the empty-word halting problem) is undecidable. This is proved by reduction from the halting problem. 1. For an instance < M, w > of the halting problem, one builds a Turing machine M that has the following behaviour: it writes the word w on its input tape; it then behaves exactly as M. 2. One solves the empty-word halting problem for M and uses the result as answer. 201

The problem of deciding if a Turing machine stops for at least one input word (the existential halting problem) is undecidable. One proceeds by reduction from the empty-word halting problem. 1. For an instance M of the empty-word halting problem, one builds a Turing machine M that behaves as follows: it erases the content of its input tape; it then behaves as M. 2. One solve the existential halting problem for M and uses the result as answer. 202

The problem of deciding if a Turing machine stops for every input word (the universal halting problem) is undecidable. The reduction proceeds from the empty-word halting problem and is identical to the one used for the existential halting problem. The only difference is that one solves the universal halting problem for M, rather than the existential halting problem. 203

Determining if the language accepted by a Turing machine is empty (empty accepted language) is undecidable. Reduction from UL. 1. For an instance < M, w > of UL, one builds a Turing machine M that simulates the execution of M on w ignoring its own input word; if M accepts w, it accepts is input word, whatever it is. if M does not accept w (rejects or has an infinite execution) it does not accept any word. 2. One solves the empty accepted language problem for M and uses the result as answer. 204

This reduction is correct given that L(M ) = exactly when M does not accept w, i.e., when < M, w > UL ; L(M ) = Σ exactly when M accepts w, i.e. when < M, w > UL. 205

Determining if the language accepted by a Turing machine is recursive (recursive accepted language) is undecidable. Reduction from UL. 1. For an instance < M, w > of UL, one builds a Turing machine M that simulates the execution of M on w ignoring its own input word; if M accepts w, it behaves on its own input word as a universal turing machine. if M does not accept w (rejects or has an infinite execution) it does not accept any word. 2. One solves the recursive accepted language problem for M and uses the result as answer. 206

This reduction is correct since L(M ) = and is recursive exactly when M does not accept w, i. e. when < M, w > UL ; L(M ) = UL and is not recursive exactly when M accepts w, i.e. when < M, w > UL. 207

Determining if the language accepted by a Turing machine is not recursive (undecidable) (undecidable accepted language) is undecidable. Reduction from UL. 1. For an instance < M, w > of UL, one builds a Turing machine M that simulates the execution of M on w, without looking at its own input word x; simultaneously (i.e. interleaving the executions), the machine M simulates the universal Turing machine on its own input word x; As soon as one of the executions accepts, (i.e., if M accepts w or if the input word is in UL), M accepts. 208

2. If neither of the two executions accepts (i.e., if M does not accept w, or if the input word x UL), M does not accept. 3. One solves the undecidable accepted language problem for M and uses the result as answer. 209

This reduction is correct since L(M ) = UL and is undecidable exactly when M does not accept w, i.e., when < M, w > UL ; L(M ) = Σ and is decidable exactly when M accepts w, i.e. when < M, w > UL. 210

In the preceding reductions, the language accepted by the machine M is either UL, or, or Σ. These proofs can thus also be used to establish that the problem of determining if the language accepted by a Turing machine is regular (or non regular) is undecidable. Indeed, and Σ are regular languages, whereas UL is not a regular language. 211

7.4 Properties of recursively enumerable languages The recursively enumerable languages are : The languages computed by a Turing machine, the languages generated by a grammar, The languages that can be enumerated by an effective procedure (which explains why they are called recursively enumerable ). 212

The languages computed by a Turing machine Definition Let M be a Turing machine.if M stops on an input word u, let f M (u) be the word computed by M for u. The language computed by M is then the set of words {w u such that M stops for u and w = f M (u)}. Theorem A language is computed by a Turing machine if and only if it is recursively enumerable (accepted by a Turing machine). 213

Let L be a language accepted by a Turing machine M. The Turing machine M described below computes this language. 1. The machine M first memorises its input word (one can assume that it uses a second tape for doing this). 2. Thereafter, it behaves exactly as M. 3. If M accepts, M copies the memorised input word onto its tape. 4. If M does not accept, M keeps running forever. 214

Let L be a language computed by a Turing machine M. The nondeterministic Turing machine described below accepts this language. 1. The machine M first memorises its input word w. 2. Thereafter, it generates nondeterministically a word u. 3. The machine M then simulates the behaviour of M on u. 4. If M stops on u, M compares w to f M (u) and accepts w if w = f M (u). 5. If M does not stop on u, M does not accept w. 215

The languages generated by a grammar Theprem A language is generated by a grammar if and only if it is recursively enumerable. Let G = (V, Σ, R, S), The Turing machine M described below accepts the language generated by G. 1. The machine M starts by memorising its input word (we can assume it uses a second tape to do so). 2. Then, it erases its tape and writes on it the start symbol S of the grammar. 216

3. The following cycle is then repeated : (a) nondeterministically, the machine chooses a rule R and a string appearing on its tape; (b) if the selected string is identical to the left-hand side of the rule, it is replaced by the right-hand side; (c) the content of the tape is compared to the memorised input word, and if they are identical the machine accepts; if not it carries on with its execution. 217

Let M = (Q, Γ, Σ, δ, s, B, F ) be a Turing machine. One builds a grammar G 0 = (V G0, Σ G0, R G0, S G0 ) such that S G0 w with w (Q Γ) if and only if w describes a configuration (q, α 1, α 2 ) of M written as α 1 qα 2. The grammar G 0 is defined by V G0 = Q Γ {S G0, A 1, A 2 }, Σ G0 = Σ, R G0 is the set of rules below. 218

1. Initial configuration of M : S G0 sa 1 A 1 aa 1 a Σ A 1 A 2 A 2 BA 2 A 2 ε. 2. Transitions. For all p, q Q and X, Y Γ such that we include the rule δ(q, X) = (p, Y, R) qx Y p. Similarly, for all p, q Q and X, Y, Z Γ such that we include the rule δ(q, X) = (p, Y, L) ZqX pzy. 219

Problem: the input word is lost. Solution: simulate a Turing machine with two tapes. G 1 = (V G1, Σ G1, R G1, S G1 ) where V G1 = Σ Q ((Σ {e}) Γ) {S G1, A 1, A 2 } (we represent an element of ((Σ {e}) Γ) by a pair [a, X]), Σ G1 = Σ, R G1 is the set of rules described below. 220

1. Initial configuration of M : S G1 sa 1 A 1 [a, a]a 1 a Σ A 1 A 2 A 2 [e, B]A 2 A 2 ε. 2. Transitions. For all p, q Q, X, Y Γ and a Σ {e} such that we include the rule δ(q, X) = (p, Y, R) q[a, X] [a, Y ]p. Similarly, for all p, q Q, X, Y, Z Γ and a, b Σ {e} such that we include the rule δ(q, X) = (p, Y, L) [b, Z]q[a, X] p[b, Z][a, Y ]. 221

3. For all q F, X Γ and a Σ {e}, we include the rules if a e and q[a, X] qaq [a, X]q qaq q[a, X] q [a, X]q q if a = e. These rules propagate a copy of q next to each nonterminal [a, X] and extract its first component. Finally, we add q ε that allows the copies of the state q to be removed. 222

The languages enumerated by an effective procedure Turing machine that enumerates the words accepted by M. Generate all words in lexicographical and increasing length order, simulate M on each newly generated word and keep this word only if it is accepted by M. Incorrect: the Turing machine can have infinite executions. Solution: other enumeration order. 223

w \ n 1 2 3 4 w 1 (w 1, 1) (w 1, 2) (w 1, 3) (w 1, 4) w 2 (w 2, 1) (w 2, 2) (w 2, 3) w 3 (w 3, 1) (w 3, 2) (w 3, 3) w 4 (w 4, 1) One considers the pairs (w, n) in the order of their enumeration. For each of these pairs, one simulates the execution of M on w, but limits the execution to n steps. On produces the word w if this execution accepts w. On then moves to the next pair (w, n). 224

7.5 Other undecidable problems The problem of determining if a word w is in the language generated by a grammar G is undecidable. Reduction from the problem UL. Let < M, w > be an instance of the problem UL. It can be solved as follows: 1. one builds the grammar G generating the language accepted by M 2. one determines if w L(G) and uses the result as answer. 225

The problem of deciding if two grammars G 1 and G 2 generate the same language is undecidable. Reduction from the membership problem for the language generated by a grammar. An instance < w, G > of this problem can be solved as follows: 1. Let G = (V, Σ, R, S). One builds the grammars G 1 = G and G 2 = (V, Σ, R, S ), with R = R {S S, S w}. 2. One checks if L(G 1 ) = L(G 2 ) and uses the result as answer. One has indeed that L(G 2 ) = L(G 1 ) {w} and thus that L(G 2 ) = L(G 1 ) if and only if w L(G). 226

The problem of determining validity in the predicate calculus undecidable is The problem of determining the universality of a context-free language, i.e., the problem of determining if for a context-free grammar G one has L(G) = Σ is undecidable. 227

The problem of determining the emptiness of the intersection of context-free languages is undecidable. The problem is to determine if, for two context-free grammars G 1 and G 2, one has L(G 1 ) L(G 2 ) =. Hilbert s tenth problem is undecidable. This problem is to determine if an equation p(x 1,..., x n ) = 0 where p(x 1,..., x n ) is an integer coefficient polynomial, has an integer solution. 228

Noncomputable functions A total function f : Σ 1 Σ 2 is computable if and only if the following questions are decidable. 1. Given n N and w Σ 1, do we have that f(w) > n? 2. Given k N, w Σ 1 and a Σ 2, do we have that f(w) k = a? (is the k th letter of f(w) a?). 229

The situation is similar in the case of a partial function. A function f : Σ 1 Σ 2 is a partially computable function if and only if the following conditions are satisfied. 1. Checking if for a given word w, f(w) is defined is partially decidable. 2. For n N and w Σ 1 is decidable. such that f(w) is defined, checking if f(w) > n 3. For k N, a Σ 2 and w Σ 1 f(w) k = a is decidable. such that f(w) is defined, checking if 230