Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Lambda Calculus

Origin
First observed in the late 1890s
Formalized in the 1930s
Developed in order to study mathematical

properties.
Lambda calculus is a conceptually simple
universal model of computation

Motivation
The lambda calculus can be called the

smallest universal programming language of


the world

What is this?
The name derives from the Greek letter lambda ()

used to denotebindinga variable in a function


Single transformation rule -> variable substitution
Single function definition schema
Any computable function can be expressed and
evaluated using this formalism
Functional Programming essentially implements
this calculus
The -calculus provides a simplesemanticsfor
computation, enabling properties of computation to
be studied formally
4

Lambda Terms
a variable is itself a valid lambda term
iftis a lambda term, and xis a variable,

then(x.t)is a lambda term (called alambda


abstraction);
iftandsare lambda terms, then(ts)is a
lambda term (called anapplication).
Thus a lambda term is valid if and only if it
can be obtained by repeated application of
these three rules
5

lambda abstraction
x.t
X is the input
T is the expression

x.x+2 == f(x) = x +2

Lambda Property - 1
Lambda:
sqsum(x, y) = x*x +

y*y
(x, y) x*x + y*y

Lambda Property 1 -Equivalent


In

computer programming,
ananonymous
function(alsofunctio
n constant,function
literal, orlambda
function) is afunction
(or asubroutine)
defined, and possibly
called, without being
boundto anidentifier.
8

Lambda Property-2
In lambda calculus,

functions are taken


to be '
first class values', so
functions may be
used as the inputs,
or be returned as
outputs from other
functions.

Lambda Property-2 Equivalent


Inmathematicsand

computer science,
ahigher-order
function(alsofunctio
nal
form,functionalorfu
nctor) is afunctionthat
does at least one of the
following:
take one or more
functions as an input
output a function
10

Lambda Property 3
1 - (x, y) x*x + y*y
1.1 (5,2) == 5*5 +
2*2 = 29

2 - ((x (y x*x +

y*y))
2.2 - = (y 5*5 + y*y)
(5)
2.2 - = 5*5 + 2*2 =
29

11

Lambda Property 3 Equivalent


Inmathematicsand

computer science
,curryingis the
technique of
transforming afunction
that takes multiple
arguments(or atuple
of arguments) in such
a way that it can be
called as a chain of
functions, each with a
single argument
12

Much more
-conversion: changing bound variables

(alpha);
-reduction: applying functions to their
arguments (beta);
-conversion: which captures a notion of
extensionality (eta).
Recursion
Parallelism and concurrency

13

That is all

diego37@gmail.com
http://www.linkedin.com/in/diegomendonca
14

You might also like