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 . term
Rules
Alpha Reduction: (renaming variables)
λ 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! Examples
I ≡ λ x . x
C ≡ λ x . (λ y . yx)
CII = (λx.(λy. yx)) (λx.x) (λx.x)
→_{β}
λ f . ((λ x . f
(xx)) (λ x . f
(xx)))
→_{β}
(Note: you may need some more space to finish this one.)
Making "Primitives" out of nothing but Glue
T ≡
F ≡
if ≡
cons ≡ λ xy . (λ z . zxy)
car ≡
cdr ≡
null ≡ λ p . T
null? ≡
λ x . (x λ y .
λ z . F)
zero? ≡ null?
pred ≡ cdr
succ ≡ λ x . cons F
x
0 ≡ null
1 ≡ succ 0 ≡ cons F null
2 ≡