The Untyped Lambda Calculus or the pure lambda calculus forms the computational substrate for most of the type systems.
Peter Landin observed that complex programming languages can be understood as having a tiny core with all the complex features implemented in the tiny core.
Lambda Calculus can be viewed as a simple programming language or as a mathematical object about which statements can be proved.
Everything is a function.
Definition 1 Lambda Term: It refers to any term in the lambda calculus.
Definition 2 Lambda Abstraction: Lambda terms beginning with a
are called lambda abstractions.
There are three kind of terms in the lambda calculus.
- A variable {x} itself is a term.
- The abstraction of a variable from a term written as
is a term called a lambda abstraction.
- The application of a term to another term is written as {t t}.
The grammar can be summarized as:
Syntax:
To save writing too many parenthesis the convention is that the
- application associates to the left, that is, is {s t u} is {(s t) u}.
- abstraction extend as far to the right as possible. For example,
is
.
1. Scope
A variable is said to be bound when it occurs in the body {t} of an abstraction .
A variable is said to be free if it is not bound by enclosing abstraction on {x}
An abstraction with no free variables is said to be closed or a combinator.
2. Operational Semantics
In its pure form, lambda calculus has no mechanism for computation except function application, functions are applied to arguments which are themselves functions. Each step in computation is rewriting an application by replacing the value of the bound variable of the lambda abstraction with the argument given on the right side of the application.
There can be many different evaluation strategies.
3. Multiple Arguments
4. Church Booleans
5. Pairs
6. Church Numerals
A number n is encoded by the action of applying a function s to z n times.
7. Recursion
factorial = fix (lambda fct. body containing fct)
8. Formalities
Definition 3 The set of terms is the smallest set such that
- If
, then
.
- If elements
, then
.
- If
, then
.
Definition 4 The set of free variables of a term {t}, written as
is defined as the set
![]()
![]()
.
Definition 5 Substituiton:
Syntax:
Evaluation: