lambdacalculus-140108065323-phpapp01

14
Lambda Calculus 1

description

Lambda calculus

Transcript of lambdacalculus-140108065323-phpapp01

Page 1: lambdacalculus-140108065323-phpapp01

1

Lambda Calculus

Page 2: lambdacalculus-140108065323-phpapp01

2

OriginFirst observed in the late 1890sFormalized in the 1930sDeveloped in order to study mathematical

properties.Lambda calculus is a conceptually simple 

universal model of computation

Page 3: lambdacalculus-140108065323-phpapp01

3

MotivationThe lambda calculus can be called the

smallest universal programming language of the world

Page 4: lambdacalculus-140108065323-phpapp01

4

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

used to denote binding a variable in a functionSingle transformation rule -> variable substitutionSingle function definition schemaAny computable function can be expressed and

evaluated using this formalismFunctional Programming essentially implements

this calculusThe λ-calculus provides a simple semantics for

computation, enabling properties of computation to be studied formally

Page 5: lambdacalculus-140108065323-phpapp01

5

Lambda Termsa variable is itself a valid lambda termif t is a lambda term, and  x is a variable,

then ( λx.t) is a lambda term (called a lambda abstraction);

if t and s are lambda terms, then (ts) is a lambda term (called an application).

Thus a lambda term is valid if and only if it can be obtained by repeated application of these three rules

Page 6: lambdacalculus-140108065323-phpapp01

6

lambda abstraction λ x.t

X is the input T is the expression

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

Page 7: lambdacalculus-140108065323-phpapp01

7

Lambda Property - 1Lambda:

sqsum(x, y) = x*x + y*y

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

Page 8: lambdacalculus-140108065323-phpapp01

8

Lambda Property – 1 -Equivalent

In computer programming, an anonymous function (also function constant, function literal, or lambda function) is a function (or a subroutine) defined, and possibly called, without being bound to an identifier.

Page 9: lambdacalculus-140108065323-phpapp01

9

Lambda Property-2In 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.

Page 10: lambdacalculus-140108065323-phpapp01

10

Lambda Property-2 - EquivalentIn mathematics and 

computer science, a higher-order function (also functional form, functional or functor) is a function that does at least one of the following:

take one or more functions as an input

output a function

Page 11: lambdacalculus-140108065323-phpapp01

11

Lambda Property 31 - (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

Page 12: lambdacalculus-140108065323-phpapp01

12

Lambda Property 3 - EquivalentIn mathematics and 

computer science, currying is the technique of transforming a function that takes multiple arguments (or a tuple of arguments) in such a way that it can be called as a chain of functions, each with a single argument 

Page 13: lambdacalculus-140108065323-phpapp01

13

Much moreα-conversion: changing bound variables

(alpha);β-reduction: applying functions to their

arguments (beta);η-conversion: which captures a notion of

extensionality (eta).RecursionParallelism and concurrency

Page 14: lambdacalculus-140108065323-phpapp01

14

That is all

[email protected]://www.linkedin.com/in/diegomendonca