automata and formal languages - cm0081 an undecidable

32
Automata and Formal Languages - CM0081 An Undecidable Problem That Is Recursively Enumerable Andrés Sicard-Ramírez Universidad EAFIT Semester 2018-1

Upload: haduong

Post on 04-Jan-2017

234 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Automata and Formal Languages - CM0081 An Undecidable

Automata and Formal Languages - CM0081An Undecidable Problem That Is Recursively

Enumerable

Andrés Sicard-Ramírez

Universidad EAFIT

Semester 2018-1

Page 2: Automata and Formal Languages - CM0081 An Undecidable

Theorems About Recursive Languages

Theorem (Hopcroft, Motwani and Ullman [2007], Theorem 9.3)If 𝐿 is a recursive language, so is 𝐿.

ProofWhiteboard.

Theorem (Hopcroft, Motwani and Ullman [2007], Theorem 9.4)If both 𝐿 and its complement are recursively enumerable, then 𝐿 is recursive(and by Theorem 9.3, 𝐿 is recursive as well).

ProofWhiteboard.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 2/32

Page 3: Automata and Formal Languages - CM0081 An Undecidable

Theorems About Recursive Languages

Theorem (Hopcroft, Motwani and Ullman [2007], Theorem 9.3)If 𝐿 is a recursive language, so is 𝐿.

ProofWhiteboard.

Theorem (Hopcroft, Motwani and Ullman [2007], Theorem 9.4)If both 𝐿 and its complement are recursively enumerable, then 𝐿 is recursive(and by Theorem 9.3, 𝐿 is recursive as well).

ProofWhiteboard.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 3/32

Page 4: Automata and Formal Languages - CM0081 An Undecidable

Theorems About Recursive LanguagesPossible relations between a language 𝐿 and its complement 𝐿:

i) Both 𝐿 and 𝐿 are recursive.

ii) Neither 𝐿 nor 𝐿 are recursively enumerable.iii) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursively

enumerable.iv) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursively

enumerable.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 4/32

Page 5: Automata and Formal Languages - CM0081 An Undecidable

Theorems About Recursive LanguagesPossible relations between a language 𝐿 and its complement 𝐿:

i) Both 𝐿 and 𝐿 are recursive.ii) Neither 𝐿 nor 𝐿 are recursively enumerable.

iii) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursivelyenumerable.

iv) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursivelyenumerable.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 5/32

Page 6: Automata and Formal Languages - CM0081 An Undecidable

Theorems About Recursive LanguagesPossible relations between a language 𝐿 and its complement 𝐿:

i) Both 𝐿 and 𝐿 are recursive.ii) Neither 𝐿 nor 𝐿 are recursively enumerable.iii) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursively

enumerable.

iv) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursivelyenumerable.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 6/32

Page 7: Automata and Formal Languages - CM0081 An Undecidable

Theorems About Recursive LanguagesPossible relations between a language 𝐿 and its complement 𝐿:

i) Both 𝐿 and 𝐿 are recursive.ii) Neither 𝐿 nor 𝐿 are recursively enumerable.iii) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursively

enumerable.iv) 𝐿 is recursively enumerable but not recursive and 𝐿 is not recursively

enumerable.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 7/32

Page 8: Automata and Formal Languages - CM0081 An Undecidable

Theorems About Recursive Languages

Exercise (Hopcroft, Motwani and Ullman [2007], Exercise 9.2.5)Let 𝐿 be recursively enumerable and let 𝐿 be non-RE. Consider thelanguage

𝐿′ = {0𝑤 ∣ 𝑤 is in 𝐿} ∪ {1𝑤 ∣ 𝑤 is not in 𝐿}.Can you say for certain whether 𝐿′ is recursive, RE, or non-RE? Justifyyour answer.

Solution (from Hopcroft, Motwani and Ullman [2007])Suppose 𝐿′ were RE. Then we could design a TM 𝑀 for 𝐿 as follows.Given input 𝑤, 𝑀 changes its input to 1𝑤 and simulates the hypotheticalTM for 𝐿′. If that TM accepts, then 𝑤 is in 𝐿, so 𝑀 should accept. Ifthe TM for 𝐿′ never accepts, then neither does 𝑀 . Thus, 𝑀 would acceptexactly 𝐿, which contradicts the fact that 𝐿 is not RE. We conclude that 𝐿′

is not RE.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 8/32

Page 9: Automata and Formal Languages - CM0081 An Undecidable

