Self-Reference And Undecidability

Slides:



Advertisements
Similar presentations
COMPSCI 102 Introduction to Discrete Mathematics.
Advertisements

Hard problems November Administrivia Ps 8 –Handed out Tuesday (12/4) –Due Tuesday (12/11) or Tuesday (12/18) your choice Ps 9 –Handed out Thursday.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Great Theoretical Ideas in Computer Science.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Great Theoretical Ideas in Computer Science.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Introduction to Computer Science. A Quick Puzzle Well-Formed Formula  any formula that is structurally correct  may be meaningless Axiom  A statement.
Cantor’s Legacy: Infinity And Diagonalization Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 25Apr 13, 2004Carnegie.
Turing’s Legacy: The Limits Of Computation. Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 26April 20, 2003Carnegie.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
The Recursion Theorem Pages 217– ADVANCED TOPICS IN C O M P U T A B I L I T Y THEORY.
Great Theoretical Ideas in Computer Science for Some.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
Course Overview and Road Map Computability and Logic.
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity Computability With Alan! (not Turing) Mind-
Halting Problem Introduction to Computing Science and Programming I.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
CSE 311 Foundations of Computing I Lecture 29 Computability: Turing machines, Undecidability of the Halting Problem Autumn 2012 CSE 3111.
Great Theoretical Ideas in Computer Science.
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)
Great Theoretical Ideas in Computer Science.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
CSE 311: Foundations of Computing Fall 2014 Lecture 27: Cardinality.
Thales’ Legacy: What Is A Proof? Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 27April 22, 2004Carnegie Mellon.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
On computable numbers, with an application to the ENTSCHEIDUNGSPROBLEM COT 6421 Paresh Gupta by Alan Mathison Turing.
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
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:
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Turing’s Legacy: The Limits Of Computation. Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2005 Lecture 26Nov 29, 2005Carnegie.
Great Theoretical Ideas In Computer Science
The Acceptance Problem for TMs
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Introduction to Computing Science and Programming I
CIS Automata and Formal Languages – Pei Wang
Gödel's Legacy: The Limits Of Logics
Discrete Mathematics for Computer Science
Great Theoretical Ideas in Computer Science
Turing’s Legacy: The Limits Of Computation.
CSE 311 Foundations of Computing I
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Great Theoretical Ideas in Computer Science
Homework: Friday Read Section 4.1. In particular, you must understand the proofs of Theorems 4.1, 4.2, 4.3, and 4.4, so you can do this homework. Exercises.
CSCE 411 Design and Analysis of Algorithms
Turing’s Legacy: The Limits Of Computation.
CSE 311 Foundations of Computing I
Decidability Turing Machines Coded as Binary Strings
Decidability Turing Machines Coded as Binary Strings
Thales’ and Gödel’s Legacy: Proofs and Their Limitations
The Limitations of Proofs: An Incompressible Resolution
MA/CSSE 474 Theory of Computation
Formal Languages, Automata and Models of Computation
Great Theoretical Ideas in Computer Science
Introduction to Discrete Mathematics
Class 24: Computability Halting Problems Hockey Team Logo
CS21 Decidability and Tractability
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
CSE 311: Foundations of Computing
CO Games Development 2 Week 21 Turing Machines & Computability
Turing Machines Everything is an Integer
MA/CSSE 474 Theory of Computation
CIS Automata and Formal Languages – Pei Wang
Presentation transcript:

Self-Reference And Undecidability Great Theoretical Ideas In Computer Science Self-Reference And Undecidability Anything says is false! Lecture 12 CS 15-251

The HELLO assignment Write a JAVA program to output the word “HELLO” on the screen and halt. Space and time are not an issue. The program is for an ideal computer. PASS for any working HELLO program, no partial credit.

How exactly might such a script work? Grading Script The grading script G must be able to take any Java program P and grade it. Pass, if P prints only the word G(P)= “HELLO” and halts. Fail, otherwise. How exactly might such a script work?

What kind of program could a student who hated his/her TA hand in?

