Inference rules for lambda calculus
Lambda calculus consists of Ξ»-expressions (Ξ»-terms)
Inference rules (evaluator)
[x βΌ v] t
means to substitute all occurrences of x
with v
in t
. It is like a let-expression, let x = v in t
, or lambda app (\x -> t) v
. It is a notation of Ξ²-reducing a lambda term, when a lambda abstraction is applied to a lambda term, but in also incorporates the notion of a substitution that is mindful of name capturing.
From left to right:
The top level lambda term is an application, distinguished by two lambda terms: the long one on the left, and a short one,
z
, on the right.We first encounter the binder with the binding occurrence of the parameter
g
.which we distinguish in the meta language by subscripting it with the index 1, as
gβ
.The first formal parameter is named
g
, and this is the binding occurrence of the parameter (variable)g
,
binds the argument z
, which means replacing all its application occurrences within its scope
, i.e. gβ
and gβ
.
However, on a closer inspection, we see there is another binding occurrence of g at gβ
that has the application occurrence of g at gβ
in its scope. That is, gβ
is bound by gβ
and gβ
by gβ
. Name capturing would be to allow the first binding occurrence gβ
to also substitute gβ
for parameter z
, aside from the only occurrence it is supposed to substitute, i.e. that of gβ
.
Therefore, we first need to rename (Ξ±-conversion) both occurrences of g that are to be treated as distinct bindings, and only then can we perform Ξ²-reduction i.e. application of the lambda to the argument z
.
We must avoid name capture by first using Ξ±-conversion on the distinct but eponymously named occurrences.
Last updated
Was this helpful?