Decidability of Languages That Do Not Ask Questions about Turing Machines Chapter 22.

Slides:



Advertisements
Similar presentations
Context-Free and Noncontext-Free Languages
Advertisements

Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
Turing -Recognizable vs. -Decidable
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Pushdown Automata Part II: PDAs and CFG Chapter 12.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Decidable A problem P is decidable if it can be solved by a Turing machine T that always halt. (We say that P has an effective algorithm.) Note that the.
February 6, 2015CS21 Lecture 141 CS21 Decidability and Tractability Lecture 14 February 6, 2015.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Introduction to Computability Theory
Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.
Theory of Computation What types of things are computable? How can we demonstrate what things are computable?
Costas Busch - RPI1 Undecidable problems for Recursively enumerable languages continued…
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
CHAPTER 4 Decidability Contents Decidable Languages
Homework #9 Solutions.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Universal Turing Machine
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
MA/CSSE 474 Theory of Computation The Halting Problem.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
TM Design Universal TM MA/CSSE 474 Theory of Computation.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
A Universal Turing Machine
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
Great Theoretical Ideas in Computer Science.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Context-Free and Noncontext-Free Languages Chapter 13.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Turing -Recognizable vs. -Decidable
Fundamentals of Informatics Lecture 13 Reduction Bas Luttik.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Chapter 8 Properties of Context-free Languages These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata,
Decidability and Undecidability Proofs Sections 21.1 – 21.3.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Unrestricted Grammars
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 5 Reducibility Some slides are in courtesy.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
Universal Turing Machine
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Decidability and Undecidability Proofs
LIMITS OF ALGORITHMIC COMPUTATION
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Turing -Recognizable vs. -Decidable
Turing Machines Everything is an Integer
MA/CSSE 474 Theory of Computation
Presentation transcript:

Decidability of Languages That Do Not Ask Questions about Turing Machines Chapter 22

Undecidable Languages That Do Not Ask Questions About TMs ● Diophantine Equations, Hilbert’s 10th Problem ● Post Correspondence Problem ● Tiling problems ● Logical theories ● Context-free languages

Hilbert’s 10th Problem A Diophantine system is a system of Diophantine equations such as: 4x 3 + 7xy + 2z 2 – 23x 4 z = 0 The problem: given a Diophantine system, does it have an integer solution? Or, let Tenth = { : w is a Diophantine system with an integer solution}. Is Tenth in D? No. Proved in 1970 by Yuri Matiyasevich.

Restricted Diophantine Problems Suppose all exponents are 1: A farmer buys 100 animals for $ The animals include at least one cow, one pig, and one chicken, but no other kind. If a cow costs $10.00, a pig costs $3.00, and a chicken costs $0.50, how many of each did he buy? ● Diophantine problems of degree 1 and Diophantine problems of a single variable of the form ax k = c are efficiently solvable. ● The quadratic Diophantine problem is NP-complete. ● The general Diophantine problem is undecidable, so not even an inefficient algorithm for it exists.

Consider two equal length, finite lists, X and Y, of strings over some alphabet  : X = x 1, x 2, x 3, …, x n Y = y 1, y 2, y 3, …, y n Does there exist some finite sequence of integers that can be viewed as indexes of X and Y such that, when elements of A are selected as specified and concatenated together, we get the same string that we get when elements of Y are also concatenated together as specified? For example, if we assert that 1, 3, 4 is such a sequence, we’re asserting that x 1 x 3 x 4 = y 1 y 3 y 4. Post Correspondence Problem

A PCP Instance With a Simple Solution iXY 1 baab 2 abbb 3 abaa 4 baaababa

A PCP Instance With a Simple Solution iXY 1 baab 2 abbb 3 abaa 4 baaababa Solution: 3, 4, 1

Another PCP Instance iXY

A PCP Instance With No Simple Solution iXY

A PCP Instance With No Simple Solution iXY Shortest solution has length 252.

The Language PCP = (x 1, x 2, x 3, …, x n )(y 1, y 2, y 3, …, y n ) The problem of determining whether a particular instance P of the Post Correspondence Problem has a solution can be recast as the problem of deciding the language: PCP = { : P has a solution} The language PCP is in SD/D.

