David Evans CS200: Computer Science University of Virginia Computer Science Class 30: Models of Computation.

Slides:



Advertisements
Similar presentations
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Advertisements

CS 461 – Oct. 21 Begin chapter 3 We need a better (more encompassing) model of computation. Ex. { 1 n 2 n 3 n } couldn’t be accepted by PDA. –How could.
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.
Big Words, Busy Beavers, and The Cake of Computing David Evans flickr: mwichary TAPESTRY Workshop University of Virginia 15.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines CS 105: Introduction to Computer Science.
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.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
David Evans CS200: Computer Science University of Virginia Computer Science Class 31: Universal Turing Machines.
Lecture 14: Church-Turing Thesis Alonzo Church ( ) Alan Turing ( )
Cs3102: Theory of Computation Class 17: Undecidable Languages Spring 2010 University of Virginia David Evans.
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.
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.
David Evans CS150: Computer Science University of Virginia Computer Science Class 33: Computing with Photons From The.
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.
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.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
CS 3240: Languages and Computation
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Universal Turing Machine
CS 154 Formal Languages and Computability April 5 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
David Evans CS200: Computer Science University of Virginia Computer Science Class 26: Halting Problem It is plain at any.
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
A Universal Computer. #2#2 One-Slide Summary The Turing machine is a fundamental model of computation. It models input, output, processing and memory.
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
CS21 Decidability and Tractability
Lecture 37: A Universal Computer
Turing Machines 2nd 2017 Lecture 9.
Turing Machines, Busy Beavers, and Big Questions about Computing
Modeling Computation:
فصل سوم The Church-Turing Thesis
Theory of Computation Turing Machines.
Class 36: The Meaning of Truth CS200: Computer Science
Lecture 24: Metalinguistics CS200: Computer Science
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
Class 26: Modeling Computing CS150: Computer Science
CO Games Development 2 Week 21 Turing Machines & Computability
Lecture 23: Computability CS200: Computer Science
Presentation transcript:

David Evans CS200: Computer Science University of Virginia Computer Science Class 30: Models of Computation

2 April 2004CS 200 Spring Menu How can we model computation? Turing Machines Universal Turing Machine

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

2 April 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

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

2 April 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).

2 April 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

2 April 2004CS 200 Spring Modeling Processing Evaluation Rules –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 Is that enough to model a computer?

2 April 2004CS 200 Spring 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?

2 April 2004CS 200 Spring Finite State Machines 1 Start 2 HALT # 0

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

2 April 2004CS 200 Spring How many states do we need? 1 Start 2 HALT ( not a paren ) # ) ERRO R 3 not a paren ( ) 4 ( ) (

2 April 2004CS 200 Spring 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 a tape to the Finite State Machine

2 April 2004CS 200 Spring FSM + Infinite Tape Start: –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

2 April 2004CS 200 Spring Matching Parentheses Repeat until halt: –Find the leftmost ) 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

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

2 April 2004CS 200 Spring Matching Parentheses 1 Start HALT ), X, L 2: look for ( (, (, R (, X, R #, 0, # #, 1, # X, X, L X, X, R #, #, L 3: look for ( X, X, L #, 1, # (, 0, #

2 April 2004CS 200 Spring Turing Machine Alan Turing, On computable numbers: With an application to the Entscheidungsproblem, 1936 –Turing developed the machine abstraction to show the halting problem really leads to a contradiction –Our informal argument, depended on assuming we could do if and everything else except halts?

2 April 2004CS 200 Spring Describing Turing Machines zzzzzzzzzzzzzzzzzzzzzz TuringMachine ::= Alphabet ::= { Symbol* } Tape ::= OneSquare ::= Symbol | # Current ::= OneSquare LeftSide ::= [ Square* ] RightSide ::= [ Square* ] Everything to left of LeftSide is #. Everything to right of RightSide is #. 1 Start HALT ), X, L 2: look for ( #, 1, -  ), #, R  (, #, L (, X, R #, 0, - Finite State Machine

2 April 2004CS 200 Spring Describing Finite State Machines TuringMachine ::= FSM ::= States ::= { StateName* } InitialState ::= StateName must be element of States HaltingStates ::= { StateName* }all must be elements of States TransitionRules ::= { TransitionRule* } TransitionRule ::= < StateName, ;; Current State OneSquare, ;; Current square StateName, ;; Next State OneSquare, ;; Write on tape Direction > ;; Move tape Direction ::= L, R, # 1 Start HALT ), X, L 2: look for (  ), #, R  (, #, L (, X, R #, 0, # #, 1, # Transition Rule is a procedure: StateName X OneSquare  StateName X OneSquare X Direction

2 April 2004CS 200 Spring Example Turing Machine TuringMachine ::= FSM ::= Alphabet ::= { (, ), X } States ::= { 1, 2, HALT } InitialState ::= 1 HaltingStates ::= { HALT } TransitionRules ::= {,,,} 1 Start HALT ), X, L 2: look for (  ), #, R  (, #, L (, X, R #, 0, # #, 1, #

2 April 2004CS 200 Spring Enumerating Turing Machines Now that we’ve decided how to describe Turing Machines, we can number them TM = balancing parens TM = even number of 1s TM = Photomosaic Program TM = WindowsXP Not the real numbers – they would be much bigger!

2 April 2004CS 200 Spring Demo Electronic Flash Cards for Learning Languages Edward Mitchell, Justin Pan, Qi Wang and Chalermpong Worawannotai

2 April 2004CS 200 Spring Charge Next week: –Lambda Calculus model of computation –Very different from Turing Machines, but we will show that it is exactly as powerful!