A Crash Course on the λ-Calculus
Jim Royer
Types Seminar
January 21, 2014
Jim Royer A Crash Course on the λ-Calculus 1 / 24
References
- J. Roger Hindley, Basic Simple Type Theory, Cambridge, 1997.
- D. Scott, A type-theoretical alternative to ISWIM, CUCH, OWHY,
Theoretical Computer Science 121 (1993) 411–440. Originally written in 1969.
Jim Royer A Crash Course on the λ-Calculus 2 / 24
The λ-calculus
Church (with Kleene and Rosser) in the 1930s. A family of prototype programming languages. Functional and higher-order. The pure λ-calculus ≡ no atomic constants. Untyped (or uni-typed) considered first. Syntax: E ::= X variables/atoms/. .. | (E1 E2) applications | (λX.E) abstractions Associativity: λxyz.M ≡ (λx.(λy.(λz.M))) MNPQ ≡ (((MN)P)Q)
Jim Royer A Crash Course on the λ-Calculus 3 / 24
Subterms, occurrences, free, and bound
subterms(x) = { x } subterms( (λx.M) ) = { λx.M } ∪ subterms(M) subterms( (M N) ) = { (M N) } ∪ subterms(M) ∪ subterms(N) An occurrence of a subterm is . . . roughly what you think it is . . . λx.M λx: an abstractor and x (in λx): binding occurrence of x M: the body or scope of the abstractor λx. Free and bound occurrences and variables An occurrence of variable x in M is bound in M iff the occurrence is in the scope of some λx in M; o/w the occurrence is said to be free. A variable x is bound in M iff an λx occurs in M. A variable x is free in M iff M contains a free occurrence of x. FV(M) = the set of variables free in M.
Jim Royer A Crash Course on the λ-Calculus 4 / 24