A Tiling Problem Given a finite set T of tiles of the form: Is it possible to tile an arbitrary surface in the plane?

A Set of TilesThat Cannot Tile the Plane

Is the Tiling Language in D? We can represent any set of tiles as a string. For example, we could represent as = ( G W W W ) ( W W B G ) ( B G G W ). Let TILES = {w : w is a syntactically legal set of tiles and the set of tiles that w represents can tile any finite area in the plane} Wang’s conjecture: If a given set of tiles can be used to tile an arbitrary surface, then it can always do so periodically. In other words, there must exist a finite area that can be tiled and then repeated infinitely often to cover any desired surface. But Wang’s conjecture is false.

Is the Tiling Language in D? Theorem:  TILES is in SD. Proof: Lexicographically enumerate partial solutions.

Theorem: TILES is not in D or SD. Proof: If TILES were in SD, then, it would be in D. But we show that it is not by reduction from  H . We map an arbitrary Turing machine M into a set of tiles T: ● Each row of tiles corresponds to a configuration of M. ● The first row corresponds to M’s initial configuration when started on a blank tape. ● The next row corresponds to M’s next configuration, and so forth. ● There is always a next configuration of M and thus a next row in the tiling iff M does not halt. ● T is in TILES iff there is always a next row. ● So if it were possible to semidecide whether T is in TILES it would be possible to semidecide whether M fails to halt on . But  H  is not in SD. So neither is TILES. The Undecidability of the Tiling Language

The Entscheidungsproblem, Again Does there exist an algorithm to determine, given a statement in a logical language, whether or not it is a theorem? Suppose the answer, for a sufficiently powerful logical language, is yes. Then we could: ● Decide whether other programs are correct. ● Determine whether a plan for controlling a manufacturing robot is correct. ● Find an interpretation that makes sense for a complex English sentence.

Boolean Logic All of the following languages are in D: ● VALID = {w : w is a wff in Boolean logic and w is valid}. ● SAT = {w : w is a wff in Boolean logic and w is satisfiable}. ● PROVABLE = { : w is a wff in Boolean logic, A is a set of axioms in Boolean logic and w is provable from A}.

FOL theorem = { : A is a decidable set of axioms in first-order logic, w is a sentence in first-order logic, and w is entailed by A}. Example:  x (bear(x)  mammal(x)) bear(Smoky) ?mammal(Smoky) First-Order Logic

FOL theorem is semidecidable: proveFOL(A, w) = 1. Lexicographically enumerate sound proofs. 2. Check each proof as it is created. If it succeeds in proving w, halt and accept. By Gödel’s Completeness Theorem, we know that there exists a complete set of inference rules for first order logic. So step 1 of proveFOL can be correctly implemented. First-Order Logic

If T is complete then, for any sentence w, either w or  w is a theorem. So the set of theorems is decidable by: decidecompletetheory(A: set of axioms, w: sentence) = 1. In parallel, use proveFOL to try to prove w and  w. 2. One of the proof attempts will eventually succeed. If the attempt to prove w succeeded, then return True. If the attempt to prove  w succeeded, then return False. But we must also consider the case in which T is not complete. Now it is possible that neither w nor  w is a theorem. Complete Theories are Decidable

We reduce H  = { : M halts on  } to FOL theorem : R( ) = 1. From ( ), construct a sentence F in the language of Peano arithmetic, such that F is a theorem of Peano arithmetic iff M halts on . 2. Let P be the axioms of Peano arithmetic. Return. If Oracle exists, C = Oracle(R( )) decides H  : ● R exists (as shown by Turing) and is correct: ●  H  : M halts on . F is a theorem of Peano arithmetic. Oracle accepts. ●  H  : M does not halt on . F is not a theorem of Peano arithmetic. Oracle rejects. But no machine to decide H  can exist, so neither does Oracle. First-Order Logic is Not Decidable

We want a system such that: ● All allowable actions are legal and all unallowable actions are not legal. ● It is possible to answer the question, “Given an action A, is A legal?” ● The set of laws is consistent. (No action can be shown to be both legal and illegal.) ● The set of laws is finite and reasonably maintainable. So, for example, we must reject any system that requires a separate law, for each specific citizen, mandating that that citizen pay taxes. Example – The Legal System

Can we use Boolean logic? Can we find a complete and consistent first-order system? The Legal System

1. Given a CFL L and a string s, is s  L? 2. Given a CFL L, is L =  ? 3. Given a CFL L, is L =  *? 4. Given CFLs L 1 and L 2, is L 1 = L 2 ? 5. Given CFLs L 1 and L 2, is L 1  L 2 ? 6. Given a CFL L, is  L context-free? 7. Given a CFL L, is L regular? 8. Given two CFLs L 1 and L 2, is L 1  L 2 =  ? 9. Given a CFL L, is L inherently ambiguous? 10. Given PDAs M 1 and M 2, is M 2 a minimization of M 1 ? 11. Given a CFG G, is G ambiguous? Context-Free Languages

A configuration of a TM M is a 4 tuple: ( M’s current state, the nonblank portion of the tape before the read head, the character under the read head, the nonblank portion of the tape after the read head). A computation of M is a sequence of configurations: C 0, C 1, …, C n for some n  0 such that: ● C 0 is the initial configuration of M, ● C n is a halting configuration of M, and: ● C 0 |- M C 1 |- M C 2 |- M … |- M C n. A computation history encodes a computation: (s, , , x)(q 1, , a, z)( …. )( …. )(q n, r, s, t), where q n  H M. Reduction via Computation History

We show that CFG ALL is not in D by reduction from H: R will build G to generate the language L# composed of all strings in  * except any that represent a computation history of M on w. If M does not halt on w, there are no computation histories of M on w so G generates  * and Oracle will accept. If there exists a computation history of M on w, there will be a string that G will not generate; Oracle will reject. Oracle gets it backwards, so R must invert its response. It is easier for R to build a PDA than a grammar. So R will first build a PDA P, then convert P to a grammar. CFG ALL = { : G is a cfg and L(G) =  *} is not in D

For a string s to be a computation history of M on w: 1.It must be a syntactically valid computation history. 2. C 0 must correspond to M being in its start state, with w on the tape, and with the read head positioned just to the left of w. 3. The last configuration must be a halting configuration. 4. Each configuration after C 0 must be derivable from the previous one according to the rules in  M. Computation Histories as Strings

How to test (4), that each configuration after C 0 must be derivable from the previous one according to the rules in  M ? ( q 1, aaaa, b, aaaa )( q 2, aaa, a, baaaa ). Okay. ( q 1, aaaa, b, aaaa )( q 2, bbbb, a, bbbb ). Not okay. P will have to use its stack to record the first configuration and then compare it to the second. But what’s wrong? Computation Histories as Strings

Write every other configuration backwards. Let B# be the language of computation histories of M except in boustrophedon form. A boustrophedon example Generating boustrophedon text The Boustrophedon Version

R( ) = 1. Construct, where P accepts all strings in B#. 2. From P, construct a grammar G that generates L(P). 3. Return. If Oracle exists, then C =  Oracle(R( )) decides H: ●  H: M halts on w. There exists a computation history of M on w. So there is a string that G does not generate. Oracle rejects. R accepts. ●  H: M does not halt on , so there exists no computation history of M on w. G generates  *. Oracle accepts. R rejects. But no machine to decide H can exist, so neither does Oracle. The Boustrophedon Version

GG = = { : G 1 and G 2 are cfgs, L(G 1 ) = L(G 2 )} Proof by reduction from: CFG ALL = { : L(G) =  *}: R is a reduction from CFG ALL to GG = defined as follows: R( ) = 1. Construct the description of a new grammar G# that generates  *. 2. Return. If Oracle exists, then C = Oracle(R( )) decides CFG ALL : ● R is correct: ●  CFG ALL : G is equivalent to G#, which generates everything. Oracle accepts. ●  CFG ALL : G is not equivalent to G#, which generates everything. Oracle rejects. But no machine to decide CFG ALL can exist, so neither does Oracle.

