# Lambda calculus

date post

07-Jan-2016Category

## Documents

view

66download

3

Embed Size (px)

description

### Transcript of Lambda calculus

Lambda calculus

Lambda calculusWhat is -calculus ? Lambda calculus in history of mathematics

The lambda calculus was introduced by mathematicianAlonzo Churchin the 1930s .The original system was shown to belogically inconsistentin 1935 when Stephen KleeneandJ. B. Rosserdeveloped theKleeneRosser paradox.Subsequently, in 1936 Church isolated and published just the portion relevant to computation, what is now called theuntyped lambda calculus. The -calculus was re-discovered as a versatile tool in Computer Science by people like McCarthy, Landin, and Scott in the 1960s. Mc-Carthy came out with his list processing language Lisp in 1960. McCarthy knew of the -calculus, and his language closely resembles it.Now used as Tool for investigating computability Basis of functional programming languagesLisp, Scheme, Haskell,ML

Expressions in the -calculusFunctions in the -calculusFunctions in the -calculusThe official definition

ConuenceIt may be that a -term offers many opportunities for reduction at the same time. it is necessary that the result of a computation is independent from the order of reductionTheorem 1 (Church-Rosser) If a term M can be reduced (in several steps) to terms N and P, then there exists a term Q to which both N and P can be reduced (in several steps).As a picture:

Conuence

Conuence.........ConuenceCorollary 2 Every -term has at most one normal form.Proof. For the sake of contradiction, assume that there are normal forms N and P to whicha certain term M reduces:

By the theorem of Church and Rosser there is a term Q to which both N and P can be reduced. However, N and P are assumed to be in normal form, so they dont allow for any further reductions. The only possible interpretation is that N = P = Q.

Free and bound variables

Higher-order functions

Iteration and recursion

Iteration and recursion

From Theory to Programming Language

Although the lambda-calculus is powerful enough to express any program, this doesn't mean that you'd actuallywantto do so. After all, the Turing Machine offers an equally powerful computational basis.

Which lead us to Functional ProgrammingFunctional programming has its roots inlambda calculus lambda calculusprovides a theoretical framework for describing functions and their evaluation. Although it is a mathematical abstraction rather than a programming language, it forms the basis of almost all functional programming languages today.Many functionalprogramming languagescan be viewed as elaborations on the lambda calculus.

From Theory to Programming Language

Similarity to Functional Programming