Professional Documents
Culture Documents
13 August 2013
FCS
13 August 2013
1 / 28
Outline
1
Introduction
FCS
13 August 2013
2 / 28
Outline
1
Introduction
FCS
13 August 2013
2 / 28
Outline
1
Introduction
Conditions
FCS
13 August 2013
2 / 28
Outline
1
Introduction
Conditions
Natural Numbers
FCS
13 August 2013
2 / 28
Outline
1
Introduction
Conditions
Natural Numbers
FCS
13 August 2013
2 / 28
Outline
1
Introduction
Conditions
Natural Numbers
Data abstractions
FCS
13 August 2013
2 / 28
Outline
1
Introduction
Conditions
Natural Numbers
Data abstractions
FCS
13 August 2013
2 / 28
Outline
1
Introduction
Conditions
Natural Numbers
Data abstractions
Summary
FCS
13 August 2013
2 / 28
Lambda Calculus
FCS
13 August 2013
3 / 28
FCS
13 August 2013
4 / 28
FCS
13 August 2013
5 / 28
FCS
13 August 2013
5 / 28
FCS
13 August 2013
5 / 28
FCS
13 August 2013
6 / 28
FCS
13 August 2013
6 / 28
FCS
13 August 2013
6 / 28
FCS
13 August 2013
6 / 28
FCS
13 August 2013
6 / 28
FCS
13 August 2013
6 / 28
FCS
13 August 2013
6 / 28
Conditional evaluation
Conditional evaluation is a very fundamental programming concept
and I do not know of any programming language that does not have
some form of if-then-else!
FCS
13 August 2013
7 / 28
Conditional evaluation
Conditional evaluation is a very fundamental programming concept
and I do not know of any programming language that does not have
some form of if-then-else!
Our abstractions of true and false make it extremely simple to
encode if-then-else in lambda calculus:
let ITE = cxy c x y
FCS
13 August 2013
7 / 28
Conditional evaluation
Conditional evaluation is a very fundamental programming concept
and I do not know of any programming language that does not have
some form of if-then-else!
Our abstractions of true and false make it extremely simple to
encode if-then-else in lambda calculus:
let ITE = cxy c x y
If the expression abstracted by c evaluates to T , then
(T x y ) x
FCS
13 August 2013
7 / 28
Conditional evaluation
Conditional evaluation is a very fundamental programming concept
and I do not know of any programming language that does not have
some form of if-then-else!
Our abstractions of true and false make it extremely simple to
encode if-then-else in lambda calculus:
let ITE = cxy c x y
If the expression abstracted by c evaluates to T , then
(T x y ) x
Else, if the expression abstracted by c evaluates to F , then
(F x y ) y
C. Aravindan (SSN Institutions)
FCS
13 August 2013
7 / 28
FCS
13 August 2013
8 / 28
FCS
13 August 2013
8 / 28
Note that 0 and F are the same lambda expressions! Inferring the
type can help us to interpret the expression appropriately.
C. Aravindan (SSN Institutions)
FCS
13 August 2013
8 / 28
FCS
13 August 2013
9 / 28
FCS
13 August 2013
9 / 28
FCS
13 August 2013
9 / 28
FCS
13 August 2013
9 / 28
FCS
13 August 2013
9 / 28
FCS
13 August 2013
9 / 28
FCS
13 August 2013
10 / 28
FCS
13 August 2013
10 / 28
FCS
13 August 2013
11 / 28
FCS
13 August 2013
11 / 28
FCS
13 August 2013
12 / 28
FCS
13 August 2013
12 / 28
FCS
13 August 2013
12 / 28
x is a fixpoint of a function f if f (x ) = x .
FCS
13 August 2013
13 / 28
x is a fixpoint of a function f if f (x ) = x .
Examples: f (x ) = x 2 , f (x ) = x + 1, f (x ) = x .
FCS
13 August 2013
13 / 28
x is a fixpoint of a function f if f (x ) = x .
Examples: f (x ) = x 2 , f (x ) = x + 1, f (x ) = x .
In Lambda calculus, if F is a lambda abstraction and N is any lambda
expression, we say that N is a fixpoint of F if (F N) N
FCS
13 August 2013
13 / 28
x is a fixpoint of a function f if f (x ) = x .
Examples: f (x ) = x 2 , f (x ) = x + 1, f (x ) = x .
In Lambda calculus, if F is a lambda abstraction and N is any lambda
expression, we say that N is a fixpoint of F if (F N) N
Theorem: Every lambda abstraction F has a fixpoint.
FCS
13 August 2013
13 / 28
let A = xy y (xxy )
Turings fixpoint combinator is now obtained as let = AA.
For any lambda abstraction F , N = F is a fixpoint of F !
FCS
13 August 2013
14 / 28
let A = xy y (xxy )
Turings fixpoint combinator is now obtained as let = AA.
For any lambda abstraction F , N = F is a fixpoint of F !
N = F
= AAF
= (xy y (xxy )) A F
F (AAF )
= F (F )
= FN
FCS
13 August 2013
14 / 28
FCS
13 August 2013
15 / 28
FCS
13 August 2013
15 / 28
FCS
13 August 2013
15 / 28
FCS
13 August 2013
15 / 28
FCS
13 August 2013
15 / 28
FCS
13 August 2013
16 / 28
FCS
13 August 2013
16 / 28
FCS
13 August 2013
16 / 28
FCS
13 August 2013
16 / 28
FCS
13 August 2013
17 / 28
FCS
13 August 2013
17 / 28
FCS
13 August 2013
17 / 28
FCS
13 August 2013
17 / 28
FCS
13 August 2013
18 / 28
FCS
13 August 2013
18 / 28
FCS
13 August 2013
18 / 28
FCS
13 August 2013
18 / 28
FCS
13 August 2013
18 / 28
FCS
13 August 2013
19 / 28
FCS
13 August 2013
19 / 28
FCS
13 August 2013
19 / 28
FCS
13 August 2013
20 / 28
FCS
13 August 2013
21 / 28
FCS
13 August 2013
21 / 28
FCS
13 August 2013
21 / 28
FCS
13 August 2013
21 / 28
FCS
13 August 2013
21 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
22 / 28
FCS
13 August 2013
23 / 28
FCS
13 August 2013
23 / 28
FCS
13 August 2013
23 / 28
FCS
13 August 2013
23 / 28
FCS
13 August 2013
24 / 28
FCS
13 August 2013
24 / 28
FCS
13 August 2013
24 / 28
FCS
13 August 2013
24 / 28
FCS
13 August 2013
25 / 28
FCS
13 August 2013
25 / 28
FCS
13 August 2013
25 / 28
FCS
13 August 2013
25 / 28
FCS
13 August 2013
25 / 28
FCS
13 August 2013
25 / 28
FCS
13 August 2013
25 / 28
FCS
13 August 2013
26 / 28
Summary
FCS
13 August 2013
27 / 28
What next?
FCS
13 August 2013
28 / 28