The Universal LanguageConventions

1. (𝑀, 𝑤): Represents the TM 𝑀 with input 𝑤.2. 𝑤 is a string of 0’s and 1’s.

Codification of a TM with an inputLet 𝑤𝑖 be the codification of a TM 𝑀 . The codification of (𝑀, 𝑤) is

(𝑀, 𝑤) = 𝑤𝑖111𝑤.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 9/32

Page 10: Automata and Formal Languages - CM0081 An Undecidable

The Universal LanguageThe universal language Lu

An undecidable language that is recursively enumerable.

The set of binary strings that encode a pair (𝑀, 𝑤) such that 𝑤 ∈ 𝐿(𝑀),

Lu = { (𝑀, 𝑤) ∣ 𝑤 ∈ 𝐿(𝑀)} .TheoremLu is recursively enumerable.

Idea of the proofExists a TM U such that Lu = 𝐿(U). The machine U is called a universalTuring machine.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 10/32

Page 11: Automata and Formal Languages - CM0081 An Undecidable

The Universal LanguageThe universal language Lu

An undecidable language that is recursively enumerable.The set of binary strings that encode a pair (𝑀, 𝑤) such that 𝑤 ∈ 𝐿(𝑀),

Lu = { (𝑀, 𝑤) ∣ 𝑤 ∈ 𝐿(𝑀)} .

TheoremLu is recursively enumerable.

Idea of the proofExists a TM U such that Lu = 𝐿(U). The machine U is called a universalTuring machine.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 11/32

Page 12: Automata and Formal Languages - CM0081 An Undecidable

The Universal LanguageThe universal language Lu

An undecidable language that is recursively enumerable.The set of binary strings that encode a pair (𝑀, 𝑤) such that 𝑤 ∈ 𝐿(𝑀),

Lu = { (𝑀, 𝑤) ∣ 𝑤 ∈ 𝐿(𝑀)} .TheoremLu is recursively enumerable.

Idea of the proofExists a TM U such that Lu = 𝐿(U). The machine U is called a universalTuring machine.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 12/32

Page 13: Automata and Formal Languages - CM0081 An Undecidable

The Universal LanguageTheoremLu is not recursive.

Proof.Suppose Lu is recursive ⇒Lu is recursive ⇒Ld is recursive ⇒⊥ (contradiction).

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 13/32

Page 14: Automata and Formal Languages - CM0081 An Undecidable

Code for a Universal Turing MachineSince 𝑈 is a Turing machine exists 𝑖 (1654 digits) such that 𝑈 = 𝑀𝑖 givenby (using a different codification):∗

7244855335339317577198395039615711237952360672556559631108144796606505059404241090310483613632359365644443458382226883278767626556144692814117715017842551707554085657689753346356942478488597046934725739988582283827795294683460521061169835945938791885546326440925525505820555989451890716537414896033096753020431553625034984529832320651583047664142130708819329717234151056980262734686429921838172157333482823073453713421475059740345184372359593090640024321077342178851492760797597634415123079586396354492269159479654614711345700145048167337562172573464522731054482980784965126988788964569760906634204477989021914437932830019493570963921703904833270882596201301773727202718625919914428275437422351355675134084222299889374410534305471044368695876405178128019437530813870639942772823156425289237514565443899052780793241144826142357286193118332610656122755531810207511085337633806031082361675045635852164214869542347187426437544428790062485827091240422076538754264454133451748566291574299909502623009733738137724162172747723610206786854002893566085696822620141982486216989026091309402985706001743006700868967590344734174127874255812015493663938996905817738591654055356704092821332221631410978710814599786695997045096818419062994436560151454904880922084480034822492077304030431884298993931352668823496621019471619107014619685231928474820344958977095535611070275817487333272966789987984732840981907648512726310017401667873634776058572450369644348979920344899974556624029374876688397514044516657077500605138839916688140725455446652220507242623923792115253181625125363050931728631422004064571305275802307665183351995689139748137504926429605010013651980186945639498

∗Penrose, R. (1991). The Emperor’s New Mind, pp. 56-57.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 14/32

Page 15: Automata and Formal Languages - CM0081 An Undecidable

The Original Universal Turing Machine

Based on 𝑀 -functions (subroutines with parameters)∗

The machine is composed by 12 symbols and 4.000 instructions,approximately.†

