<s>
Lambda	B-General_Concept
calculus	O
(	O
also	O
written	O
as	O
λ-calculus	O
)	O
is	O
a	O
formal	O
system	O
in	O
mathematical	O
logic	O
for	O
expressing	O
computation	O
based	O
on	O
function	O
abstraction	B-Application
and	O
application	B-Algorithm
using	O
variable	O
binding	O
and	O
substitution	O
.	O
</s>
<s>
It	O
is	O
a	O
universal	O
model	O
of	O
computation	O
that	O
can	O
be	O
used	O
to	O
simulate	O
any	O
Turing	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
Lambda	B-General_Concept
calculus	O
consists	O
of	O
constructing	O
lambda	B-General_Concept
terms	O
and	O
performing	O
reduction	O
operations	O
on	O
them	O
.	O
</s>
<s>
In	O
the	O
simplest	O
form	O
of	O
lambda	B-General_Concept
calculus	O
,	O
terms	O
are	O
built	O
using	O
only	O
the	O
following	O
rules	O
:	O
</s>
<s>
–	O
abstraction	B-Application
,	O
function	O
definition	O
(	O
is	O
a	O
lambda	B-General_Concept
term	O
)	O
.	O
</s>
<s>
–	O
application	B-Algorithm
,	O
applying	O
a	O
function	O
to	O
an	O
argument	O
.	O
</s>
<s>
Both	O
and	O
are	O
lambda	B-General_Concept
terms	O
.	O
</s>
<s>
–	O
β-reduction	O
,	O
replacing	O
the	O
bound	O
variables	O
with	O
the	O
argument	O
expression	O
in	O
the	O
body	O
of	O
the	O
abstraction	B-Application
.	O
</s>
<s>
If	O
repeated	O
application	B-Algorithm
of	O
the	O
reduction	O
steps	O
eventually	O
terminates	O
,	O
then	O
by	O
the	O
Church	O
–	O
Rosser	O
theorem	O
it	O
will	O
produce	O
a	O
β-normal	B-Application
form	I-Application
.	O
</s>
<s>
Variable	O
names	O
are	O
not	O
needed	O
if	O
using	O
a	O
universal	O
lambda	B-General_Concept
function	I-General_Concept
,	O
such	O
as	O
Iota	B-Application
and	I-Application
Jot	I-Application
,	O
which	O
can	O
create	O
any	O
function	O
behavior	O
by	O
calling	O
it	O
on	O
itself	O
in	O
various	O
combinations	O
.	O
</s>
<s>
Lambda	B-General_Concept
calculus	O
is	O
Turing	B-Algorithm
complete	I-Algorithm
,	O
that	O
is	O
,	O
it	O
is	O
a	O
universal	O
model	O
of	O
computation	O
that	O
can	O
be	O
used	O
to	O
simulate	O
any	O
Turing	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
Its	O
namesake	O
,	O
the	O
Greek	O
letter	O
lambda	B-General_Concept
( λ	O
)	O
,	O
is	O
used	O
in	O
lambda	B-General_Concept
expressions	I-General_Concept
and	O
lambda	B-General_Concept
terms	O
to	O
denote	O
binding	O
a	O
variable	O
in	O
a	O
function	O
.	O
</s>
<s>
Lambda	B-General_Concept
calculus	O
may	O
be	O
untyped	O
or	O
typed	O
.	O
</s>
<s>
In	O
typed	O
lambda	B-General_Concept
calculus	O
,	O
functions	O
can	O
be	O
applied	O
only	O
if	O
they	O
are	O
capable	O
of	O
accepting	O
the	O
given	O
input	O
's	O
"	O
type	O
"	O
of	O
data	O
.	O
</s>
<s>
Typed	O
lambda	B-General_Concept
calculi	O
are	O
weaker	O
than	O
the	O
untyped	B-Application
lambda	I-Application
calculus	I-Application
,	O
which	O
is	O
the	O
primary	O
subject	O
of	O
this	O
article	O
,	O
in	O
the	O
sense	O
that	O
typed	O
lambda	B-General_Concept
calculi	O
can	O
express	O
less	O
than	O
the	O
untyped	O
calculus	O
can	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
typed	O
lambda	B-General_Concept
calculi	O
allow	O
more	O
things	O
to	O
be	O
proven	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
simply	O
typed	O
lambda	B-General_Concept
calculus	O
it	O
is	O
a	O
theorem	O
that	O
every	O
evaluation	B-Language
strategy	I-Language
terminates	O
for	O
every	O
simply	O
typed	O
lambda-term	O
,	O
whereas	O
evaluation	O
of	O
untyped	O
lambda-terms	O
need	O
not	O
terminate	O
.	O
</s>
<s>
One	O
reason	O
there	O
are	O
many	O
different	O
typed	O
lambda	B-General_Concept
calculi	O
has	O
been	O
the	O
desire	O
to	O
do	O
more	O
(	O
of	O
what	O
the	O
untyped	O
calculus	O
can	O
do	O
)	O
without	O
giving	O
up	O
on	O
being	O
able	O
to	O
prove	O
strong	O
theorems	O
about	O
the	O
calculus	O
.	O
</s>
<s>
Lambda	B-General_Concept
calculus	O
has	O
applications	O
in	O
many	O
different	O
areas	O
in	O
mathematics	O
,	O
philosophy	O
,	O
linguistics	O
,	O
and	O
computer	B-General_Concept
science	I-General_Concept
..	O
Lambda	B-General_Concept
calculus	O
has	O
played	O
an	O
important	O
role	O
in	O
the	O
development	O
of	O
the	O
theory	O
of	O
programming	O
languages	O
.	O
</s>
<s>
Functional	B-Language
programming	I-Language
languages	I-Language
implement	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
Lambda	B-General_Concept
calculus	O
is	O
also	O
a	O
current	O
research	O
topic	O
in	O
category	O
theory	O
.	O
</s>
<s>
The	O
lambda	B-General_Concept
calculus	O
was	O
introduced	O
by	O
mathematician	O
Alonzo	O
Church	O
in	O
the	O
1930s	O
as	O
part	O
of	O
an	O
investigation	O
into	O
the	O
foundations	O
of	O
mathematics	O
.	O
</s>
<s>
The	O
original	O
system	O
was	O
shown	O
to	O
be	O
logically	B-General_Concept
inconsistent	I-General_Concept
in	O
1935	O
when	O
Stephen	O
Kleene	O
and	O
J	O
.	O
</s>
<s>
Subsequently	O
,	O
in	O
1936	O
Church	O
isolated	O
and	O
published	O
just	O
the	O
portion	O
relevant	O
to	O
computation	O
,	O
what	O
is	O
now	O
called	O
the	O
untyped	B-Application
lambda	I-Application
calculus	I-Application
.	O
</s>
<s>
In	O
1940	O
,	O
he	O
also	O
introduced	O
a	O
computationally	O
weaker	O
,	O
but	O
logically	O
consistent	O
system	O
,	O
known	O
as	O
the	O
simply	O
typed	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
Until	O
the	O
1960s	O
when	O
its	O
relation	O
to	O
programming	O
languages	O
was	O
clarified	O
,	O
the	O
lambda	B-General_Concept
calculus	O
was	O
only	O
a	O
formalism	O
.	O
</s>
<s>
Thanks	O
to	O
Richard	O
Montague	O
and	O
other	O
linguists	O
 '	O
