Class 24: Computability Halting Problems Hockey Team Logo

Slides:



Advertisements
Similar presentations
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
Advertisements

David Evans CS150: Computer Science University of Virginia Computer Science Lecture 26: Proving Uncomputability Visualization.
Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia.
David Evans CS200: Computer Science University of Virginia Computer Science Class 27: Modeling Computation.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
CS1001 Lecture 22. Overview Mechanizing Reasoning Mechanizing Reasoning G ö del ’ s Incompleteness Theorem G ö del ’ s Incompleteness Theorem.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages
Lecture 24: Gödel’s Proof CS150: Computer Science
Introduction to Computer Science. A Quick Puzzle Well-Formed Formula  any formula that is structurally correct  may be meaningless Axiom  A statement.
Algorithms: Selected Exercises Goals Introduce the concept & basic properties of an algorithm.
Lecture 14: Church-Turing Thesis Alonzo Church ( ) Alan Turing ( )
Class 36: Proofs about Unprovability David Evans University of Virginia cs1120.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
David Evans CS200: Computer Science University of Virginia Computer Science Class 24: Gödel’s Theorem.
Class 37: Uncomputability David Evans University of Virginia cs1120 Halting Problems Hockey Team.
David Evans CS150: Computer Science University of Virginia Computer Science Computability.
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Institute for Experimental Physics University of Vienna Institute for Quantum Optics and Quantum Information Austrian Academy of Sciences Undecidability.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
David Evans CS200: Computer Science University of Virginia Computer Science Class 25: Computability Halting Problems Hockey.
Lecture 18. Unsolvability Before the 1930’s, mathematics was not like today. Then people believed that “everything true must be provable”. (More formally,
Course Overview and Road Map Computability and Logic.
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
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas in Computer Science.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 25: Gödel and Computability Halting.
Thinking in Methodologies Class Notes. Gödel’s Theorem.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Computation Motivating questions: What does “computation” mean? What are the similarities and differences between computation in computers and in natural.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Recursively Enumerable and Recursive Languages
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
David Evans CS200: Computer Science University of Virginia Computer Science Class 26: Halting Problem It is plain at any.
David Evans CS200: Computer Science University of Virginia Computer Science Class 19: Computability Halting Problems Hockey.
1 Recursively Enumerable and Recursive Languages.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
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.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Introduction to Computing Science and Programming I
Gödel's Legacy: The Limits Of Logics
Axiomatic Number Theory and Gödel’s Incompleteness Theorems
Discrete Mathematics for Computer Science
Universality of Computation
Class 30: Models of Computation CS200: Computer Science
CSE 311 Foundations of Computing I
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Great Theoretical Ideas in Computer Science
Computable Problems.
Class 14: Intractable Problems CS150: Computer Science
Lecture 22: Gödel’s Theorem CS200: Computer Science
Lecture 25: Metalinguistics > (meval '((lambda (x) (* x x)) 4)
Lecture 24: Metalinguistics CS200: Computer Science
Halting Problem.
Formal Languages, Automata and Models of Computation
More undecidable languages
Great Theoretical Ideas in Computer Science
Class 34: Models of Computation CS200: Computer Science
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Class 26: Modeling Computing CS150: Computer Science
Properties of Relational Logic
CO Games Development 2 Week 21 Turing Machines & Computability
Lecture 23: Computability CS200: Computer Science
Presentation transcript:

David Evans http://www.cs.virginia.edu/evans Class 24: Computability Halting Problems Hockey Team Logo CS150: Computer Science University of Virginia Computer Science David Evans http://www.cs.virginia.edu/evans

Menu Review: Computability: Gödel’s Theorem Proof in Axiomatic Systems Computability: Are there some problems that it is impossible to write a program to solve?

Gödel’s Proof If G were provable, then PM would be inconsistent. G: This statement of number theory does not have any proof in the system of PM. If G were provable, then PM would be inconsistent. If G is unprovable, then PM would be incomplete. PM cannot be complete and consistent!

What does it mean for an axiomatic system to be complete and consistent? Derives all true statements, and no false statements starting from a finite number of axioms and following mechanical inference rules.

What does it mean for an axiomatic system to be complete and consistent? It means the axiomatic system is weak. Its is so weak, it cannot express “This statement has no proof.”

Why is an Inconsistent Axiomatic System less useful than an Incomplete Axiomatic System?

Inconsistent Axiomatic System Derives all true statements, and some false statements starting from a finite number of axioms and following mechanical inference rules. some false statements Once you can prove one false statement, everything can be proven! false  anything

Proof A proof of S in an axiomatic system is a sequence of strings, T0, T1, …, Tn where: The first string is the axioms For all i from 1 to n, Tn is the result of applying one of the inference rules to Tn-1 Tn is S How much work is it to check a proof?

Proof Checking Problem Input: an axiomatic system (a set of axioms and inference rules), a statement S, and a proof P containing n steps of S Output: true if P is a valid proof of S false otherwise How much work is a proof-checking procedure? We can write a proof-checking procedure that is  (n)

Finite-Length Proof Finding Problem Input: an axiomatic system (a set of axioms and inference rules), a statement S, n (the maximum number of proof steps) Output: A valid proof of S with no more then n steps if there is one. If there is no proof of S with <= n steps, unprovable. At worst, we can try all possible proofs: r inference rules, 0 - n steps ~ rn possible proofs Checking each proof is  (n) So, there is a procedure that is  (nrn) but, it might not be the best one. How much work?

Proof Finding Problem Input: an axiomatic system, a statement S Output: If S is true, output a valid proof. If S is not true, output false. How much work? It is impossible! “It might take infinite work.” Gödel’s theorem says it cannot be done.

Computability

Algorithms What’s an algorithm? What’s a procedure? A procedure that always terminates. What’s a procedure? A precise (mechanizable) description of a process.

Computability Is there an algorithm that solves a problem? Decidable (computable) problems: There is an algorithm that solves the problem. Make a photomosaic, sorting, drug discovery, winning chess (it doesn’t mean we know the algorithm, but there is one) Undecidable problems: There is no algorithm that solves the problem. There might be a procedure, but it doesn’t always terminate.

Are there any undecidable problems? The Proof-Finding Problem: Input: an axiomatic system, a statement S Output: If S is true, output a valid proof. If S is not true, output false.

Any others? How would you prove a problem is undecidable? Hint: how did we prove 3-SAT was NP-Complete (once we knew Smiley Puzzle was?

Undecidable Problems We can prove a problem is undecidable by showing it is at least as hard as the proof-finding problem Here’s a famous one: Halting Problem Input: a procedure P (described by a Scheme program) and its input I Output: true if executing P on I halts (finishes execution), false otherwise.

Alan Turing (1912-1954) Codebreaker at Bletchley Park Broke Enigma Cipher Perhaps more important than Lorenz Published On Computable Numbers … (1936) Introduced the Halting Problem Formal model of computation (now known as “Turing Machine”) After the war: convicted of homosexuality (then a crime in Britain), committed suicide eating cyanide apple 5 years after Gödel’s proof!

Halting Problem Define a procedure halts? that takes a procedure and an input evaluates to #t if the procedure would terminate on that input, and to #f if would not terminate. (define (halts? procedure input) … )

Examples > (halts? ‘(lambda (x) (+ x x)) 3) #t (define (f x) (f x)) (f x)) 27) #f

Halting Examples > (halts? `(lambda (x) (define (fact n) (if (= n 1) 1 (* n (fact (- n 1))))) (fact x)) 7) #t 0) #f

Can we define halts? ? We could try for a really long time, get something to work for simple examples, but could we solve the problem – make it work for all possible inputs? Could we compute find-proof if we had halts?

find-proof I cheated a little here – we only know we can’t do this for “true”. (define (find-proof S axioms rules) ;; If S is provable, evaluates to a proof of S. ;; Otherwise, evaluates to #f. (if (halts? find-proof-exhaustive S axioms rules)) (find-proof-exhaustive S axioms rules) #f)) Where (find-proof-exhaustive S axioms rules) is a procedure that tries all possible proofs starting from the axioms that evaluates to a proof if it finds one, and keeps working if it doesn’t.

Another Informal Proof (define (contradict-halts x) (if (halts? contradict-halts null) (loop-forever) #t)) If contradict-halts halts, the if test is true and it evaluates to (loop-forever) - it doesn’t halt! If contradict-halts doesn’t halt, the if test if false, and it evaluates to #t. It halts!

Reducing Undecidable Problems If solving a problem P would allow us to solve the halting problem, then P is undecidable – there is no solution to P, since we have proved there is no solution to the halting problem! There are lots of important problems like this Friday: why virus scanners will never work perfectly

Charge Now (if you can) Marc Levoy, Newcomb South Meeting Room “Digital Michelangelo”