λ Calculus in ५ minutes
https://www.maqbool.net
Mohd Maqbool Alam
Alonzo Church (1903-1995)
Image credit : Wikipedia
Image credit : Wikipedia
Alan Turing (1912 - 1954)
Image credit : Wikipedia
Church-Turing thesis
Main idea
- In 1936, two papers came up with definitions of algorithms.
- Alonzo Church used λ-calculus to define algorithms.
- Alan Turing used Turing machines to define algorithms.
- It turns out that both definitions are equivalent!
Syntax
- A variable is a lambda expression (we will use single, lower-case letters for variables).
- If M and N are lambda expressions, then so are each of the following:
- (M)
- λid.M //abstraction
- MN //application
credit : http://pages.cs.wisc.edu/~horwitz/
Context-free grammar
exp | → | ID | |
| | ( exp ) | ||
| | λ ID . exp | // abstraction | |
| | exp exp | // application |
AST of (λx.x+1)3
abstract-syntax tree
credit : http://pages.cs.wisc.edu/~horwitz/
Logical Operators
-
True
true = λ ab.a
-
False
true = λ ab.b
Logical Operators
-
And
and = λ pq. pqp
-
Or
and = λ pq. ppq
Church Numerals
-
λ ab. ab
-
λ ab . a(ab)
-
λ ab . a(a(a b))
...
λf. (λx. f (x x))(λx. f (x x))
Resources
- http://www.doc.ic.ac.uk/~mrc/
- https://brilliant.org/wiki/lambda-calculus/
- http://pages.cs.wisc.edu/~horwitz/CS704-NOTES/1.LAMBDA-CALCULUS.html
Elixir Delhi Community
-
meetup.com/Elixirlang-Delhi-NCR/
-
t.me/elixirdelhi
-
twitter.com/elixirdelhi
-
facebook.com/ElixirDelhi/
Image credit : https://elixirforum.com/u/romariolopezc/
Lambda Calculus in 5 minutes
By Mohd Maqbool Alam
Lambda Calculus in 5 minutes
Lambda Calculus ElixirConf17 Lighting talk
- 2,264