applications	O
in	O
the	O
semantics	B-Application
of	O
natural	O
language	O
,	O
the	O
lambda	B-General_Concept
calculus	O
has	O
begun	O
to	O
enjoy	O
a	O
respectable	O
place	O
in	O
both	O
linguistics	O
and	O
computer	B-General_Concept
science	I-General_Concept
.	O
</s>
<s>
There	O
is	O
some	O
uncertainty	O
over	O
the	O
reason	O
for	O
Church	O
's	O
use	O
of	O
the	O
Greek	O
letter	O
lambda	B-General_Concept
( λ	O
)	O
as	O
the	O
notation	O
for	O
function-abstraction	O
in	O
the	O
lambda	B-General_Concept
calculus	O
,	O
perhaps	O
in	O
part	O
due	O
to	O
conflicting	O
explanations	O
by	O
Church	O
himself	O
.	O
</s>
<s>
In	O
[	O
an	O
unpublished	O
1964	O
letter	O
to	O
Harald	O
Dickson ]	O
he	O
stated	O
clearly	O
that	O
it	O
came	O
from	O
the	O
notation	O
“”	O
used	O
for	O
class-abstraction	O
by	O
Whitehead	O
and	O
Russell	O
,	O
by	O
first	O
modifying	O
“”	O
to	O
“”	O
to	O
distinguish	O
function-abstraction	O
from	O
class-abstraction	O
,	O
and	O
then	O
changing	O
“”	O
to	O
“	O
λ	O
”	O
for	O
ease	O
of	O
printing	O
.	O
</s>
<s>
Scott	O
recounts	O
that	O
he	O
once	O
posed	O
a	O
question	O
about	O
the	O
origin	O
of	O
the	O
lambda	B-General_Concept
symbol	O
to	O
Church	O
's	O
former	O
student	O
and	O
son-in-law	O
John	O
W	O
.	O
Addison	O
Jr.	O
,	O
who	O
then	O
wrote	O
his	O
father-in-law	O
a	O
postcard	O
:	O
</s>
<s>
Why	O
did	O
you	O
choose	O
lambda	B-General_Concept
for	O
your	O
operator	O
?	O
</s>
<s>
Computable	O
functions	O
are	O
a	O
fundamental	O
concept	O
within	O
computer	B-General_Concept
science	I-General_Concept
and	O
mathematics	O
.	O
</s>
<s>
The	O
lambda	B-General_Concept
calculus	O
provides	O
simple	O
semantics	B-Application
for	O
computation	O
which	O
are	O
useful	O
for	O
formally	O
studying	O
properties	O
of	O
computation	O
.	O
</s>
<s>
The	O
lambda	B-General_Concept
calculus	O
incorporates	O
two	O
simplifications	O
that	O
make	O
its	O
semantics	B-Application
simple	O
.	O
</s>
<s>
The	O
first	O
simplification	O
is	O
that	O
the	O
lambda	B-General_Concept
calculus	O
treats	O
functions	O
"	O
anonymously	O
;	O
"	O
it	O
does	O
not	O
give	O
them	O
explicit	O
names	O
.	O
</s>
<s>
(	O
which	O
is	O
read	O
as	O
"	O
a	O
tuple	B-Application
of	O
and	O
is	O
mapped	O
to	O
"	O
)	O
.	O
</s>
<s>
The	O
second	O
simplification	O
is	O
that	O
the	O
lambda	B-General_Concept
calculus	O
only	O
uses	O
functions	O
of	O
a	O
single	O
input	O
.	O
</s>
<s>
This	O
method	O
,	O
known	O
as	O
currying	B-Application
,	O
transforms	O
a	O
function	O
that	O
takes	O
multiple	O
arguments	O
into	O
a	O
chain	O
of	O
functions	O
each	O
with	O
a	O
single	O
argument	O
.	O
</s>
<s>
The	O
lambda	B-General_Concept
calculus	O
consists	O
of	O
a	O
language	O
of	O
lambda	B-General_Concept
terms'''	O
,	O
that	O
are	O
defined	O
by	O
a	O
certain	O
formal	O
syntax	O
,	O
and	O
a	O
set	O
of	O
transformation	O
rules	O
for	O
manipulating	O
the	O
lambda	B-General_Concept
terms	O
.	O
</s>
<s>
As	O
described	O
above	O
,	O
having	O
no	O
names	O
,	O
all	O
functions	O
in	O
the	O
lambda	B-General_Concept
calculus	O
are	O
anonymous	B-General_Concept
functions	I-General_Concept
.	O
</s>
<s>
They	O
only	O
accept	O
one	O
input	O
variable	O
,	O
so	O
currying	B-Application
is	O
used	O
to	O
implement	O
functions	O
of	O
several	O
variables	O
.	O
</s>
<s>
The	O
syntax	O
of	O
the	O
lambda	B-General_Concept
calculus	O
defines	O
some	O
expressions	O
as	O
valid	O
lambda	B-General_Concept
calculus	O
expressions	O
and	O
some	O
as	O
invalid	O
,	O
just	O
as	O
some	O
strings	O
of	O
characters	O
are	O
valid	O
C	B-Language
programs	I-Language
and	O
some	O
are	O
not	O
.	O
</s>
<s>
A	O
valid	O
lambda	B-General_Concept
calculus	O
expression	O
is	O
called	O
a	O
"	O
lambda	B-General_Concept
term	O
"	O
.	O
</s>
<s>
variable	O
is	O
itself	O
a	O
valid	O
lambda	B-General_Concept
term	O
.	O
</s>
<s>
if	O
is	O
a	O
lambda	B-General_Concept
term	O
,	O
and	O
is	O
a	O
variable	O
,	O
then	O
is	O
a	O
lambda	B-General_Concept
term	O
(	O
called	O
an	O
abstraction	B-Application
)	O
;	O
</s>
<s>
if	O
and	O
are	O
lambda	B-General_Concept
terms	O
,	O
then	O
is	O
a	O
lambda	B-General_Concept
term	O
(	O
called	O
an	O
application	B-Algorithm
)	O
.	O
</s>
<s>
Nothing	O
else	O
is	O
a	O
lambda	B-General_Concept
term	O
.	O
</s>
<s>
Thus	O
a	O
lambda	B-General_Concept
term	O
is	O
valid	O
if	O
and	O
only	O
if	O
it	O
can	O
be	O
obtained	O
by	O
repeated	O
application	B-Algorithm
of	O
these	O
three	O
rules	O
.	O
</s>
<s>
An	O
abstraction	B-Application
denotes	O
an	O
§	O
anonymous	B-General_Concept
function	I-General_Concept
that	O
takes	O
a	O
single	O
input	O
and	O
returns	O
.	O
</s>
<s>
For	O
example	O
,	O
is	O
an	O
abstraction	B-Application
for	O
the	O
function	O
using	O
the	O
term	O
for	O
.	O
</s>
<s>
The	O
name	O
is	O
superfluous	O
when	O
using	O
abstraction	B-Application
.	O
</s>
<s>
The	O
definition	O
of	O
a	O
function	O
with	O
an	O
abstraction	B-Application
merely	O
"	O
sets	O
up	O
"	O
the	O
function	O
but	O
does	O
not	O
invoke	O
it	O
.	O
</s>
<s>
An	O
application	B-Algorithm
represents	O
the	O
application	B-Algorithm
of	O
a	O
function	O
to	O
an	O
input	O
,	O
that	O
is	O
,	O
it	O
represents	O
the	O
act	O
of	O
calling	O
function	O
on	O
input	O
to	O
produce	O
.	O
</s>
<s>
There	O
is	O
no	O
concept	O
in	O
lambda	B-General_Concept
calculus	O
of	O
variable	O
declaration	O
.	O
</s>
<s>
)	O
,	O
in	O
lambda	B-General_Concept
calculus	O
is	O
a	O
variable	O
that	O
is	O
not	O
yet	O
defined	O
.	O
</s>
<s>
The	O
abstraction	B-Application
is	O
syntactically	O
valid	O
,	O
and	O
represents	O
a	O
function	O
that	O
adds	O
its	O
input	O
to	O
the	O
yet-unknown	O
.	O
</s>
<s>
which	O
is	O
of	O
form	O
—	O
an	O
application	B-Algorithm
.	O
</s>
<s>
The	O
examples	O
1	O
and	O
2	O
denote	O
different	O
terms	O
;	O
except	O
for	O
the	O
scope	B-Language
of	O
the	O
parentheses	O
they	O
would	O
be	O
the	O
same	O
.	O
</s>
<s>
But	O
example	O
1	O
is	O
a	O
function	O
definition	O
,	O
while	O
example	O
2	O
is	O
function	B-Algorithm
application	I-Algorithm
.	O
</s>
<s>
Lambda	B-General_Concept
variable	O
is	O
a	O
placeholder	O
in	O
both	O
examples	O
.	O
</s>
<s>
Here	O
,	O
example	O
1	O
defines	O
a	O
function	O
,	O
where	O
is	O
,	O
an	O
anonymous	B-General_Concept
function	I-General_Concept
,	O
with	O
input	O
;	O
while	O
example	O
2	O
,	O
,	O
is	O
M	O
applied	O
to	O
N	O
,	O
where	O
is	O
the	O
lambda	B-General_Concept
term	O
being	O
applied	O
to	O
the	O
input	O
which	O
is	O
.	O
</s>
<s>
In	O
lambda	B-General_Concept
calculus	O
,	O
functions	O
are	O
taken	O
to	O
be	O
'	O
first	B-Application
class	I-Application
values	O
 '	O
,	O
so	O
functions	O
may	O
be	O
used	O
as	O
the	O
inputs	O
,	O
or	O
be	O
returned	O
as	O
outputs	O
from	O
other	O
functions	O
.	O
</s>
<s>
In	O
lambda	B-General_Concept
calculus	O
,	O
function	B-Algorithm
application	I-Algorithm
is	O
regarded	O
as	O
left-associative	O
,	O
so	O
that	O
means	O
.	O
</s>
<s>
There	O
are	O
several	O
notions	O
of	O
"	O
equivalence	O
"	O
and	O
"	O
reduction	O
"	O
that	O
allow	O
lambda	B-General_Concept
terms	O
to	O
be	O
"	O
reduced	O
"	O
to	O
"	O
equivalent	O
"	O
lambda	B-General_Concept
terms	O
.	O
</s>
<s>
A	O
basic	O
form	O
of	O
equivalence	O
,	O
definable	O
on	O
lambda	B-General_Concept
terms	O
,	O
is	O
alpha	O
equivalence	O
.	O
</s>
<s>
It	O
captures	O
the	O
intuition	O
that	O
the	O
particular	O
choice	O
of	O
a	O
bound	O
variable	O
,	O
in	O
an	O
abstraction	B-Application
,	O
does	O
not	O
(	O
usually	O
)	O
matter	O
.	O
</s>
<s>
For	O
instance	O
,	O
and	O
are	O
alpha-equivalent	O
lambda	B-General_Concept
terms	O
,	O
and	O
they	O
both	O
represent	O
the	O
same	O
function	O
(	O
the	O
identity	O
function	O
)	O
.	O
</s>
<s>
The	O
terms	O
and	O
are	O
not	O
alpha-equivalent	O
,	O
because	O
they	O
are	O
not	O
bound	O
in	O
an	O
abstraction	B-Application
.	O
</s>
<s>
In	O
many	O
presentations	O
,	O
it	O
is	O
usual	O
to	O
identify	O
alpha-equivalent	O
lambda	B-General_Concept
terms	O
.	O
</s>
<s>
The	O
free	O
variables	O
of	O
a	O
term	O
are	O
those	O
variables	O
not	O
bound	O
by	O
an	O
abstraction	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
the	O
lambda	B-General_Concept
term	O
representing	O
the	O
identity	O
has	O
no	O
free	O
variables	O
,	O
but	O
the	O
function	O
has	O
a	O
single	O
free	O
variable	O
,	O
.	O
</s>
<s>
Suppose	O
,	O
and	O
are	O
lambda	B-General_Concept
terms	O
,	O
and	O
and	O
are	O
variables	O
.	O
</s>
<s>
if	O
and	O
does	O
not	O
appear	O
among	O
the	O
free	O
variables	O
of	O
(	O
is	O
said	O
to	O
be	O
"	O
fresh	O
"	O
for	O
)	O
;	O
substituting	O
a	O
variable	O
which	O
is	O
not	O
bound	O
by	O
an	O
abstraction	B-Application
proceeds	O
in	O
the	O
abstraction	B-Application
's	O
body	O
,	O
provided	O
that	O
the	O
abstracted	O
variable	O
is	O
"	O
fresh	O
"	O
for	O
the	O
substitution	O
term	O
.	O
</s>
<s>
For	O
example	O
,	O
switching	O
back	O
to	O
our	O
correct	O
notion	O
of	O
substitution	O
,	O
in	O
the	O
abstraction	B-Application
can	O
be	O
renamed	O
with	O
a	O
fresh	O
variable	O
,	O
to	O
obtain	O
,	O
and	O
the	O
meaning	O
of	O
the	O
function	O
is	O
preserved	O
by	O
substitution	O
.	O
</s>
<s>
In	O
a	O
functional	B-Language
programming	I-Language
language	I-Language
where	O
functions	O
are	O
first	B-Application
class	I-Application
citizens	O
,	O
this	O
systematic	O
change	O
in	O
variables	O
to	O
avoid	O
capture	O
of	O
a	O
free	O
variable	O
can	O
introduce	O
an	O
error	O
,	O
when	O
returning	O
functions	O
as	O
results	O
.	O
</s>
<s>
The	O
β-reduction	O
rule	O
states	O
that	O
an	O
application	B-Algorithm
of	O
the	O
form	O
reduces	O
to	O
the	O
term	O
.	O
</s>
<s>
The	O
lambda	B-General_Concept
calculus	O
may	O
be	O
seen	O
as	O
an	O
idealized	O
version	O
of	O
a	O
functional	B-Language
programming	I-Language
language	I-Language
,	O
like	O
Haskell	B-Language
or	O
Standard	B-Language
ML	I-Language
.	O
</s>
<s>
In	O
the	O
untyped	B-Application
lambda	I-Application
calculus	I-Application
,	O
as	O
presented	O
here	O
,	O
this	O
reduction	O
process	O
may	O
not	O
terminate	O
.	O
</s>
<s>
Another	O
aspect	O
of	O
the	O
untyped	B-Application
lambda	I-Application
calculus	I-Application
is	O
that	O
it	O
does	O
not	O
distinguish	O
between	O
different	O
kinds	O
of	O
data	O
.	O
</s>
<s>
However	O
,	O
in	O
the	O
untyped	B-Application
lambda	I-Application
calculus	I-Application
,	O
there	O
is	O
no	O
way	O
to	O
prevent	O
a	O
function	O
from	O
being	O
applied	O
to	O
truth	O
values	O
,	O
strings	O
,	O
or	O
other	O
non-number	O
objects	O
.	O
</s>
<s>
Lambda	B-General_Concept
expressions	I-General_Concept
are	O
composed	O
of	O
:	O
</s>
<s>
the	O
abstraction	B-Application
symbols	O
λ	O
(	O
lambda	B-General_Concept
)	O
and	O
.	O
</s>
<s>
The	O
set	O
of	O
lambda	B-General_Concept
expressions	I-General_Concept
,	O
,	O
can	O
be	O
defined	O
inductively	O
:	O
</s>
<s>
Instances	O
of	O
rule	O
2	O
are	O
known	O
as	O
abstractions	B-Application
and	O
instances	O
of	O
rule	O
3	O
are	O
known	O
as	O
applications.Corrections	O
.	O
</s>
<s>
To	O
keep	O
the	O
notation	O
of	O
lambda	B-General_Concept
expressions	I-General_Concept
uncluttered	O
,	O
the	O
following	O
conventions	O
are	O
usually	O
applied	O
:	O
</s>
<s>
The	O
body	O
of	O
an	O
abstraction	B-Application
extends	O
as	O
far	O
right	O
as	O
possible	O
:	O
λx.M	O
N	O
means	O
λx	O
.	O
</s>
<s>
A	O
sequence	O
of	O
abstractions	B-Application
is	O
contracted	O
:	O
λx.λy.λz.N	O
is	O
abbreviated	O
as	O
λxyz.N.	O
</s>
<s>
The	O
abstraction	B-Application
operator	O
,	O
λ	O
,	O
is	O
said	O
to	O
bind	O
its	O
variable	O
wherever	O
it	O
occurs	O
in	O
the	O
body	O
of	O
the	O
abstraction	B-Application
.	O
</s>
<s>
Variables	O
that	O
fall	O
within	O
the	O
scope	B-Language
of	O
an	O
abstraction	B-Application
are	O
said	O
to	O
be	O
bound	O
.	O
</s>
<s>
Also	O
a	O
variable	O
is	O
bound	O
by	O
its	O
nearest	O
abstraction	B-Application
.	O
</s>
<s>
In	O
the	O
following	O
example	O
the	O
single	O
occurrence	O
of	O
x	O
in	O
the	O
expression	O
is	O
bound	O
by	O
the	O
second	O
lambda	B-General_Concept
:	O
λx.y	O
(	O
λx.z	O
x	O
)	O
.	O
</s>
<s>
The	O
set	O
of	O
free	O
variables	O
of	O
a	O
lambda	B-General_Concept
expression	I-General_Concept
,	O
M	O
,	O
is	O
denoted	O
as	O
FV(M )	O
and	O
is	O
defined	O
by	O
recursion	O
on	O
the	O
structure	O
of	O
the	O
terms	O
,	O
as	O
follows	O
:	O
</s>
<s>
Closed	O
lambda	B-General_Concept
expressions	I-General_Concept
are	O
also	O
known	O
as	O
combinators	B-Application
and	O
are	O
equivalent	O
to	O
terms	O
in	O
combinatory	B-Application
logic	I-Application
.	O
</s>
<s>
The	O
meaning	O
of	O
lambda	B-General_Concept
expressions	I-General_Concept
is	O
defined	O
by	O
how	O
expressions	O
can	O
be	O
reduced	O
.	O
</s>
<s>
Frequently	O
,	O
in	O
uses	O
of	O
lambda	B-General_Concept
calculus	O
,	O
α-equivalent	O
terms	O
are	O
considered	O
to	O
be	O
equivalent	O
.	O
</s>
<s>
First	O
,	O
when	O
α-converting	O
an	O
abstraction	B-Application
,	O
the	O
only	O
variable	O
occurrences	O
that	O
are	O
renamed	O
are	O
those	O
that	O
are	O
bound	O
to	O
the	O
same	O
abstraction	B-Application
.	O
</s>
<s>
This	O
is	O
analogous	O
to	O
the	O
programming	O
notion	O
of	O
variable	B-Language
shadowing	I-Language
.	O
</s>
<s>
Second	O
,	O
α-conversion	O
is	O
not	O
possible	O
if	O
it	O
would	O
result	O
in	O
a	O
variable	O
getting	O
captured	O
by	O
a	O
different	O
abstraction	B-Application
.	O
</s>
<s>
In	O
programming	O
languages	O
with	O
static	B-Language
scope	I-Language
,	O
α-conversion	O
can	O
be	O
used	O
to	O
make	O
name	B-Application
resolution	I-Application
simpler	O
by	O
ensuring	O
that	O
no	O
variable	O
name	O
masks	B-Language
a	O
name	O
in	O
a	O
containing	O
scope	B-Language
(	O
see	O
α-renaming	O
to	O
make	O
name	B-Application
resolution	I-Application
trivial	O
)	O
.	O
</s>
<s>
In	O
the	O
De	B-Application
Bruijn	I-Application
index	I-Application
notation	O
,	O
any	O
two	O
α-equivalent	O
terms	O
are	O
syntactically	O
identical	O
.	O
</s>
<s>
Substitution	O
,	O
written	O
M[ x	O
:=	O
N ]	O
,	O
is	O
the	O
process	O
of	O
replacing	O
all	O
free	O
occurrences	O
of	O
the	O
variable	O
x	O
in	O
the	O
expression	O
M	O
with	O
expression	O
N	O
.	O
Substitution	O
on	O
terms	O
of	O
the	O
lambda	B-General_Concept
calculus	O
is	O
defined	O
by	O
recursion	O
on	O
the	O
structure	O
of	O
terms	O
,	O
as	O
follows	O
(	O
note	O
:	O
x	O
and	O
y	O
are	O
only	O
variables	O
while	O
M	O
and	O
N	O
are	O
any	O
lambda	B-General_Concept
expression	I-General_Concept
)	O
:	O
</s>
<s>
To	O
substitute	O
into	O
an	O
abstraction	B-Application
,	O
it	O
is	O
sometimes	O
necessary	O
to	O
α-convert	O
the	O
expression	O
.	O
</s>
<s>
β-reduction	O
captures	O
the	O
idea	O
of	O
function	B-Algorithm
application	I-Algorithm
.	O
</s>
<s>
β-reduction	O
can	O
be	O
seen	O
to	O
be	O
the	O
same	O
as	O
the	O
concept	O
of	O
local	O
reducibility	O
in	O
natural	O
deduction	O
,	O
via	O
the	O
Curry	B-Application
–	O
Howard	O
isomorphism	O
.	O
</s>
<s>
η-reduction	O
(	O
eta	O
reduction	O
)	O
expresses	O
the	O
idea	O
of	O
extensionality	O
,	O
Luke	O
Palmer	O
(	O
29	O
Dec	O
2010	O
)	O
Haskell-cafe	O
:	O
What	O
's	O
the	O
motivation	O
for	O
η	O
rules	O
?	O
</s>
<s>
η-reduction	O
can	O
be	O
seen	O
to	O
be	O
the	O
same	O
as	O
the	O
concept	O
of	O
local	O
completeness	O
in	O
natural	O
deduction	O
,	O
via	O
the	O
Curry	B-Application
–	O
Howard	O
isomorphism	O
.	O
</s>
<s>
For	O
the	O
untyped	B-Application
lambda	I-Application
calculus	I-Application
,	O
β-reduction	O
as	O
a	O
rewriting	O
rule	O
is	O
neither	O
strongly	O
normalising	O
nor	O
weakly	O
normalising	O
.	O
</s>
<s>
Therefore	O
,	O
both	O
strongly	O
normalising	O
terms	O
and	O
weakly	O
normalising	O
terms	O
have	O
a	O
unique	O
normal	B-Application
form	I-Application
.	O
</s>
<s>
For	O
strongly	O
normalising	O
terms	O
,	O
any	O
reduction	O
strategy	O
is	O
guaranteed	O
to	O
yield	O
the	O
normal	B-Application
form	I-Application
,	O
whereas	O
for	O
weakly	O
normalising	O
terms	O
,	O
some	O
reduction	O
strategies	O
may	O
fail	O
to	O
find	O
it	O
.	O
</s>
<s>
The	O
basic	O
lambda	B-General_Concept
calculus	O
may	O
be	O
used	O
to	O
model	O
booleans	O
,	O
arithmetic	O
,	O
data	O
structures	O
and	O
recursion	O
,	O
as	O
illustrated	O
in	O
the	O
following	O
sub-sections	O
.	O
</s>
<s>
There	O
are	O
several	O
possible	O
ways	O
to	O
define	O
the	O
natural	O
numbers	O
in	O
lambda	B-General_Concept
calculus	O
,	O
but	O
by	O
far	O
the	O
most	O
common	O
are	O
the	O
Church	B-Application
numerals	I-Application
,	O
which	O
can	O
be	O
defined	O
as	O
follows	O
:	O
</s>
<s>
A	O
Church	B-Application
numeral	I-Application
is	O
a	O
higher-order	B-Language
function	I-Language
—	O
it	O
takes	O
a	O
single-argument	O
function	O
,	O
and	O
returns	O
another	O
single-argument	O
function	O
.	O
</s>
<s>
The	O
Church	B-Application
numeral	I-Application
is	O
a	O
function	O
that	O
takes	O
a	O
function	O
as	O
argument	O
and	O
returns	O
the	O
-th	O
composition	O
of	O
,	O
i.e.	O
</s>
<s>
(	O
In	O
Church	O
's	O
original	O
lambda	B-General_Concept
calculus	O
,	O
the	O
formal	O
parameter	O
of	O
a	O
lambda	B-General_Concept
expression	I-General_Concept
was	O
required	O
to	O
occur	O
at	O
least	O
once	O
in	O
the	O
function	O
body	O
,	O
which	O
made	O
the	O
above	O
definition	O
of	O
impossible	O
.	O
)	O
</s>
<s>
One	O
way	O
of	O
thinking	O
about	O
the	O
Church	B-Application
numeral	I-Application
,	O
which	O
is	O
often	O
useful	O
when	O
analysing	O
programs	O
,	O
is	O
as	O
an	O
instruction	O
'	O
repeat	O
n	O
times	O
 '	O
.	O
</s>
<s>
We	O
can	O
define	O
a	O
successor	O
function	O
,	O
which	O
takes	O
a	O
Church	B-Application
numeral	I-Application
and	O
returns	O
by	O
adding	O
another	O
application	B-Algorithm
of	O
,	O
where	O
'	O
(	O
mf	O
)	O
x	O
 '	O
means	O
the	O
function	O
'	O
f	O
 '	O
is	O
applied	O
'	O
m	O
 '	O
times	O
on	O
'	O
x	O
 '	O
:	O
</s>
<s>
are	O
β-equivalent	O
lambda	B-General_Concept
expressions	I-General_Concept
.	O
</s>
<s>
Then	O
,	O
with	O
these	O
two	O
lambda	B-General_Concept
terms	O
,	O
we	O
can	O
define	O
some	O
logic	O
operators	O
(	O
these	O
are	O
just	O
possible	O
formulations	O
;	O
other	O
expressions	O
are	O
equally	O
correct	O
)	O
:	O
</s>
<s>
The	O
most	O
fundamental	O
predicate	O
is	O
,	O
which	O
returns	O
if	O
its	O
argument	O
is	O
the	O
Church	B-Application
numeral	I-Application
,	O
and	O
if	O
its	O
argument	O
is	O
any	O
other	O
Church	B-Application
numeral	I-Application
:	O
</s>
<s>
The	O
availability	O
of	O
predicates	O
and	O
the	O
above	O
definition	O
of	O
and	O
make	O
it	O
convenient	O
to	O
write	O
"	O
if-then-else	O
"	O
expressions	O
in	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
A	O
pair	O
(	O
2-tuple	O
)	O
can	O
be	O
defined	O
in	O
terms	O
of	O
and	O
,	O
by	O
using	O
the	O
Church	B-Application
encoding	I-Application
for	O
pairs	O
.	O
</s>
<s>
There	O
is	O
a	O
considerable	O
body	O
of	O
programming	O
idioms	O
for	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
Many	O
of	O
these	O
were	O
originally	O
developed	O
in	O
the	O
context	O
of	O
using	O
lambda	B-General_Concept
calculus	O
as	O
a	O
foundation	O
for	O
programming	B-Application
language	I-Application
semantics	I-Application
,	O
effectively	O
using	O
lambda	B-General_Concept
calculus	O
as	O
a	O
low-level	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
Because	O
several	O
programming	O
languages	O
include	O
the	O
lambda	B-General_Concept
calculus	O
(	O
or	O
something	O
very	O
similar	O
)	O
as	O
a	O
fragment	O
,	O
these	O
techniques	O
also	O
see	O
use	O
in	O
practical	O
programming	O
,	O
but	O
may	O
then	O
be	O
perceived	O
as	O
obscure	O
or	O
foreign	O
.	O
</s>
<s>
In	O
lambda	B-General_Concept
calculus	O
,	O
a	O
library	B-Library
would	O
take	O
the	O
form	O
of	O
a	O
collection	O
of	O
previously	O
defined	O
functions	O
,	O
which	O
as	O
lambda-terms	O
are	O
merely	O
particular	O
constants	O
.	O
</s>
<s>
The	O
pure	O
lambda	B-General_Concept
calculus	O
does	O
not	O
have	O
a	O
concept	O
of	O
named	O
constants	O
since	O
all	O
atomic	O
lambda-terms	O
are	O
variables	O
,	O
but	O
one	O
can	O
emulate	O
having	O
named	O
constants	O
by	O
setting	O
aside	O
a	O
variable	O
as	O
the	O
name	O
of	O
the	O
constant	O
,	O
using	O
abstraction	B-Application
to	O
bind	O
that	O
variable	O
in	O
the	O
main	O
body	O
,	O
and	O
apply	O
that	O
abstraction	B-Application
to	O
the	O
intended	O
definition	O
.	O
</s>
<s>
By	O
chaining	O
such	O
definitions	O
,	O
one	O
can	O
write	O
a	O
lambda	B-General_Concept
calculus	O
"	O
program	O
"	O
as	O
zero	O
or	O
more	O
function	O
definitions	O
,	O
followed	O
by	O
one	O
lambda-term	O
using	O
those	O
functions	O
that	O
constitutes	O
the	O
main	O
body	O
of	O
the	O
program	O
.	O
</s>
<s>
A	O
notable	O
restriction	O
of	O
this	O
is	O
that	O
the	O
name	O
be	O
not	O
defined	O
in	O
N	O
,	O
for	O
N	O
to	O
be	O
outside	O
the	O
scope	B-Language
of	O
the	O
abstraction	B-Application
binding	O
;	O
this	O
means	O
a	O
recursive	O
function	O
definition	O
cannot	O
be	O
used	O
as	O
the	O
N	O
with	O
.	O
</s>
<s>
Lambda	B-General_Concept
calculus	O
cannot	O
express	O
this	O
:	O
all	O
functions	O
are	O
anonymous	O
in	O
lambda	B-General_Concept
calculus	O
,	O
so	O
we	O
ca	O
n't	O
refer	O
by	O
name	O
to	O
a	O
value	O
which	O
is	O
yet	O
to	O
be	O
defined	O
,	O
inside	O
the	O
lambda	B-General_Concept
term	O
defining	O
that	O
same	O
value	O
.	O
</s>
<s>
However	O
,	O
a	O
lambda	B-General_Concept
expression	I-General_Concept
can	O
receive	O
itself	O
as	O
its	O
own	O
argument	O
,	O
for	O
example	O
in	O
.	O
</s>
<s>
Here	O
E	O
should	O
be	O
an	O
abstraction	B-Application
,	O
applying	O
its	O
parameter	O
to	O
a	O
value	O
to	O
express	O
recursion	O
.	O
</s>
<s>
In	O
the	O
lambda	B-General_Concept
expression	I-General_Concept
which	O
is	O
to	O
represent	O
this	O
function	O
,	O
a	O
parameter	O
(	O
typically	O
the	O
first	O
one	O
)	O
will	O
be	O
assumed	O
to	O
receive	O
the	O
lambda	B-General_Concept
expression	I-General_Concept
itself	O
as	O
its	O
value	O
,	O
so	O
that	O
calling	O
it	O
–	O
applying	O
it	O
to	O
an	O
argument	O
–	O
will	O
amount	O
to	O
recursion	O
.	O
</s>
<s>
The	O
self-application	O
achieves	O
replication	O
here	O
,	O
passing	O
the	O
function	O
's	O
lambda	B-General_Concept
expression	I-General_Concept
on	O
to	O
the	O
next	O
invocation	O
as	O
an	O
argument	O
value	O
,	O
making	O
it	O
available	O
to	O
be	O
referenced	O
and	O
called	O
there	O
.	O
</s>
<s>
This	O
solves	O
it	O
but	O
requires	O
re-writing	O
each	O
recursive	O
call	O
as	O
self-application	O
.	O
</s>
<s>
Given	O
a	O
lambda	B-General_Concept
term	O
with	O
first	O
argument	O
representing	O
recursive	O
call	O
(	O
e.g.	O
</s>
<s>
here	O
)	O
,	O
the	O
fixed-point	O
combinator	B-Application
will	O
return	O
a	O
self-replicating	O
lambda	B-General_Concept
expression	I-General_Concept
representing	O
the	O
recursive	O
function	O
(	O
here	O
,	O
)	O
.	O
</s>
<s>
Thus	O
the	O
original	O
lambda	B-General_Concept
expression	I-General_Concept
is	O
re-created	O
inside	O
itself	O
,	O
at	O
call-point	O
,	O
achieving	O
self-reference	O
.	O
</s>
<s>
In	O
the	O
lambda	B-General_Concept
calculus	O
,	O
is	O
a	O
fixed-point	O
of	O
,	O
as	O
it	O
expands	O
to	O
:	O
</s>
<s>
Every	O
recursively	O
defined	O
function	O
can	O
be	O
seen	O
as	O
a	O
fixed	O
point	O
of	O
some	O
suitably	O
defined	O
function	O
closing	O
over	O
the	O
recursive	O
call	O
with	O
an	O
extra	O
argument	O
,	O
and	O
therefore	O
,	O
using	O
,	O
every	O
recursively	O
defined	O
function	O
can	O
be	O
expressed	O
as	O
a	O
lambda	B-General_Concept
expression	I-General_Concept
.	O
</s>
<s>
is	O
,	O
the	O
smallest	O
term	O
that	O
has	O
no	O
normal	B-Application
form	I-Application
.	O
</s>
<s>
If	O
N	O
is	O
a	O
lambda-term	O
without	O
abstraction	B-Application
,	O
but	O
possibly	O
containing	O
named	O
constants	O
(	O
combinators	B-Application
)	O
,	O
then	O
there	O
exists	O
a	O
lambda-term	O
T( ,N )	O
which	O
is	O
equivalent	O
to	O
N	O
but	O
lacks	O
abstraction	B-Application
(	O
except	O
as	O
part	O
of	O
the	O
named	O
constants	O
,	O
if	O
these	O
are	O
considered	O
non-atomic	O
)	O
.	O
</s>
<s>
In	O
either	O
case	O
,	O
a	O
term	O
of	O
the	O
form	O
T( ,N )	O
P	O
can	O
reduce	O
by	O
having	O
the	O
initial	O
combinator	B-Application
I	O
,	O
K	O
,	O
or	O
S	O
grab	O
the	O
argument	O
P	O
,	O
just	O
like	O
β-reduction	O
of	O
N	O
P	O
would	O
do	O
.	O
</s>
<s>
K	O
throws	O
the	O
argument	O
away	O
,	O
just	O
like	O
N	O
would	O
do	O
if	O
has	O
no	O
free	O
occurrence	O
in	O
N	O
.	O
S	O
passes	O
the	O
argument	O
on	O
to	O
both	O
subterms	O
of	O
the	O
application	B-Algorithm
,	O
and	O
then	O
applies	O
the	O
result	O
of	O
the	O
first	O
to	O
the	O
result	O
of	O
the	O
second	O
.	O
</s>
<s>
The	O
combinators	B-Application
B	O
and	O
C	B-Language
are	O
similar	O
to	O
S	O
,	O
but	O
pass	O
the	O
argument	O
on	O
to	O
only	O
one	O
subterm	O
of	O
an	O
application	B-Algorithm
(	O
B	O
to	O
the	O
"	O
argument	O
"	O
subterm	O
and	O
C	B-Language
to	O
the	O
"	O
function	O
"	O
subterm	O
)	O
,	O
thus	O
saving	O
a	O
subsequent	O
K	O
if	O
there	O
is	O
no	O
occurrence	O
of	O
in	O
one	O
subterm	O
.	O
</s>
<s>
In	O
comparison	O
to	O
B	O
and	O
C	B-Language
,	O
the	O
S	O
combinator	B-Application
actually	O
conflates	O
two	O
functionalities	O
:	O
rearranging	O
arguments	O
,	O
and	O
duplicating	O
an	O
argument	O
so	O
that	O
it	O
may	O
be	O
used	O
in	O
two	O
places	O
.	O
</s>
<s>
The	O
W	O
combinator	B-Application
does	O
only	O
the	O
latter	O
,	O
yielding	O
the	O
B	B-Application
,	I-Application
C	I-Application
,	I-Application
K	I-Application
,	I-Application
W	I-Application
system	I-Application
as	O
an	O
alternative	O
to	O
SKI	B-Application
combinator	I-Application
calculus	I-Application
.	O
</s>
<s>
A	O
typed	O
lambda	B-General_Concept
calculus	O
is	O
a	O
typed	O
formalism	O
that	O
uses	O
the	O
lambda-symbol	O
(	O
)	O
to	O
denote	O
anonymous	B-General_Concept
function	I-General_Concept
abstraction	B-Application
.	O
</s>
<s>
In	O
this	O
context	O
,	O
types	O
are	O
usually	O
objects	O
of	O
a	O
syntactic	O
nature	O
that	O
are	O
assigned	O
to	O
lambda	B-General_Concept
terms	O
;	O
the	O
exact	O
nature	O
of	O
a	O
type	O
depends	O
on	O
the	O
calculus	O
considered	O
(	O
see	O
Kinds	O
of	O
typed	O
lambda	B-General_Concept
calculi	O
)	O
.	O
</s>
<s>
Typed	O
lambda	B-General_Concept
calculi	O
are	O
foundational	O
programming	O
languages	O
and	O
are	O
the	O
base	O
of	O
typed	O
functional	B-Language
programming	I-Language
languages	I-Language
such	O
as	O
ML	B-Language
and	O
Haskell	B-Language
and	O
,	O
more	O
indirectly	O
,	O
typed	O
imperative	B-Application
programming	I-Application
languages	I-Application
.	O
</s>
<s>
Typed	O
lambda	B-General_Concept
calculi	O
play	O
an	O
important	O
role	O
in	O
the	O
design	O
of	O
type	O
systems	O
for	O
programming	O
languages	O
;	O
here	O
typability	O
usually	O
captures	O
desirable	O
properties	O
of	O
the	O
program	O
,	O
e.g.	O
</s>
<s>
Typed	O
lambda	B-General_Concept
calculi	O
are	O
closely	O
related	O
to	O
mathematical	O
logic	O
and	O
proof	O
theory	O
via	O
the	O
Curry	B-Application
–	O
Howard	O
isomorphism	O
and	O
they	O
can	O
be	O
considered	O
as	O
the	O
internal	O
language	O
of	O
classes	O
of	O
categories	O
,	O
e.g.	O
</s>
<s>
the	O
simply	O
typed	O
lambda	B-General_Concept
calculus	O
is	O
the	O
language	O
of	O
Cartesian	B-Application
closed	I-Application
categories	I-Application
(	O
CCCs	O
)	O
.	O
</s>
<s>
Common	O
lambda	B-General_Concept
calculus	O
reduction	O
strategies	O
include	O
:	O
</s>
<s>
That	O
is	O
,	O
whenever	O
possible	O
the	O
arguments	O
are	O
substituted	O
into	O
the	O
body	O
of	O
an	O
abstraction	B-Application
before	O
the	O
arguments	O
are	O
reduced	O
.	O
</s>
<s>
Weak	O
reduction	O
strategies	O
do	O
not	O
reduce	O
under	O
lambda	B-General_Concept
abstractions	B-Application
:	O
</s>
<s>
Call	O
by	O
value	O
A	O
redex	O
is	O
reduced	O
only	O
when	O
its	O
right	O
hand	O
side	O
has	O
reduced	O
to	O
a	O
value	O
(	O
variable	O
or	O
abstraction	B-Application
)	O
.	O
</s>
<s>
Call	O
by	O
name	O
As	O
normal	O
order	O
,	O
but	O
no	O
reductions	O
are	O
performed	O
inside	O
abstractions	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
is	O
in	O
normal	B-Application
form	I-Application
according	O
to	O
this	O
strategy	O
,	O
although	O
it	O
contains	O
the	O
redex	O
.	O
</s>
<s>
Strategies	O
with	O
sharing	O
reduce	O
computations	O
that	O
are	O
"	O
the	O
same	O
"	O
in	O
parallel	B-Operating_System
:	O
</s>
<s>
Call	O
by	O
need	O
As	O
call	O
by	O
name	O
(	O
hence	O
weak	O
)	O
,	O
but	O
function	B-Algorithm
applications	I-Algorithm
that	O
would	O
duplicate	O
terms	O
instead	O
name	O
the	O
argument	O
,	O
which	O
is	O
then	O
reduced	O
only	O
"	O
when	O
it	O
is	O
needed	O
"	O
.	O
</s>
<s>
There	O
is	O
no	O
algorithm	O
that	O
takes	O
as	O
input	O
any	O
two	O
lambda	B-General_Concept
expressions	I-General_Concept
and	O
outputs	O
or	O
depending	O
on	O
whether	O
one	O
expression	O
reduces	O
to	O
the	O
other	O
.	O
</s>
<s>
As	O
usual	O
for	O
such	O
a	O
proof	O
,	O
computable	O
means	O
computable	O
by	O
any	O
model	O
of	O
computation	O
that	O
is	O
Turing	B-Algorithm
complete	I-Algorithm
.	O
</s>
<s>
In	O
fact	O
computability	O
can	O
itself	O
be	O
defined	O
via	O
the	O
lambda	B-General_Concept
calculus	O
:	O
a	O
function	O
F	O
:	O
N	O
→	O
N	O
of	O
natural	O
numbers	O
is	O
a	O
computable	O
function	O
if	O
and	O
only	O
if	O
there	O
exists	O
a	O
lambda	B-General_Concept
expression	I-General_Concept
f	O
such	O
that	O
for	O
every	O
pair	O
of	O
x	O
,	O
y	O
in	O
N	O
,	O
F(x )	O
=	O
y	O
if	O
and	O
only	O
if	O
f	O
=	O
β	O
,	O
where	O
and	O
are	O
the	O
Church	B-Application
numerals	I-Application
corresponding	O
to	O
x	O
and	O
y	O
,	O
respectively	O
and	O
=	O
β	O
meaning	O
equivalence	O
with	O
β-reduction	O
.	O
</s>
<s>
Church	O
's	O
proof	O
of	O
uncomputability	O
first	O
reduces	O
the	O
problem	O
to	O
determining	O
whether	O
a	O
given	O
lambda	B-General_Concept
expression	I-General_Concept
has	O
a	O
normal	B-Application
form	I-Application
.	O
</s>
<s>
Then	O
he	O
assumes	O
that	O
this	O
predicate	O
is	O
computable	O
,	O
and	O
can	O
hence	O
be	O
expressed	O
in	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
Building	O
on	O
earlier	O
work	O
by	O
Kleene	O
and	O
constructing	O
a	O
Gödel	O
numbering	O
for	O
lambda	B-General_Concept
expressions	I-General_Concept
,	O
he	O
constructs	O
a	O
lambda	B-General_Concept
expression	I-General_Concept
that	O
closely	O
follows	O
the	O
proof	O
of	O
Gödel	O
's	O
first	O
incompleteness	O
theorem	O
.	O
</s>
<s>
The	O
notion	O
of	O
computational	O
complexity	O
for	O
the	O
lambda	B-General_Concept
calculus	O
is	O
a	O
bit	O
tricky	O
,	O
because	O
the	O
cost	O
of	O
a	O
β-reduction	O
may	O
vary	O
depending	O
on	O
how	O
it	O
is	O
implemented	O
.	O
</s>
<s>
In	O
2014	O
it	O
was	O
shown	O
that	O
the	O
number	O
of	O
β-reduction	O
steps	O
taken	O
by	O
normal	O
order	O
reduction	O
to	O
reduce	O
a	O
term	O
is	O
a	O
reasonable	O
time	O
cost	O
model	O
,	O
that	O
is	O
,	O
the	O
reduction	O
can	O
be	O
simulated	O
on	O
a	O
Turing	B-Architecture
machine	I-Architecture
in	O
time	O
polynomially	O
proportional	O
to	O
the	O
number	O
of	O
steps	O
.	O
</s>
<s>
This	O
was	O
a	O
long-standing	O
open	O
problem	O
,	O
due	O
to	O
size	O
explosion	O
,	O
the	O
existence	O
of	O
lambda	B-General_Concept
terms	O
which	O
grow	O
exponentially	O
in	O
size	O
for	O
each	O
β-reduction	O
.	O
</s>
<s>
The	O
result	O
makes	O
clear	O
that	O
the	O
amount	O
of	O
space	O
needed	O
to	O
evaluate	O
a	O
lambda	B-General_Concept
term	O
is	O
not	O
proportional	O
to	O
the	O
size	O
of	O
the	O
term	O
during	O
reduction	O
.	O
</s>
<s>
Optimal	O
reduction	O
reduces	O
all	O
computations	O
with	O
the	O
same	O
label	O
in	O
one	O
step	O
,	O
avoiding	O
duplicated	O
work	O
,	O
but	O
the	O
number	O
of	O
parallel	B-Operating_System
β-reduction	O
steps	O
to	O
reduce	O
a	O
given	O
term	O
to	O
normal	B-Application
form	I-Application
is	O
approximately	O
linear	O
in	O
the	O
size	O
of	O
the	O
term	O
.	O
</s>
<s>
This	O
is	O
far	O
too	O
small	O
to	O
be	O
a	O
reasonable	O
cost	O
measure	O
,	O
as	O
any	O
Turing	B-Architecture
machine	I-Architecture
may	O
be	O
encoded	O
in	O
the	O
lambda	B-General_Concept
calculus	O
in	O
size	O
linearly	O
proportional	O
to	O
the	O
size	O
of	O
the	B-Architecture
Turing	I-Architecture
machine	I-Architecture
.	O
</s>
<s>
The	O
true	O
cost	O
of	O
reducing	O
lambda	B-General_Concept
terms	O
is	O
not	O
due	O
to	O
β-reduction	O
per	O
se	O
but	O
rather	O
the	O
handling	O
of	O
the	O
duplication	O
of	O
redexes	O
during	O
β-reduction	O
.	O
</s>
<s>
It	O
is	O
not	O
known	O
if	O
optimal	O
reduction	O
implementations	O
are	O
reasonable	O
when	O
measured	O
with	O
respect	O
to	O
a	O
reasonable	O
cost	O
model	O
such	O
as	O
the	O
number	O
of	O
leftmost-outermost	O
steps	O
to	O
normal	B-Application
form	I-Application
,	O
but	O
it	O
has	O
been	O
shown	O
for	O
fragments	O
of	O
the	O
lambda	B-General_Concept
calculus	O
that	O
the	O
optimal	O
reduction	O
algorithm	O
is	O
efficient	O
and	O
has	O
at	O
most	O
a	O
quadratic	O
overhead	O
compared	O
to	O
leftmost-outermost	O
.	O
</s>
<s>
In	O
addition	O
the	O
BOHM	O
prototype	O
implementation	O
of	O
optimal	O
reduction	O
outperformed	O
both	O
Caml	B-Language
Light	I-Language
and	O
Haskell	B-Language
on	O
pure	O
lambda	B-General_Concept
terms	O
.	O
</s>
<s>
As	O
pointed	O
out	O
by	O
Peter	O
Landin	O
's	O
1965	O
paper	O
"	O
A	O
Correspondence	O
between	O
ALGOL	O
60	O
and	O
Church	O
's	O
Lambda-notation	O
"	O
,	O
sequential	O
procedural	B-Application
programming	I-Application
languages	I-Application
can	O
be	O
understood	O
in	O
terms	O
of	O
the	O
lambda	B-General_Concept
calculus	O
,	O
which	O
provides	O
the	O
basic	O
mechanisms	O
for	O
procedural	B-Application
abstraction	B-Application
and	O
procedure	O
(	O
subprogram	O
)	O
application	B-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
in	O
Python	B-Language
the	O
"	O
square	O
"	O
function	O
can	O
be	O
expressed	O
as	O
a	O
lambda	B-General_Concept
expression	I-General_Concept
as	O
follows	O
:	O
</s>
<s>
The	O
above	O
example	O
is	O
an	O
expression	O
that	O
evaluates	O
to	O
a	O
first-class	B-Application
function	I-Application
.	O
</s>
<s>
The	O
symbol	O
lambda	B-General_Concept
creates	O
an	O
anonymous	B-General_Concept
function	I-General_Concept
,	O
given	O
a	O
list	O
of	O
parameter	O
names	O
,	O
x	O
–	O
just	O
a	O
single	O
argument	O
in	O
this	O
case	O
,	O
and	O
an	O
expression	O
that	O
is	O
evaluated	O
as	O
the	O
body	O
of	O
the	O
function	O
,	O
x**2	O
.	O
</s>
<s>
Anonymous	B-General_Concept
functions	I-General_Concept
are	O
sometimes	O
called	O
lambda	B-General_Concept
expressions	I-General_Concept
.	O
</s>
<s>
For	O
example	O
,	O
Pascal	B-Application
and	O
many	O
other	O
imperative	B-Application
languages	I-Application
have	O
long	O
supported	O
passing	O
subprograms	O
as	O
arguments	O
to	O
other	O
subprograms	O
through	O
the	O
mechanism	O
of	O
function	B-Language
pointers	I-Language
.	O
</s>
<s>
However	O
,	O
function	B-Language
pointers	I-Language
are	O
not	O
a	O
sufficient	O
condition	O
for	O
functions	O
to	O
be	O
first	B-Application
class	I-Application
datatypes	O
,	O
because	O
a	O
function	O
is	O
a	O
first	B-Application
class	I-Application
datatype	O
if	O
and	O
only	O
if	O
new	O
instances	O
of	O
the	O
function	O
can	O
be	O
created	O
at	O
run-time	O
.	O
</s>
<s>
And	O
this	O
run-time	O
creation	O
of	O
functions	O
is	O
supported	O
in	O
Smalltalk	B-Application
,	O
JavaScript	B-Language
and	O
Wolfram	B-Language
Language	I-Language
,	O
and	O
more	O
recently	O
in	O
Scala	B-Application
,	O
Eiffel	B-Language
(	O
"	O
agents	O
"	O
)	O
,	O
C#	B-Application
(	O
"	O
delegates	O
"	O
)	O
and	O
C++11	B-Language
,	O
among	O
others	O
.	O
</s>
<s>
The	O
Church	O
–	O
Rosser	O
property	O
of	O
the	O
lambda	B-General_Concept
calculus	O
means	O
that	O
evaluation	O
(β-	O
reduction	O
)	O
can	O
be	O
carried	O
out	O
in	O
any	O
order	O
,	O
even	O
in	O
parallel	B-Operating_System
.	O
</s>
<s>
This	O
means	O
that	O
various	O
nondeterministic	O
evaluation	B-Language
strategies	I-Language
are	O
relevant	O
.	O
</s>
<s>
However	O
,	O
the	O
lambda	B-General_Concept
calculus	O
does	O
not	O
offer	O
any	O
explicit	O
constructs	O
for	O
parallelism	B-Operating_System
.	O
</s>
<s>
One	O
can	O
add	O
constructs	O
such	O
as	O
Futures	B-Operating_System
to	O
the	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
The	O
fact	O
that	O
lambda	B-General_Concept
calculus	O
terms	O
act	O
as	O
functions	O
on	O
other	O
lambda	B-General_Concept
calculus	O
terms	O
,	O
and	O
even	O
on	O
themselves	O
,	O
led	O
to	O
questions	O
about	O
the	O
semantics	B-Application
of	O
the	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
Could	O
a	O
sensible	O
meaning	O
be	O
assigned	O
to	O
lambda	B-General_Concept
calculus	O
terms	O
?	O
</s>
<s>
The	O
natural	O
semantics	B-Application
was	O
to	O
find	O
a	O
set	O
D	O
isomorphic	O
to	O
the	O
function	O
space	O
D	O
→	O
D	O
,	O
of	O
functions	O
on	O
itself	O
.	O
</s>
<s>
However	O
,	O
no	O
nontrivial	O
such	O
D	O
can	O
exist	O
,	O
by	O
cardinality	B-Application
constraints	O
because	O
the	O
set	O
of	O
all	O
functions	O
from	O
D	O
to	O
D	O
has	O
greater	O
cardinality	B-Application
than	O
D	O
,	O
unless	O
D	O
is	O
a	O
singleton	O
set	O
.	O
</s>
<s>
In	O
the	O
1970s	O
,	O
Dana	O
Scott	O
showed	O
that	O
if	O
only	O
continuous	O
functions	O
were	O
considered	O
,	O
a	O
set	O
or	O
domain	O
D	O
with	O
the	O
required	O
property	O
could	O
be	O
found	O
,	O
thus	O
providing	O
a	O
model	O
for	O
the	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
This	O
work	O
also	O
formed	O
the	O
basis	O
for	O
the	O
denotational	B-Application
semantics	I-Application
of	O
programming	O
languages	O
.	O
</s>
<s>
These	O
extensions	O
are	O
in	O
the	O
lambda	B-Application
cube	I-Application
:	O
</s>
<s>
These	O
formal	O
systems	O
are	O
extensions	O
of	O
lambda	B-General_Concept
calculus	O
that	O
are	O
not	O
in	O
the	O
lambda	B-Application
cube	I-Application
:	O
</s>
<s>
Binary	B-Application
lambda	I-Application
calculus	I-Application
–	O
A	O
version	O
of	O
lambda	B-General_Concept
calculus	O
with	O
binary	O
I/O	O
,	O
a	O
binary	O
encoding	O
of	O
terms	O
,	O
and	O
a	O
designated	O
universal	O
machine	O
.	O
</s>
<s>
These	O
formal	O
systems	O
are	O
variations	O
of	O
lambda	B-General_Concept
calculus	O
:	O
</s>
<s>
These	O
formal	O
systems	O
are	O
related	O
to	O
lambda	B-General_Concept
calculus	O
:	O
</s>
<s>
Deductive	B-Application
lambda	I-Application
calculus	I-Application
–	O
The	O
consideration	O
of	O
the	O
problems	O
associated	O
with	O
considering	O
lambda	B-General_Concept
calculus	O
as	O
a	O
Deductive	O
system	O
.	O
</s>
<s>
Lambda	B-Application
calculus	I-Application
definition	I-Application
–	O
Formal	O
definition	O
of	O
the	O
lambda	B-General_Concept
calculus	O
.	O
</s>
<s>
Let	B-Application
expression	I-Application
–	O
An	O
expression	O
closely	O
related	O
to	O
an	O
abstraction	B-Application
.	O
</s>
<s>
Structure	B-Language
and	I-Language
Interpretation	I-Language
of	I-Language
Computer	I-Language
Programs	I-Language
.	O
</s>
<s>
Hendrik	O
Pieter	O
Barendregt	O
Introduction	O
to	O
Lambda	B-General_Concept
Calculus	O
.	O
</s>
<s>
Henk	O
Barendregt	O
,	O
The	O
Impact	O
of	O
the	O
Lambda	B-General_Concept
Calculus	O
in	O
Logic	O
and	O
Computer	B-General_Concept
Science	I-General_Concept
.	O
</s>
<s>
History	O
of	O
Lambda-calculus	O
and	O
Combinatory	B-Application
Logic	I-Application
.	O
</s>
<s>
This	O
paper	O
contains	O
the	O
proof	O
that	O
the	O
equivalence	O
of	O
lambda	B-General_Concept
expressions	I-General_Concept
is	O
in	O
general	O
not	O
decidable	O
.	O
</s>
<s>
Contains	O
the	O
lambda	B-Application
calculus	I-Application
definitions	I-Application
of	O
several	O
familiar	O
functions	O
.	O
</s>
<s>
Landin	O
,	O
Peter	O
,	O
A	O
Correspondence	O
Between	O
ALGOL	O
60	O
and	O
Church	O
's	O
Lambda-Notation	O
,	O
Communications	O
of	O
the	O
ACM	O
,	O
vol	O
.	O
</s>
<s>
A	O
classic	O
paper	O
highlighting	O
the	O
importance	O
of	O
lambda	B-General_Concept
calculus	O
as	O
a	O
basis	O
for	O
programming	O
languages	O
.	O
</s>
<s>
Larson	O
,	O
Jim	O
,	O
An	O
Introduction	O
to	O
Lambda	B-General_Concept
Calculus	O
and	O
Scheme	B-Language
.	O
</s>
<s>
A	O
paper	O
giving	O
a	O
formal	O
underpinning	O
to	O
the	O
idea	O
of	O
'	O
meaning-is-use	O
'	O
which	O
,	O
even	O
if	O
based	O
on	O
proofs	O
,	O
it	O
is	O
different	O
from	O
proof-theoretic	O
semantics	B-Application
as	O
in	O
the	O
Dummett	O
–	O
Prawitz	O
tradition	O
since	O
it	O
takes	O
reduction	O
as	O
the	O
rules	O
giving	O
meaning	O
.	O
</s>
<s>
Hankin	O
,	O
Chris	O
,	O
An	O
Introduction	O
to	O
Lambda	B-General_Concept
Calculi	O
for	O
Computer	B-General_Concept
Scientists	I-General_Concept
,	O
</s>
<s>
Morten	O
Heine	O
Sørensen	O
,	O
Paweł	O
Urzyczyn	O
,	O
Lectures	O
on	O
the	O
Curry	B-Application
–	O
Howard	O
isomorphism	O
,	O
Elsevier	O
,	O
2006	O
,	O
is	O
a	O
recent	O
monograph	O
that	O
covers	O
the	O
main	O
topics	O
of	O
lambda	B-General_Concept
calculus	O
from	O
the	O
type-free	O
variety	O
,	O
to	O
most	O
typed	O
lambda	B-General_Concept
calculi	O
,	O
including	O
more	O
recent	O
developments	O
like	O
pure	O
type	O
systems	O
and	O
the	O
lambda	B-Application
cube	I-Application
.	O
</s>
<s>
covers	O
lambda	B-General_Concept
calculi	O
from	O
a	O
practical	O
type	O
system	O
perspective	O
;	O
some	O
topics	O
like	O
dependent	O
types	O
are	O
only	O
mentioned	O
,	O
but	O
subtyping	O
is	O
an	O
important	O
topic	O
.	O
</s>
<s>
by	O
Peter	O
Kelly	O
,	O
Paul	O
Coddington	O
,	O
and	O
Andrew	O
Wendelborn	O
;	O
mentions	O
graph	B-Application
reduction	I-Application
as	O
a	O
common	O
means	O
of	O
evaluating	O
lambda	B-General_Concept
expressions	I-General_Concept
and	O
discusses	O
the	O
applicability	O
of	O
lambda	B-General_Concept
calculus	O
for	O
distributed	B-Architecture
computing	I-Architecture
(	O
due	O
to	O
the	O
Church	O
–	O
Rosser	O
property	O
,	O
which	O
enables	O
parallel	B-Operating_System
graph	B-Application
reduction	I-Application
for	O
lambda	B-General_Concept
expressions	I-General_Concept
)	O
.	O
</s>
