David Evans CS200: Computer Science University of Virginia Computer Science Class 27: Modeling Computation.

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.
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
David Evans CS200: Computer Science University of Virginia Computer Science Class 30: Models of Computation.
Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 39: Lambda Calculus.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 2: Modeling Computers.
Class 19: Undecidability in Theory and Practice David Evans cs302: Theory of Computation University of Virginia Computer.
David Evans CS200: Computer Science University of Virginia Computer Science Class 31: Universal Turing Machines.
Cs3102: Theory of Computation Class 17: Undecidable Languages Spring 2010 University of Virginia David Evans.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
David Evans Turing Machines, Busy Beavers, and Big Questions about Computing.
Class 37: Uncomputability David Evans University of Virginia cs1120 Halting Problems Hockey Team.
Class 37: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
David Evans University of Virginia cs1120 Fall Lecture 38: Modeling Computing.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
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 CS588: Security and Privacy University of Virginia Computer Science Lecture 15: Complexity Notes This is selected.
What Every Biologist, Chemist, and Poet Should Know about Computer Science David Evans UVaCompBio 25 April
David Evans CS200: Computer Science University of Virginia Computer Science Class 25: Computability Halting Problems Hockey.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 18: Think Globally, Mutate Locally.
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
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 16: Universality and Undecidability.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 36: Modeling Computing.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
CS 461 – Nov. 7 Decidability concepts –Countable = can number the elements  –Uncountable = numbering scheme impossible  –A TM undecidable –Language classes.
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.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Recursively Enumerable and Recursive Languages
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 4: Programming with Data.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
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.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Introduction to Computing Science and Programming I
Lecture 4: Evaluation Rules Recursion CS200: Computer Science
Class 27: Universal Turing Machines CS150: Computer Science
Class 30: Models of Computation CS200: Computer Science
CSE 311 Foundations of Computing I
Lecture 37: A Universal Computer
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Computable Problems.
Class 36: The Meaning of Truth CS200: Computer Science
Lecture 25: Metalinguistics > (meval '((lambda (x) (* x x)) 4)
Lecture 24: Metalinguistics CS200: Computer Science
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
Formal Languages, Automata and Models of Computation
Class 24: Computability Halting Problems Hockey Team Logo
Class 31: Universal Turing Machines CS200: 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
CSE 311: Foundations of Computing
More Undecidable Problems
Lecture 23: Computability CS200: Computer Science
Presentation transcript:

David Evans CS200: Computer Science University of Virginia Computer Science Class 27: Modeling Computation

26 March 2004CS 200 Spring 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) … )

26 March 2004CS 200 Spring 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!

26 March 2004CS 200 Spring Proof by Contradiction 1.Show X is nonsensical. 2.Show that if you have A and B you can make X. 3.Show that you can make A. 4.Therefore, B must not exist. X = contradict-halts A = a Scheme interpreter that follows the evaluation rules B = halts?

26 March 2004CS 200 Spring Virus Detection Problem Problem 7. Melissa Problem Input: A Word macro (like a program, but embedded in an message) Output: true if the macro will forward the message to people in your address book; false otherwise. How can we show it is undecidable?

26 March 2004CS 200 Spring Proof by Contradiction 1.Show X is nonsensical. 2.Show that if you have A and B you can make X. 3.Show that you can make A. 4.Therefore, B must not exist. X = halts? A = a Scheme interpreter that follows the evaluation rules B = is-virus?

26 March 2004CS 200 Spring Undecidability Proof Suppose we could define is-virus? that decides the Melissa problem. Then: (define (halts? P input) (if (is-virus? ‘(begin (P input) virus-code)) #t #f)) Since it is a virus, we know virus-code was evaluated, and P must halt (assuming P wasn’t a virus). Its not a virus, so the virus-code never executed. Hence, P must not halt.

26 March 2004CS 200 Spring Undecidability Proof Suppose we could define is-virus? that decides the Melissa problem. Then: (define (halts? P input) (is-virus? ‘(begin ((vaccinate P) input) virus-code)) Where (vaccinate P) evaluates to P with all mail commands replaced with print commands (to make sure (is-virus? P input) is false.

26 March 2004CS 200 Spring Proof If we had is-virus? we could define halts? We know halts? is undecidable Hence, we can’t have is-virus? Thus, we know is-virus? is undecidable

26 March 2004CS 200 Spring How convincing is our Halting Problem 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! This “proof” assumes Scheme exists and is consistent!

26 March 2004CS 200 Spring Modeling Computation For a more convincing proof, we need a more precise (but simple) model of what a computer can do Another reason we need a model: Does  ( n ) really make sense without this?

26 March 2004CS 200 Spring How should we model a Computer? Apollo Guidance Computer (1969) Colossus (1944) IBM 5100 (1975) Cray-1 (1976)

26 March 2004CS 200 Spring Modeling Computers Input –Without it, we can’t describe a problem Output –Without it, we can’t get an answer Processing –Need some way of getting from the input to the output Memory –Need to keep track of what we are doing

26 March 2004CS 200 Spring Modeling Input Engelbart’s mouse and keypad Punch Cards Altair BASIC Paper Tape, 1976

26 March 2004CS 200 Spring Simplest Input Non-interactive: like punch cards and paper tape One-dimensional: just a single tape of values, pointer to one square on tape How long should the tape be? Infinitely long! We are modeling a computer, not building one. Our model should not have silly practical limitations (like a real computer does).

26 March 2004CS 200 Spring Modeling Output Blinking lights are cool, but hard to model Output is what is written on the tape at the end of a computation Connection Machine CM-5, 1993

26 March 2004CS 200 Spring Charge PS6 due Monday Friday: –Finite state machines with infinite tape