Nasty Program While ( P is not a proof of Riemann Hypothesis) P++ PRINT “HELLO” The nasty program is a PASS if and only if there is a proof of the Riemann Hypothesis

Despite the simplicity of the HELLO assignment, there is no program to correctly grade it! This can be proved.

The theory of what can and can’t be computed by an ideal computer is called Computability Theory or Recursion Theory.

Notation And Conventions Fix a single programming language When we write program P we are talking about the text of the source code for P P(x) means the output that arises from running program P on input x P(x) =  means P did not halt on x

P(P) It follows from our conventions that P(P) means the output obtained when we run P on the text of its own source code.

The Famous Halting Set: K K is the set of all programs P such that P(P) halts.

The Halting Problem Write a program HALT such that: HALT(P)= yes, if P(P) halts HALT(P)= no, if P(P) does not halt

The Halting Problem Write a program HALT such that: HALT(P)= yes, if PK HALT(P)= no, if PK HALTS decides whether or not any given program is in K.

THEOREM: There is no program to solve the halting problem (Alan Turing 1937) Suppose a program HALT, solving the halting problem, existed: HALT(P)= yes, if P(P) halts HALT(P)= no, if P(P) does not halt We will call HALT as a subroutine in a new program called CONFUSE.

CONSUSE(P): If HALT(P) then loop_for_ever Else return (i.e., halt) <text of subroutine HALT goes here> -------------------------------------------- Does CONFUSE(CONFUSE) halt? YES implies HALT(CONFUSE) = yes thus, CONFUSE(CONSFUSE) will not halt NO implies HALT(CONFUSE) = no thus, CONFUSE(CONFUSE) halts

If HALT(P) then loop_for_ever Else return (i.e., halt) CONSUSE(P): If HALT(P) then loop_for_ever Else return (i.e., halt) <text of subroutine HALT goes here> -------------------------------------------- Does CONFUSE(CONFUSE) halt? YES implies HALT(CONFUSE) = yes thus, CONFUSE(CONSFUSE) will not halt NO implies HALT(CONFUSE) = no thus, CONFUSE(CONFUSE) halts CONTRADICTION

Turing’s argument is essentially the reincarnation of the DIAGONALIZATION argument from the theory of infinities.

P0 P1 P2 … Pj Pi YES, if Pi(Pj) halts No, otherwise

P0 P1 P2 … Pj d0 d1 Pi di C O N F U S E di = HALT(Pi) CONFUSE(Pi) halts iff di = no The CONFUSE row contains the negation of the diagonal.

Is there a real number that can be described, but not computed?

Consider the real number whose binary expansion has a 1 in the ith position iff PiK.

Alan Turing (1912-1954)

Computability Theory: Vocabulary Lesson We call a set S* decidable or recursive if there is a program P such that: P(x)=yes, if xS P(x)=no, if xS We already know: K is undecidable

Now that we have established that the Halting Set is undecidable, we can use it for a jumping off points for more “natural” undecidability results.

Oracle For Set S Oracle for S Is xS? YES/NO

K0= the set of programs that take no input and halt P = [input I; Q] Does P(P) halt? BUILD:Oracle for K GIVEN:Oracle for K0 Does [I:=P;Q] halt?

Thus, if K0 were decidable then K would be as well Thus, if K0 were decidable then K would be as well. We already K is not decidable, hence K0 is not decidable.

HELLO = the set of program that print hello and halt Does P halt? Let P’ be P with all print statements removed. [P’; print HELLO] is a hello program? BUILD:Oracle for K0 GIVEN:HELLO Oracle

HELLO is not decidable.

EQUAL = All <P,Q> such that P and Q have identical output behavior on all inputs Does P equal HELLO ? Let HI = [print HELLO] Are P and HI equal? BUILD:HELLOOracle GIVEN:EQUALOracle

EQUAL is not decidable.

Can you see how to do this? A subtlety. K is undecidable, but we can write a program to enumerate its elements. Can you see how to do this?

