Class 26: Modeling Computing CS150: Computer Science

Slides:



Advertisements
Similar presentations
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 26: Proving Uncomputability Visualization.
Advertisements

THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
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 CS200: Computer Science University of Virginia Computer Science Class 27: Modeling Computation.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 39: Lambda Calculus.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
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.
David Evans Turing Machines, Busy Beavers, and Big Questions about Computing.
Class 37: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
David Evans University of Virginia cs1120 Fall Lecture 38: Modeling Computing.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
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
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
Alan Turing WWII code-breaker mathematical proof of ‘Turing machines’ …in particular, “Universal Turing machine” laid foundations of computer science father.
David Evans CS150: Computer Science University of Virginia Computer Science Class 33: Computing with Photons From The.
Halting Problem Introduction to Computing Science and Programming I.
Cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
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.
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
Computer Theory Michael J. Watts
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Recursively Enumerable and Recursive Languages
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
David Evans CS200: Computer Science University of Virginia Computer Science Class 26: Halting Problem It is plain at any.
1 Recursively Enumerable and Recursive Languages.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
CSE202: Introduction to Formal Languages and Automata Theory
Introduction to Computing Science and Programming I
Lecture 4: Evaluation Rules Recursion CS200: Computer Science
Class 27: Universal Turing Machines CS150: Computer Science
Busch Complexity Lectures: Turing Machines
Class 30: Models of Computation CS200: Computer Science
CSE 311 Foundations of Computing I
Lecture 37: A Universal Computer
Turing Machines 2nd 2017 Lecture 9.
Turing Machines, Busy Beavers, and Big Questions about Computing
Class 19: Think Globally, Mutate Locally CS150: Computer Science
Chapter 9 TURING MACHINES.
Finite State Machines.
Theory of Computation Turing Machines.
Decidable Languages Costas Busch - LSU.
Class 36: The Meaning of Truth CS200: Computer Science
Lecture 22: P = NP? CS200: Computer Science University of Virginia
Lecture 24: Metalinguistics CS200: Computer Science
Class 37: Making Lists, Numbers and Recursion from Glue Alone
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
Formal Languages, Automata and Models of Computation
Class 33: Making Recursion M.C. Escher, Ascending and Descending
Recall last lecture and Nondeterministic TMs
Class 24: Computability Halting Problems Hockey Team Logo
Class 31: Universal Turing Machines CS200: Computer Science
Class 34: Models of Computation CS200: Computer Science
Lecture 15: Quicker Sorting CS150: Computer Science
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 26: Modeling Computing CS150: Computer Science University of Virginia Computer Science David Evans http://www.cs.virginia.edu/evans

How convincing is our Halting Problem proof? (define (contradict-halts x) (if (halts? contradict-halts null) (loop-forever) #t)) contradicts-halts cannot exist. Everything we used to make it except halts? does exist, therefore halts? cannot exist. This “proof” assumes Scheme exists and is consistent!

DrScheme Is DrScheme a proof that Scheme exists? From Lecture 13... > (time (permute-sort <= (rand-int-list 7))) cpu time: 261 real time: 260 gc time: 0 (6 7 35 47 79 82 84) > (time (permute-sort <= (rand-int-list 8))) cpu time: 3585 real time: 3586 gc time: 0 (4 10 40 50 50 58 69 84) > (time (permute-sort <= (rand-int-list 9))) Crashes!

Solutions Option 1: Prove “Idealized Scheme” does exist Show that we could implement all the evaluation rules Option 2: Find some simpler computing model Define it precisely Show that “contradict-halts” can be defined in this model

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 complexity really make sense without this? (how do we know what a “step” is? are they the same for all computers?)

How should we model a Computer? Colossus (1944) Cray-1 (1976) Apollo Guidance Computer (1969) Turing invented the model we’ll use today in 1936. What “computer” was he modeling? IBM 5100 (1975)

Turing’s “Computer” “Computing is normally done by writing certain symbols on paper. We may suppose this paper is divided into squares like a child’s arithmetic book.” Alan Turing, On computable numbers, with an application to the Entscheidungsproblem, 1936”

Modeling Computers Input Output Processing Memory 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

Modeling Input Punch Cards Altair BASIC Paper Tape, 1976 Engelbart’s mouse and keypad

Simplest Input Non-interactive: like punch cards and paper tape One-dimensional: just a single tape of values, pointer to one square on tape 1 1 1 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).

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

Modeling Processing Evaluation Rules What do we need: Given an input on our tape, how do we evaluate to produce the output What do we need: Read what is on the tape at the current square Move the tape one square in either direction Write into the current square 1 1 1 Is that enough to model a computer?

Modeling Processing Read, write and move is not enough We also need to keep track of what we are doing: How do we know whether to read, write or move at each step? How do we know when we’re done? What do we need for this?

Finite State Machines 1 2 1 Start 1 # HALT

Hmmm…maybe we don’t need those infinite tapes after all? not a paren ( not a paren 2 1 Start ) ) What if the next input symbol is ( in state 2? # ERROR HALT

How many states do we need? not a paren ( not a paren 2 not a paren 1 Start ( ) 3 ) not a paren ) # ( ERROR HALT 4 ) (

Finite State Machine There are lots of things we can’t compute with only a finite number of states Solutions: Infinite State Machine Hard to describe and draw Add an infinite tape to the Finite State Machine

Turing’s Explanation “We have said that the computable numbers are those whose decimals are calculable by finite means. ... For the present I shall only say that the justification lies in the fact that the human memory is necessarily limited.”

FSM + Infinite Tape Start: Move: Finish: FSM in Start State Input on Infinite Tape Pointer to start of input Move: Read one input symbol from tape Follow transition rule from current state To next state Write symbol on tape, and move L or R one square Finish: Transition to halt state

Matching Parentheses Find the leftmost ) Replace it with an X If you don’t find one, the parentheses match, write a 1 at the tape head and halt. Replace it with an X Look left for the first ( If you find it, replace it with an X (they matched) If you don’t find it, the parentheses didn’t match – end write a 0 at the tape head and halt

Matching Parentheses HALT Input: ) (, (, R Write: X ), X, L Move: L X, X, R 2: look for ( 1: look for ) Start (, X, R #, 1, # #, 0, # HALT Will this report the correct result for (()?

Matching Parentheses 1 (, (, R X, X, L ), X, L X, X, R #, #, L #, 1, # 2: look for ( (, X, R Start #, #, L #, 1, # #, 0, # 3: look for ( X, X, L HALT #, 1, # (, 0, #

Turing Machine (1936) z z z z z z z z z z z z z z z z z z z z z z TuringMachine ::= < Alphabet, Tape, FSM > Alphabet ::= { Symbol* } Tape ::= < LeftSide, Current, RightSide > OneSquare ::= Symbol | # Current ::= OneSquare LeftSide ::= [ Square* ] RightSide ::= [ Square* ] Everything to left of LeftSide is #. Everything to right of RightSide is #. ), X, L ), #, R (, #, L 1 2: look for ( Start (, X, R HALT #, 1, - #, 0, - Finite State Machine

Charge Wednesday: Friday: Monday: PS6 Due Universal Turing Machines Lambda Calculus (another simple model of computation, and the basis for Scheme) Monday: PS6 Due