This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full 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 doesn’t tell us how to find it—this notation is nonconstructive. • λ 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 practice—usually we assume some constants are built in, as in the examples so far. The set of builtins is arbitrary—but usually includes things like set of integers .... 2,1,0,1,2,..... boolean constants true, false arithmetic operations +, *,/ boolean relations =, <, > ......
View
Full
Document
This note was uploaded on 12/09/2009 for the course COP 5555 taught by Professor Staff during the Fall '08 term at University of Florida.
 Fall '08
 Staff

Click to edit the document details