∗Sicard, A. and Copeland, B. J. (2004). Appendix: Subroutines and M-functions.Sicard, A. (1997). Máquina Universal de Turing: Algunas Indicaciones para suConstrucción.

†Sicard Ramírez, A. (1998). Máquinas de Turing Dinámicas: Historia y Desarrollo deuna Idea.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 15/32

Page 16: Automata and Formal Languages - CM0081 An Undecidable

Small Universal Turing Machines∗

UTM(𝑚, 𝑛): Class of universal Turing machines with 𝑚 states and 𝑛symbols.

There exists UTMs in the following classes:

UTM(24, 2),UTM(10, 3),UTM(7, 4),UTM(5, 5),UTM(4, 6),UTM(3, 10),UTM(2, 18).

The classes UTM(3, 2), UTM(2, 3) and UTM(2, 2) are empty.

∗Rogozhin, Y. (1996). Small Universal Turing Machines.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 16/32

Page 17: Automata and Formal Languages - CM0081 An Undecidable

Small Universal Turing Machines∗

UTM(𝑚, 𝑛): Class of universal Turing machines with 𝑚 states and 𝑛symbols.

There exists UTMs in the following classes:

UTM(24, 2),UTM(10, 3),UTM(7, 4),UTM(5, 5),UTM(4, 6),UTM(3, 10),UTM(2, 18).

The classes UTM(3, 2), UTM(2, 3) and UTM(2, 2) are empty.

∗Rogozhin, Y. (1996). Small Universal Turing Machines.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 17/32

Page 18: Automata and Formal Languages - CM0081 An Undecidable

Wolfram Turing MachineTHE BOOK STORE DOWNLOADS EDUCATION ARCHIVES FORUM

© 2012 Stephen Wolfram, LLC stephenwolfram.com | wolfram.com | send a message | contact info

Announced May 14th, 2007: 5th Anniversary of the Publication of A New Kindof Science

Is this Turing machine universal, ornot?

The machine has 2 states and 3 colors, and is 596440 in Wolfram's numbering scheme.

If it is universal then it is the smallest universal Turing machine that exists.

BACKGROUND » TECHNICAL DETAILS » GALLERY » NEWS »

PRIZE COMMITTEE » RULES & GUIDELINES » FAQs »

A universal Turing machine is powerful enough to emulate any standard computer.

The question is: how simple can the rules for a universal Turing machine be?

Since the 1960s it has been known that there is a universal 7,4 machine. In A New

Kind of Science, Stephen Wolfram found a universal 2,5 machine, and suggested that

the particular 2,3 machine that is the subject of this prize might be universal.

The prize is for determining whether or not the 2,3 machine is in fact universal.

What is a Turing Machine? » | Notable Universal Turing Machines »

INTERACTIVE DEMONSTRATIONS » PRINTABLE POSTER »

NKS|ONLINE »

SPONSORED BY WOLFRAM RESEARCH & STEPHEN WOLFRAM

Wolfram 2,3 Turing Machine Research Prize http://www.wolframscience.com/prizes/tm23/

1 of 1 10/11/2012 09:31 AM

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 18/32

Page 19: Automata and Formal Languages - CM0081 An Undecidable

Conway’s Game of LifeFrom: WikipediaNote: Adobe Reader is required to see the simulation (tested with AdobeReader 9.9.5 on Ubuntu).

ExamplesPulsar (Oscillator)Author: Jokey Smurf

Glider (Spaceship)Author: Rodrigo Silveira Camargo

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 19/32

Page 20: Automata and Formal Languages - CM0081 An Undecidable

Conway’s Game of LifeRules

i) Any live cell with fewer than two live neighbours dies, as if caused byunder-population.

ii) Any live cell with two or three live neighbours lives on to the nextgeneration.

iii) Any live cell with more than three live neighbours dies, as if byovercrowding.

iv) Any dead cell with exactly three live neighbours becomes a live cell,as if by reproduction.

TheoremIt is possible codified a universal Turing machine in Conway’s Game of Life.∗

∗Rendell, P. (2011). A Universal Turing Machine in Conway’s Game of Life.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 20/32

Page 21: Automata and Formal Languages - CM0081 An Undecidable

Conway’s Game of LifeRules

i) Any live cell with fewer than two live neighbours dies, as if caused byunder-population.

ii) Any live cell with two or three live neighbours lives on to the nextgeneration.

iii) Any live cell with more than three live neighbours dies, as if byovercrowding.

iv) Any dead cell with exactly three live neighbours becomes a live cell,as if by reproduction.