PDA MIN = { : M 2 is a minimization of M 1 } is undecidable. Recall that M 2 is a minimization of M 1 iff: (L(M 1 ) = L(M 2 ))  M 2 is minimal. R( ) is a reduction from CFG ALL to PDA MIN : 1. Invoke CFGtoPDAtopdown(G) to construct the description of a PDA that accepts the language that G generates. 2. Write : P# is a PDA with a single state s that is both the start state and an accepting state. Make a transition from s back to itself on each input symbol. Never push anything onto the stack. L(P#) =  * and P# is minimal. 3. Return. If Oracle exists, then C = Oracle(( )) decides CFG ALL : ●  CFG ALL : L(G) =  *. So L(P) =  *. Since L(P#) =  *, L(P) = L(P#). And P# is minimal. Thus P# is a minimization of P. Oracle accepts. ●  CFG ALL : L(G)   *. So L(P)   *. But L(P#) =  *. So L(P)  L(P#). So Oracle rejects. No machine to decide CFG ALL can exist, so neither does Oracle.

= (x 1, x 2, x 3, …, x n )( y 1, y 2, y 3, …, y n ), where  j (x j   + and y j   +) Example: ( b, abb, aba, bbaaa )( bab, b, a, babaaa ). Reductions from PCP iXY 1 bbab 2 abbb 3 abaa 4 bbaaababaaa

G x : S x  b S x 1 S x  b 1 S x  babbb S x 2 S x  babbb 2 S x  ba S x 3 S x  ba 3 G y : S y  bbb S y 1 S y  bbb 1 S y  ba S y 2 S y  ba 2 S y  a S y 3 S y  a 3 G x could generate: b babbb ba babbb From PCP to Grammar iXY 1 bbab 2 abbb 3 abaa 4 bbaaababaaa

{ : L(G 1 )  L(G 2 ) =  } PCP = { : P has a solution} R (?Oracle) L 2 = { : L(G 1 )  L(G 2 ) =  } R( ) = 1. From P construct G x and G y. 2. Return. If Oracle exists, then C =  Oracle(R( )) decides PCP: ●  PCP: P has at least one solution. So both G x and G y will generate some string: w(i 1, i 2, …i k )R, where w = x i1 x i2 …x ik = y i1 yx i2 …y ik. So L(G 1 )  L(G 2 )  . Oracle rejects, so C accepts. ●  PCP: P has no solution. So there is no string that can be generated by both G x and G y. So L(G 1 )  L(G 2 ) = . Oracle accepts, so C rejects. But no machine to decide PCP can exist, so neither does Oracle.

CFG UNAMBIG = { : G is a CFG and G is ambiguous} PCP = { : P has a solution} R (?Oracle) CFG UNAMBIG = { : G is ambiguous} R( ) = 1. From P construct G x and G y. 2. Construct G as follows: 2.1. Add to G all the rules of both G x and G y Add S and the two rules S  S x and S  S y. 3. Return. G generates L(G 1 )  L(G 2 ) by generating all the derivations that G 1 can produce plus all the ones that G 2 can produce, except that each has a prepended: S  S x or S  S y.

CFG UNAMBIG = { : G is a CFG and G is ambiguous} R( ) = 1. From P construct G x and G y. 2. Construct G as follows: 2.1. Add to G all the rules of both G x and G y Add S and the two rules S  S x and S  S y. 3. Return. If Oracle exists, then C = Oracle(R( )) decides PCP: ●  PCP: P has a solution. Both G x and G y generate some string: w(i 1, i 2, …i k ) R, where w = x i1 x i2 …x ik = y i1 yx i2 …y ik. So G can generate that string in two different ways. G is ambiguous. Oracle accepts. ●  PCP: P has no solution. No string can be generated by both G x and G y. Since both G x and G y are unambiguous, so is G. Oracle rejects. But no machine to decide PCP can exist, so neither does Oracle.