Introduction to Introduction to Lambda Calculus
York University CSE 3401 Vida Movahedi
York University‐ CSE 3401‐ V. Movahedi
1
10_LambdaCalculus
Introduction to Introduction to Lambda Calculus York University CSE - - PowerPoint PPT Presentation
Introduction to Introduction to Lambda Calculus York University CSE 3401 Vida Movahedi 1 York University CSE 3401 V. Movahedi 10_LambdaCalculus Overview Overview Functions F i calculus : notation for functions
York University‐ CSE 3401‐ V. Movahedi
1
10_LambdaCalculus
[ref : Chap 1 & 2 of Selinger’s lecture notes on Lambda Calculus: [ref.: Chap. 1 & 2 of Selinger s lecture notes on Lambda Calculus:
http://www.mathstat.dal.ca/~selinger/papers/lambdanotes.pdf ] [also Wikipedia on Lambda calculus] [I am using George Tourlakis’ notations for renaming and substitution]
York University‐ CSE 3401‐ V. Movahedi
2
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
3
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
4
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
5
10_LambdaCalculus
2)(5)
2
York University‐ CSE 3401‐ V. Movahedi
6
10_LambdaCalculus
3 2
3 2 3 2
3 2
3 2
3 2 3 2
York University‐ CSE 3401‐ V. Movahedi
7
10_LambdaCalculus
f f f
York University‐ CSE 3401‐ V. Movahedi
8
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
9
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
10
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
11
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
12
10_LambdaCalculus
α
– Note x is a bound variable in this definition – Note x is a bound variable in this definition
York University‐ CSE 3401‐ V. Movahedi
13
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
14
10_LambdaCalculus
] : [ N N x x ≡ = if ]) : [ ])( : [ ( ] : )[ ( ] : [ ] [ N x P N x M N x MP y x y N x y = = ≡ = ≠ ≡ = and if ) ( ]) : [ .( ] : )[ . ( . ] : )[ . ( N FV y y x N x M y N x M y M x N x M x ∉ ≠ = ≡ = ≡ = λ λ λ λ fresh and if ' ), ( , ]) : }[ ' \ { '.( ] : )[ . ( y N FV y y x N x y y M y N x M y ∈ ≠ = ≡ = λ λ
Capture case! Bound variable y is renamed to y’ to avoid capture of free variable y in N
York University‐ CSE 3401‐ V. Movahedi
15
avoid capture of free variable y in N
10_LambdaCalculus
For example: (λ
2)( )
2 – (λx.x2)(5) β 25 – (λx.y)(z) β y
– β‐redex: A term of the form (λx.M)N (a lamda abstraction applied to another term) – It reduces to M[x:=N] – The result is called a reduct – β‐reduction is applied recursively until there is no more – β‐reduction is applied recursively until there is no more redexes left to reduce – A lambda term without any β‐redexes is said to be in β‐ normal form normal form
York University‐ CSE 3401‐ V. Movahedi
16
10_LambdaCalculus
β
York University‐ CSE 3401‐ V. Movahedi
17
10_LambdaCalculus
I i i bili A il d h d ll – Intuitive computability: A pencil‐and‐paper method to allow a trained person to calculate f(n) for any given n? 1. Turing: A function is computable if and only if it can be g p y computed by the Turing machine. 2. Gödel: A function is computable if and only if it is general recursive recursive. 3. Church: A function is computable if it can be written as a lambda term.
York University‐ CSE 3401‐ V. Movahedi
18
10_LambdaCalculus
York University‐ CSE 3401‐ V. Movahedi
19
10_LambdaCalculus