TheoremIt is possible codified a universal Turing machine in Conway’s Game of Life.∗

∗Rendell, P. (2011). A Universal Turing Machine in Conway’s Game of Life.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 21/32

Page 22: Automata and Formal Languages - CM0081 An Undecidable

Conway’s Game of LifeRules

i) Any live cell with fewer than two live neighbours dies, as if caused byunder-population.

ii) Any live cell with two or three live neighbours lives on to the nextgeneration.

iii) Any live cell with more than three live neighbours dies, as if byovercrowding.

iv) Any dead cell with exactly three live neighbours becomes a live cell,as if by reproduction.

TheoremIt is possible codified a universal Turing machine in Conway’s Game of Life.∗

∗Rendell, P. (2011). A Universal Turing Machine in Conway’s Game of Life.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 22/32

Page 23: Automata and Formal Languages - CM0081 An Undecidable

Conway’s Game of LifeRules

i) Any live cell with fewer than two live neighbours dies, as if caused byunder-population.

ii) Any live cell with two or three live neighbours lives on to the nextgeneration.

iii) Any live cell with more than three live neighbours dies, as if byovercrowding.

iv) Any dead cell with exactly three live neighbours becomes a live cell,as if by reproduction.

TheoremIt is possible codified a universal Turing machine in Conway’s Game of Life.∗

∗Rendell, P. (2011). A Universal Turing Machine in Conway’s Game of Life.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 23/32

Page 24: Automata and Formal Languages - CM0081 An Undecidable

Conway’s Game of LifeRules

i) Any live cell with fewer than two live neighbours dies, as if caused byunder-population.

ii) Any live cell with two or three live neighbours lives on to the nextgeneration.

iii) Any live cell with more than three live neighbours dies, as if byovercrowding.

iv) Any dead cell with exactly three live neighbours becomes a live cell,as if by reproduction.

TheoremIt is possible codified a universal Turing machine in Conway’s Game of Life.∗

∗Rendell, P. (2011). A Universal Turing Machine in Conway’s Game of Life.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 24/32

Page 25: Automata and Formal Languages - CM0081 An Undecidable

The Halting ProblemThe original Turing machine accepted by halting, no by final state.

H(𝑀) = {𝑤 ∣ 𝑀 halts given the input 𝑤}.

The halting problem (language)

Lhp = { (𝑀, 𝑤) ∣ 𝑤 ∈ H(𝑀)} .

Example (Hopcroft, Motwani and Ullman [2007], Exercise 9.2.1)Show that Lhp is recursively enumerable but not recursive.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 25/32

Page 26: Automata and Formal Languages - CM0081 An Undecidable

The Halting ProblemThe original Turing machine accepted by halting, no by final state.

H(𝑀) = {𝑤 ∣ 𝑀 halts given the input 𝑤}.

The halting problem (language)

Lhp = { (𝑀, 𝑤) ∣ 𝑤 ∈ H(𝑀)} .

Example (Hopcroft, Motwani and Ullman [2007], Exercise 9.2.1)Show that Lhp is recursively enumerable but not recursive.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 26/32

Page 27: Automata and Formal Languages - CM0081 An Undecidable

The Halting ProblemThe original Turing machine accepted by halting, no by final state.

H(𝑀) = {𝑤 ∣ 𝑀 halts given the input 𝑤}.

The halting problem (language)

Lhp = { (𝑀, 𝑤) ∣ 𝑤 ∈ H(𝑀)} .

Example (Hopcroft, Motwani and Ullman [2007], Exercise 9.2.1)Show that Lhp is recursively enumerable but not recursive.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 27/32

Page 28: Automata and Formal Languages - CM0081 An Undecidable

The Halting Problem230 M. Margenstern / Theoretical Computer Science 231 (2000) 217–251

Fig. 2. The state of the art. Black squares indicate undecidable points, while squares indicate decidablepoints, points marked with plus between the white squares lines and the line of black squares in the shapeof a hyperbola correspond to sets for which the status of the halting problem is not known.

author improved some of the results obtained in 1982 [94–96]. Yet his paper of 1982had remained unnoticed by the scienti�c community for ten years. The technique usedin order to obtain these results will be explained in our survey, in Section 3.4.2.Let us have a look now in the opposite direction: it is trivial that Turing machines on