Theorem: K can be enumerated by a computer program Proof: Timesharing (Dovetailing) Output the name of any machine that halts: Run P1(P1) for 1 step Run P2(P2) for 1 step Run P1(P1) for 1 step Run P3(P3) for 1 step …

Theorem: The complement of K can’t be enumerated Proof: Enumerate both K and its complement. To decide x in K for any x, just wait until x appears in one of the two lists.

Many “simple” problems are undecidable Does a given initial configuration in the game of Life go on forever? Do two given Context Free Grammars generate the same language? Given a multi-variate polynomial over the integers, does it have an integer root?

PHILOSOPHICAL INTERLUDE

CHURCH-TURING THESIS Any computational method that can be grasped and performed by the human mind, can be performed on a conventional digital computer.

The Church-Turing Thesis is NOT a theorem The Church-Turing Thesis is NOT a theorem. It is a statement of belief concerning the universe we live in. Your opinion will be influenced by your religious, scientific, and philosophical beliefs.

Empirical Intuition No one has ever given a counter-example to the Church-Turing thesis. I.e., no one has given a concrete example of something humans compute in a consistent and well defined way, but that can’t be programmed on a computer. The thesis is true.

Mechanical Intuition The brain is a machine. The components of the machine obey fixed physical laws. In principle, an entire brain can be simulated step by step on a digital computer. Thus, any thoughts of such a brain can be computed by a simulating computer. The thesis is true.

Spiritual Intuition The mind consists of part matter and part soul. Soul, by its very nature, defies reduction to physical law. Thus, the action and thoughts of the brain are not simulable or reducible to simple components and rules. The thesis is false.

Quantum Intuition The brain is a machine, but not a classical one. It is inherently quantum mechanical in nature and does not reduce to simple particles in motion. Thus, there are inherent barriers to being simulated on a digital computer. The thesis is false. However, the thesis is true if we allow quantum computers.

But this ain’t philosophy class! There are many other viewpoints you might have concerning the Church-Turing Thesis. But this ain’t philosophy class!

Self-Reference Puzzle Write a program that prints itself out as output. No calls to the operating system, or to memory external to the program.

Auto_Cannibal_Maker Write a program Auto_Cannibal_Maker that takes the text of a program EAT as input and outputs a program called SELF. When SELF is executed it should output EAT(SELF)

Foundation F Let F be any foundation for mathematics: F is a proof system that only proves true things The set of valid proofs is computable. There is a program to check any candidate proof in this system

INCOMPLETENESS Let F be any attempt to give a foundation for mathematics We will construct a statement that is provably true, but not not provable in F.

CONFUSEF(P) Loop though all sequences of symbols S If S is a valid F-proof of “P halts”, then LOOP_FOR_EVER If S is a valid F-proof of “P never halts”, then HALT

GODELF GODELF= AUTO_CANNIBAL_MAKER(CONFUSEF) Thus, when we run GODELF it will do the same thing as: CONFUSEF(GODELF)

GODELF Can F prove GODELF halts? Yes -> CONFUSEF(GODELF) does not halt Contradiction Can F prove GODELF does not halt? Yes -> CONFUSEF(GODELF) halts

GODELF F can’t prove or disprove that GODELF halts. Thus CONFUSEF(GODELF) = GODELF will not halt. Thus, we have just proved what F can’t. F can’t prove something that we know is true. It is not a complete foundation for mathematics.

CONCLUSION No fixed set of assumptions F can provide a complete foundation for mathematical proof. In particular, it can’t prove the true statement that GODELF does not halt. No formal system can capture our ability to reason logically and mathematically!

GÖDEL’S INCOMPLETENESS THEOREM In 1931, Gödel stunned the world by proving that for any consistent axioms F there is a true statement of first order number theory that is not provable or disprovable by F. I.e., a true statement that can be made using 0, 1, plus, times, for every, there exists, AND, OR, NOT, parentheses, and variables that refer to natural numbers.

ENDNOTE You might think that Gödel’s theorem proves that are mathematically capable in ways that computers are not. This would show that the Church-Turing Thesis is wrong. Gödel’s theorem proves no such thing!

BUT this ain’t philosophy class!