Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia.

Slides:



Advertisements
Similar presentations
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
David Evans CS200: Computer Science University of Virginia Computer Science Class 30: Models of Computation.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 39: Lambda Calculus.
Applied Computer Science II Chapter 3 : Turing Machines Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 40: Computing with Glue and Photons.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Turing Machines CS 105: Introduction to Computer Science.
Class 19: Undecidability in Theory and Practice David Evans cs302: Theory of Computation University of Virginia Computer.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
David Evans CS200: Computer Science University of Virginia Computer Science Class 31: Universal Turing Machines.
Lecture 14: Church-Turing Thesis Alonzo Church ( ) Alan Turing ( )
Turing Machines Chapter Plan Turing Machines(TMs) – Alan Turing Church-Turing Thesis – Definitions Computation Configuration Recognizable vs. Decidable.
Lecture 20: λ Calculus λ Calculus & Computability Yan Huang Dept. of Comp. Sci. University of Virginia.
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: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
Lambda Calculus History and Syntax. History The lambda calculus is a formal system designed to investigate function definition, function application and.
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
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.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Computation Motivating questions: What does “computation” mean? What are the similarities and differences between computation in computers and in natural.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Capabilities of computing systems Numeric and symbolic Computations A look at Computability theory Turing Machines.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
Recursively Enumerable and Recursive Languages
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
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.
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
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
David Evans CS150: Computer Science University of Virginia Computer Science Class 32: Computability in Theory and Practice.
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:
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
David Evans CS200: Computer Science University of Virginia Computer Science Class 26: Halting Problem It is plain at any.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
A Universal Computer. #2#2 One-Slide Summary The Turing machine is a fundamental model of computation. It models input, output, processing and memory.
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
Lambda Calculus Revisited
Turing Machines, Busy Beavers, and Big Questions about Computing
فصل سوم The Church-Turing Thesis
Decidable Languages Costas Busch - LSU.
Class 36: The Meaning of Truth 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
The Church-Turing Thesis and Turing-completeness
CO Games Development 2 Week 21 Turing Machines & Computability
Presentation transcript:

Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia

Menu Recap Turing Machine from last class Halting Problem for Turing Machines: – Proof that the Halting Problem for TMs is noncomputable – Universal Turing Machines: one TM that can simulate every other TM Church-Turing Thesis: all reasonable computing models are equivalent! Lambda Calculus: an alternate computing model, equivalent to Turing Machine

Recap: Turing’s Model 1 Start 2 Input: # Write: # Move:  # # Input: 1 Write: 0 Move:  Input: 1 Write: 1 Move:  Input: 0 Write: 0 Move:  3 Input: 0 Write: # Move: Halt Infinite Tape: Finite set of symbols, one in each square Can read/write one square each step Controller: Limited (finite) number of states Follow rules based on current state and read symbol Write one square each step, move left or right or halt, change state

Turing Machine State 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 Although we typically draw TMs as pictures, we could write them down as strings in this language (which could be converted to whole numbers) Although we typically draw TMs as pictures, we could write them down as strings in this language (which could be converted to whole numbers) Infinite Tape

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 = Universal TM TM = WindowsXP Not the real numbers – they would be much much much much much bigger!

Halting Problem Pythonic Halting ProblemTM Halting Problem Input: a string describing a Turing Machine, M Output: if M would eventually Halt, output True; otherwise, output False. Input: a string describing a Python program, P Output: if evaluating P would eventually finish, output True; otherwise, output False.

Halting Problem “Proof” def paradox(): if halts('paradox()'): while True: pass Pythonic Halting Problem TM Halting Problem HALTS(M) = TM that solves TM Halting Problem: input tape describes TM M, output tape: #1 if M halts, otherwise #0 PARADOX = TM that: 1. simulates HALTS(PARADOX) 2. Then, if tape is #1, loop forever; if tape is #0, HALT simulates? This proof assumes we can design a TM that simulates any other TM!

An Any TM Simulator Input: Output: result of running M on w Universal Turing Machine M w Output Tape for running TM- M starting on tape w

Manchester Illuminated Universal Turing Machine, #9 from

Universal Computing Machine 2-state, 3-symbol Turing machine proved universal by Alex Smith in 2007 Alex Smith, University of Birmingham

What This Means If you can: – Keep track of a finite state – Follow transition rules – Read and write to memory you can simulate a universal Turing machine. A Turing machine can simulate the world’s most powerful supercomputer – Thus, your cell phone can simulate the world’s most powerful supercomputer (it’ll just take a lot longer and will run out of memory) No computer that can be simulated by a TM can solve the Halting Problem

Church-Turing Thesis All mechanical computers are equally powerful (except for practical limits like memory size, time, display, energy, etc.) There exists some Turing machine that can simulate any mechanical computer Any computer that is powerful enough to simulate a Turing machine, can simulate any mechanical computer Alonzo Church, Alan Turing,

Church’s Computing Model: Lambda Calculus Developed in 1930s in attempt to formalize mathematics (similar to Bertrand Russell’s goals) Became model of computing Basis of LISP and Scheme

What is Calculus? d/dx x n = nx n-1 [Power Rule] d/dx (f + g) = d/dx f + d/dx g [Sum Rule] Calculus is a branch of mathematics that deals with limits and the differentiation and integration of functions of one or more variables...

Real Definition A calculus is just a bunch of rules for manipulating symbols. People can give meaning to those symbols, but that’s not part of the calculus. Differential calculus is a bunch of rules for manipulating symbols. There is an interpretation of those symbols corresponds with physics, slopes, etc.

Lambda Calculus Rules for manipulating strings of symbols term = variable | term term | (term) | variable. term One main rule:  -reduction ( ( x. M)N )   M with all x ’s in M replaced by N This is a lot like Scheme, without primitives, special forms, mutation! Note: I have slightly altered the traditional syntax to make it more like Scheme.

Lambda Calculus Developed in 1930s in attempt to formalize mathematics (similar to Bertrand Russell’s goals) Original attempt was inconsistent! – Kleene-Rosser Paradox: k = x.  (x x) (k k) = x.  (x x)k =  (k k) Church’s solution: model computation not logic (k k) is a nonterminating recursive definition, not a contradiction! (k k)   (k k)   (k k)   (k k) ...

Evaluating Lambda Expressions redex: Term of the form ( ( x. M)N ) Something that can be  - reduced An expression is in normal form if it contains no redexes. To evaluate a lambda expression, keep doing reductions until you get to normal form.

Some Simple Functions I  x.x C  x.( y. yx) ((C I) I) = ((( x.( y. yx)) ( x.x)) ( x.x))   (( y. y ( x.x)) ( x.x))   ( x.x ( x.x))   x.x  I

Power of Lambda Calculus Is Lambda Calculus a universal language? – Can we compute any computable algorithm using Lambda Calculus? Option 1: Prove it is not – Find some Turing Machine that cannot be simulated with Lambda Calculus Option 2: Prove it is: – Show you can simulate every Turing Machine using Lambda Calculus Since a Universal Turing Machine can simulate every other TM, it is enough to show we can simulate a Universal Turing Machine using Lambda Calculus

Simulating a Turing Machine zzzzzzzzzzzzzzzzzzzz 1 Start HALT ), X, L 2: look for ( #, 1, -  ), #, R  (, #, L (, X, R #, 0, - Finite State Machine Read/Write Infinite Tape Lists Finite State Machine Numbers Processing Way to make decisions (if) Way to keep going Continued on Friday...