a single letter alphabet have a decidable halting problem. It is not that trivial that thesame property holds for machines with a single state, whatever the number of symbolsis in the machine alphabet. This was de�nitely proved by Hermann in 1966 [32].For more than one state, one does not know much. As for proving the decidability

of the halting problem, M. Minsky writes in his famous book of 1967 that he andone of his students “did this for all 2× 2 machines [1961, unpublished] by a tediousreduction to thirty-odd cases (unpublishable)” [72, p. 281, last two lines]. Six yearslater, Pavlotskaya proved the same theorem [82] in a compact, very short proof. Thispaper has also remained unnoticed for many years. A few years later [84], she provedthat the point 3× 2 is also decidable.All these results about the decidability and undecidability of the halting problem for

Turing machines can be represented as in Fig. 2.

3.1. Decidability criteria

Let us now introduce a more precise notion of decidability criterion, respectivelystrong decidability criterion. Let c be an integer-valued function de�ned on a set Mof Turing machines in M with the following property: there is an integer f such that

State of theart∗. Blacksquare(undecidableproblem),square(decidableproblem), plus(unknownstatus).

∗Figure from [Margenstern 2000].Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 28/32

Page 29: Automata and Formal Languages - CM0081 An Undecidable

The Halting ProblemRemarkThe halting problem was introduced and named by Davis∗ not by Turinghimself, contrary to popular belief.†

Practical approach“In contrast to popular belief, proving termination is not always im-possible.”‡

∗Davis, M. (1958). Computability and Unsolvability, p. 70.†Copeland, B. J. (2004). Hypercomputation: Philosophical Issues, p. 40.‡Cook, B., Podelski, A. and Rybalchenko, A. (2011). Proving Program Termination,

p. 1.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 29/32

Page 30: Automata and Formal Languages - CM0081 An Undecidable

The Halting ProblemRemarkThe halting problem was introduced and named by Davis∗ not by Turinghimself, contrary to popular belief.†

Practical approach“In contrast to popular belief, proving termination is not always im-possible.”‡

∗Davis, M. (1958). Computability and Unsolvability, p. 70.†Copeland, B. J. (2004). Hypercomputation: Philosophical Issues, p. 40.‡Cook, B., Podelski, A. and Rybalchenko, A. (2011). Proving Program Termination,

p. 1.Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 30/32

Page 31: Automata and Formal Languages - CM0081 An Undecidable

References

Cook, B., Podelski, A. and Rybalchenko, A. (2011). Proving ProgramTermination. Communications of the ACM 54.5, pp. 88–98. doi:10.1145/1941487.1941509.

Copeland, B. J. (2004). Hypercomputation: Philosophical Issues. TheoreticalComputer Science 317.1–3, pp. 251–267. doi: 10.1016/j.tcs.2003.12.014.

Davis, M. (1958). Computability and Unsolvability. McGraw-Hill.Hopcroft, J. E., Motwani, R. and Ullman, J. D. (2007). Introduction to Automata

theory, Languages, and Computation. 3rd ed. Pearson Education.Margenstern, M. (2000). Frontier Between Decidability and Undecidability: A

Survey. Theoretical Computer Science 231.2, pp. 217–251. doi:10.1016/S0304-3975(99)00102-4.

Penrose, R. (1991). The Emperor’s New Mind. Penguin Books.Rendell, P. (2011). A Universal Turing Machine in Conway’s Game of Life. In:

Proceedings of the 2011 International Conference on High PerformanceComputing & Simulation (HPCS 2011). Ed. by Smari, W. W. IEEE,pp. 764–772.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 31/32

Page 32: Automata and Formal Languages - CM0081 An Undecidable

ReferencesRogozhin, Y. (1996). Small Universal Turing Machines. Theoretical Computer

Science 168, pp. 215–240. doi: 10.1016/S0304-3975(96)00077-1.Sicard Ramírez, A. (1998). Máquinas de Turing Dinámicas: Historia y Desarrollo

de una Idea. MA thesis. Departamento de Informática y Sistemas. UniversidadEAFIT.

Sicard, A. (1997). Máquina Universal de Turing: Algunas Indicaciones para suConstrucción. Rev. U. EAFIT 33.108, pp. 61–106.

Sicard, A. and Copeland, B. J. (2004). Appendix: Subroutines and M-functions.In: The Essential Turing. Vol. 317. 1–3, pp. 54–57. doi:10.1016/j.tcs.2003.12.014.

Automata and Formal Languages - CM0081. An Undecidable Problem That Is Recursively Enumerable 32/32