CS200: Computer Science, Spring 2003

Notes: Friday 11 April 2003
Schedule
 SaturdayWednesday: Design reviews
 Friday, 18 April: Exam 2 out
 Wednesday, 23 April: Exam 2 Due
 28 April (9am): Problem Set 8 Due
Notes Universal Turing Machine
A Turing Machine that can simulate any other Turing Machine on an input: TM_{U} (P, I) = the output of running TMP on input I
What is a calculus?
What properties make Scheme too complex to be a good model of computation?
Lambda Calculus is a set of rules for manipulating symbols. They can be given meanings that map well to computation.
Lambda Calculus Term Grammar
term ::= variable
term ::= term term
term ::= ( term )
term ::= λ variable . termRules
Alpha Reduction: (renaming variables)Uninteresting Reduction Rulesλ y . M ⇒_{α} λ v . M [y → v]) where v does not occur in M.We can change the name of a lambda variable by replacing all occurances of the variable in the body term with a new name that does not appear in the body term.Beta Reduction: (substitution)
(λ x . M) N ⇒_{β} M [ x → N ]All computation can be modeled using Beta Reduction!M ⇒ M
PM ⇒ PN if M ⇒ N
MP ⇒ NP if M ⇒ N
λ x . M ⇒ λ x . N ⇒ if M ⇒ N
M ⇒ P if M ⇒ N and N ⇒ PExample
λ f . ((λ x . f (xx)) (λ x . f (xx)))

cs200staff@cs.virginia.edu Using these Materials 