Docsity

Universal Turing Machines and Lambda Calculus: Description, Enumeration, and Equivalence, Slides of Computer Science

Partial preview of the text

Download Universal Turing Machines and Lambda Calculus: Description, Enumeration, and Equivalence and more Slides Computer Science in PDF only on Docsity!

David Evans http://www.cs.virginia.edu/evans CS200: Computer Science University of Virginia Computer Science

Class 31:

Universal

Turing

Machines

Menu

  • (^) Review: Modeling Computation
  • (^) Universal Turing Machines
  • (^) Lambda Calculus

5 April 2004 CS 200 Spring 2004 4

Describing

Finite State

Machines

TuringMachine ::= < Alphabet , Tape , FSM > FSM ::= < States , TransitionRules , InitialState , HaltingStates > 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 , # Start 1 HAL T ), X, L 2: look for ( ), #, R (, #, L (, X, R #, 1, #^ #, 0, # Transition Rule is a procedure: StateName X OneSquareStateName X OneSquare X Direction

Enumerating Turing Machines

  • (^) Now that we’ve decided how to describe Turing Machines, we can number them
  • (^) TM-5023582376 = balancing parens
  • (^) TM-57239683 = even number of 1s
  • (^) TM- 3523796834721038296738259873 = Photomosaic Program
  • (^) TM- 3672349872381692309875823987609823712347823 = WindowsXP Not the real numbers – they would be much bigger!

Universal Turing Machine

Universal

Turing

Machine

P

Number of TM

I

Input

Tape

also, just a number! Output Tape for running TM- P in tape I Can we make a Universal Turing Machine?

Yes!

  • (^) People have designed Universal Turing Machines with - (^) 4 symbols, 7 states (Marvin Minsky) - (^) 4 symbols, 5 states - (^) 2 symbols, 22 states - (^) 18 symbols, 2 states
  • (^) No one knows what the smallest possible UTM is

Church-Turing Thesis

  • (^) Any mechanical computation can be performed by a Turing Machine
  • (^) There is a TM- n corresponding to every decidable problem
  • (^) We can simulate one step on any “normal” (classical mechanics) computer with a constant number of steps on a TM: - (^) If a problem is in P on a TM, it is in P on an iMac, CM5, Cray, Palm, etc. - (^) But maybe not a quantum computer!

Universal Language

  • (^) Is Scheme as powerful as a Universal Turing Machine?
  • (^) Is a Universal Turing Machine as powerful as Scheme?

-calculus

Alonzo Church, 1940 (LISP was developed from -calculus, not the other way round.) term = variable | term term | ( term ) |variable. term

What is Calculus?

  • (^) In High School: d/dx xn^ = nxn-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...

Lambda Calculus

  • (^) Rules for manipulating strings of symbols in the language: term = variable | term term | ( term ) |variable. term
  • (^) Humans can give meaning to those symbols in a way that corresponds to computations.

Why?

  • (^) Once we have precise and formal rules for manipulating symbols, we can use it to reason with.
  • (^) Since we can interpret the symbols as representing computations, we can use it to reason about programs.

Reduction (Uninteresting Rules)

y. M   v. ( M [ y v ]) where v does not occur in M. MM MNPMPN MNMPNP MN   x. M   x. N MN and NPMP

-Reduction

(the source of all computation)

( x. M ) N  M [ x  N ]