SlideShare une entreprise Scribd logo
1  sur  92
Télécharger pour lire hors ligne
λ-Calculus: A Brief History
Of Functional Programming
@yassine_meherzi
@yassine_meherziXEBICON19
@yassine_meherziXEBICON19
@yassine_meherziXEBICON19
David Hilbert
1862 – 1943
@yassine_meherziXEBICON19
Problème d’arrêt
David Hilbert
1862 – 1943
@yassine_meherziXEBICON19
Problème d’arrêt
David Hilbert
1862 – 1943
La réponse est NON
@yassine_meherziXEBICON19
Machine de Turing
(1936)
@yassine_meherziXEBICON19
Machine de Turing
(1936)
Lambda-Calcul
(1935-1936)
@yassine_meherziXEBICON19
Machine de Turing
Etat
Lambda-Calcul
Tout est fonction ≠
@yassine_meherziXEBICON19
Machine de Turing
Etat
Lambda-Calcul
Tout est fonction
Thèse
Church-Turing
@yassine_meherziXEBICON19
Machine de Turing
Etat
Lambda-Calcul
Tout est fonction
@yassine_meherziXEBICON19
@yassine_meherzi
Yassine Meherzi
Sr. Software Crafter
λ x.e
Syntaxe
λ-Abstraction
@yassine_meherziXEBICON19
λ x.eDébut de la fonction
Syntaxe
@yassine_meherziXEBICON19
λ x.e
Variable
Début de la fonction
Syntaxe
@yassine_meherziXEBICON19
λ x.e
Variable
Fin des arguments
Début de la fonction
Syntaxe
@yassine_meherziXEBICON19
λ x.e
Variable
Fin des arguments
ExpressionDébut de la fonction
Syntaxe
@yassine_meherziXEBICON19
e ::= variable (x, y, z…) Identifiant
Syntaxe
@yassine_meherziXEBICON19
e ::= variable (x, y, z…)
| λ variable . e’
Identifiant
Abstraction
Syntaxe
@yassine_meherziXEBICON19
e ::= variable (x, y, z…)
| λ variable . e’
| e1 e2
Syntaxe
Identifiant
Abstraction
Application
@yassine_meherziXEBICON19
e ::= variable (x, y, z…)
| λ variable . e’
| e1 e2
| ( e’ )
Syntaxe
Identifiant
Abstraction
Application
Groupement
@yassine_meherziXEBICON19
λ x.x
Identité
@yassine_meherziXEBICON19
Application (x = 5)
Application
(λ x.x) 5
@yassine_meherziXEBICON19
Application (x = 5)
Application
(λ x.x) 5
(λ x.x) 5
β-réduction
@yassine_meherziXEBICON19
Application (x = 5)
Application
(λ x.x) 5
(λ x.x) 5
5
β-réduction
@yassine_meherziXEBICON19
(λ x.x+1) 2
Application (x = 2)
Application
@yassine_meherziXEBICON19
(λ x.x+1) 2
Application (x = 2)
Application
@yassine_meherziXEBICON19
(λ x.x+1) 2
2+1
Application (x = 2)
Application
Redex
expression réductible
@yassine_meherziXEBICON19
(λ x.x+1) 2
2+1
3
Application (x = 2)
Application
Redex
expression réductible
@yassine_meherziXEBICON19
Ordre d’application
f a
Sens de réduction
@yassine_meherziXEBICON19
Ordre d’application
f g a
Sens de réduction
@yassine_meherziXEBICON19
Ordre d’application
(f g) a
Sens de réduction
@yassine_meherziXEBICON19
(λ x.x+2 λ y.y) 5
Ordre d’application
f g
@yassine_meherziXEBICON19
(λ x.x+2 λ y.y) 5
(λ y.y+2) 5
Ordre d’application
f g
@yassine_meherziXEBICON19
(λ x.x+2 λ y.y) 5
(λ y.y+2) 5
(λ y.y+2) 5
5+2
7
Ordre d’application
f g
@yassine_meherziXEBICON19
(λ x. x+x) (2 * 3)
Application (x = 2 * 3)
Stratégies d’évaluation
f a
@yassine_meherziXEBICON19
(λ x. x+x) (2 * 3)
(2 * 3) + (2 * 3)
6 + 6
12
Application (x = 2 * 3)
Stratégies d’évaluation
@yassine_meherziXEBICON19
(λ x. x+x) (2 * 3)
(2 * 3) + (2 * 3)
6 + 6
12
Application (x = 2 * 3)
(λ x. x+x) (2 * 3)
(λ x. x+x) 6
6 + 6
12
Stratégies d’évaluation
@yassine_meherziXEBICON19
(λ x. x+x) (2 * 3)
(2 * 3) + (2 * 3)
6 + 6
12
Application (x = 2 * 3)
(λ x. x+x) (2 * 3)
(λ x. x+x) 6
6 + 6
12
Ordre normal
Appel par nom
Ordre applicatif
Appel par valeur
Stratégies d’évaluation
@yassine_meherziXEBICON19
(λ x. a+1) (2 * 3)
Application (x = 2 * 3)
Stratégies d’évaluation
f a
@yassine_meherziXEBICON19
(λ x. a+1) (2 * 3)
a+1
Application (x = 2 * 3)
Stratégies d’évaluation
@yassine_meherziXEBICON19
(λ x. a+1) (2 * 3)
a+1
Application (x = 2 * 3)
(λ x. a+1) (2 * 3)
(λ x. a+1) 6
a+1
Stratégies d’évaluation
@yassine_meherziXEBICON19
(λ x. a+1) (2 * 3)
a+1
Application (x = 2 * 3)
(λ x. a+1) (2 * 3)
(λ x. a+1) 6
a+1
Stratégies d’évaluation
Evaluation retardée Evaluation immédiate
@yassine_meherziXEBICON19
Ordre normal
Appel par nom
Evaluation retardée
Ordre applicatif
Appel par valeur
Evaluation immédiate
Church-Rosser
Stratégies d’évaluation
@yassine_meherziXEBICON19
Ordre normal
Appel par nom
Evaluation retardée
Ordre applicatif
Appel par valeur
Evaluation immédiate
Church-Rosser
Stratégies d’évaluation
@yassine_meherziXEBICON19
Fonction anonyme
λ x.x+y
@yassine_meherziXEBICON19
λ x.x+y
Fonction anonyme
x: variable liée
y: variable libre
@yassine_meherziXEBICON19
Fonction anonyme
λ x.x+y
x: variable liée
y: variable libre
@yassine_meherziXEBICON19
Fonction pure
Fonction pure
x x + 1
Fonction pure
e ::= variable (x, y, z…)
| λ variable . e’
| e1 e2
| ( e’ )
Syntaxe
Identifiant
Abstraction
Application
Groupement
@yassine_meherziXEBICON19
λ x.x
Application (x = fonction)
Fonction d’ordre supérieur
@yassine_meherziXEBICON19
Fonction d’ordre supérieur
(λ x.x) λ y.y+1
Application (x = λ y.y+1 )
@yassine_meherziXEBICON19
Fonction d’ordre supérieur
(λ x.x) λ y.y+1
λ y.y+1
Application (x = λ y.y+1 )
Identité(f) = f
@yassine_meherziXEBICON19
Fonction d’ordre supérieur
@yassine_meherziXEBICON19
(x,y) => x+y ?
Fonction unaire
@yassine_meherziXEBICON19
(λxy. x+y) ?
Fonction unaire
@yassine_meherziXEBICON19
(λxy. x+y) => (λx. λy. x+y)
Fonction unaire
Curryfication
@yassine_meherziXEBICON19
Fonction unaire
(λ x. λ y. x+y) 1 2
Application (x = 1) (y = 2)
@yassine_meherziXEBICON19
Fonction unaire
(λ x. λ y. x+y) 1 2
(λ x. λ y. x+y) 1 2
Application (x = 1) (y = 2)
@yassine_meherziXEBICON19
Fonction unaire
(λ x. λ y. x+y) 1 2
(λ x. λ y. x+y) 1 2
(λ y. 1+y) 2
Application (x = 1) (y = 2)
Application partielle
@yassine_meherziXEBICON19
Fonction unaire
(λ x. λ y. x+y) 1 2
(λ x. λ y. x+y) 1 2
(λ y. 1+y) 2
1+2 = 3
Application (x = 1) (y = 2)
Application partielle
@yassine_meherziXEBICON19
Fonction unaire
@yassine_meherziXEBICON19
1936 λ-Calcul
1941 λ-Calcul simplement typé
1936 λ-Calcul
1941 λ-Calcul simplement typé
1958 Lisp 2007 Clojure1975 Scheme
1936 λ-Calcul
1941 λ-Calcul simplement typé
1958 Lisp 1975 Scheme 2007 Clojure
1972 λ-Calcul polymorphe
1936 λ-Calcul
1941 λ-Calcul simplement typé
1958 Lisp
1977 FP
2007 Clojure
1990 Haskell
1975 Scheme
1972 λ-Calcul polymorphe
1973 ML 1985 Miranda 1987 Caml1984 SML
1936 λ-Calcul
1941 λ-Calcul simplement typé
1958 Lisp 2007 Clojure
1990 Haskell
1975 Scheme
1972 λ-Calcul polymorphe
1973 ML
1986 Erlang
1977 FP
1985 Miranda1984 SML
2011 Elixir
1987 Caml
1936 λ-Calcul
1941 λ-Calcul simplement typé
1958 Lisp 2007 Clojure
1990 Haskell
1975 Scheme
1972 λ-Calcul polymorphe
1973 ML
2003 Scala
2002 F#
1996 OCaml
1986 Erlang 2011 Elixir
1977 FP
1985 Miranda 1987 Caml1984 SML
Conclusion
@yassine_meherziXEBICON19
Conclusion
@yassine_meherziXEBICON19
Conclusion
@yassine_meherziXEBICON19
Aller plus loin …
@yassine_meherzi
True = λ a. λb. a
False = λ a. λb. b
if = p ? e1 : e2
if = predicate x then-clause else-clause
If = λ p. λa. λb. p a b
Booléens
@yassine_meherziXEBICON19
True
False
And
Or
Not1
Not2
Xor
If
Booléens
λa. λb. a
λa. λb. b
λp. λq. p q p
λp. λq. p p q
λp. λa. λb. p b a
λp. p(λa. λb.b) (λa. λb.a)
λa. λb. a (not b) b
λp. λa. λb. p a b
@yassine_meherziXEBICON19
Y = λf. (λx. f(x x)) (λx. f(x x))
Récursivité
@yassine_meherziXEBICON19

Contenu connexe

En vedette

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

En vedette (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Lambda Calcul Xebicon'19