10 LambdaCalculus - Lambda Calculus Church, 1930s calculus...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lambda Calculus Church, 1930s calculus can be used to define computable functions Church's goal to study the Entscheidungsproblem He showed that there is no algorithm to determine whether two lambda expressions are equivalent We are interested because calculus is the mathematical foundation for functional programming functional programming languages are (clever) implementations of the lambda calculus with types and syntactic sugar Read Scott, supplement to Chapter 10 Sloneger and Kurz, 5.1 and 5.2. What is a function? Often viewed as mapping from domain to range Can be denoted by a set of pairs: Example: sqrt= {(x,y) in R*R | x = y2} This gives a precise definition, but doesnt tell us how to find itthis notation is non-constructive. calculus gives a constructive view of functions. Lambda calculus is a calculus of anonymous functions a method of representing functions a set of conversion rules for syntactically transforming them x. * 2 x This is read the function of x which returns times 2 x x. * 2 x is a lambda abstraction x is the bound variable * 2 x is the body (Operators in the lambda calculus should be in prefix form. Sometime I forget this.) The expression x. * 2 x can be expressed in ML with a slightly different notation fn x => 2 * x; it = fn : int -> int Recall that fun double x = 2*x; is short for val double = fn x => 2*x; This is an expression x. y. * (+ x y) 2 the function of x that returns the function of y which returns * (+ x y) 2 ML: fn x => fn y => (x+y)*2 val it = fn: int -> int -> int y. * (+ x y) 2 y is bound in this expression x is free x. y. * (+ x y) 2 both x and y are bound in this expression. In the pure form of the lambda calculus, everything is a function. For example, natural numbers can be obtained from constant function 0, successor function S(n). Example: 3 = S(S(S(0))) This is cumbersome in practiceusually we assume some constants are built in, as in the examples so far. The set of built-ins is arbitrarybut usually includes things like set of integers .... -2,-1,0,1,2,..... boolean constants true, false arithmetic operations +,- *,/ boolean relations =, <, > ......
View Full Document

Page1 / 132

10 LambdaCalculus - Lambda Calculus Church, 1930s calculus...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online