SlideShare ist ein Scribd-Unternehmen logo
1 von 19
An introduction to call-by-
push-value calculus
H Koba
Overview of this talk
• (1) Introduction
• CbPV
• Embedding CbV and CbN strategy in the same system
• (2) Semantics
• CbV, CbN’s semantics using monads
• CbPV’s semantics, using EM adjunction
Introduction
• Types and
terms
• [Levy, 2016]
(p. 3)
Introduction
• Computations with
side effects
• [Levy, 2016]
(p. 8)
• Behavior of
constructs depends
on the evaluation
strategy
• CbV, CbN, …
Introduction
• CbV strategy
[Levy, 2016]
(p.7)
• Arguments are
evaluated
before
substitution
Introduction
• CbN strategy
[Levy, 2016]
(p.6)
• Substitutions
occur before
evaluating
arguments
Introduction
• How can we handle them in a single calculus?
• Need to control evaluation order
• Call-by-push-value calculus
• distinction between “values” and “computations”
• Values: what do not need evaluation
• Computations: what need evaluation
Introduction
• Call-by-push-value calculus [Levy, 2016] (p. 30)
• Computation types are underlined
Introduction
• [Levy, 2016] (p. 32)
• return and to
• like Haskell’s return
and >>=
• thunk and force
• No counterparts in
Haskell
Introduction
• [Levy, 2016] (p. 37)
• Embedding of CbV to
CbPV
• In function
application, N is
evaluated first
Introduction
• [Levy, 2016] (p. 38)
• Embedding of CbN to
CbPV
• In function
application,
evaluation of N is
delayed (until the
thunk is evaluated)
Summary
• We have a calculus call-by-push-value
• We have embeddings of CbV and CbN to CbPV
Semantics
• (Denotational) semantics of pure typed lambda calculus is CCC (like
Sets)
• Types -> objects, terms -> arrows
• [𝐴] ∈ 𝑂𝑏(𝐶)
• 𝐴 → 𝐵 = 𝐵 𝐴
, 𝐴 × 𝐵 = 𝐴 × 𝐵 , 𝐴 + 𝐵 = 𝐴 + [𝐵]
• Semantics of 𝑥1: 𝐴1, … , 𝑥 𝑛: 𝐴 𝑛 ⊢ 𝑀: 𝐵 is 𝑀 : A1 × ⋯ 𝐴 𝑛 → [𝐵]
• What about non-pure computations?
• Use monads to define denotational semantics
• CbV and CbN need different categories
• CbV -> Kl(T), CbN -> EM(T)
Semantics
• CbV’s semantics: Kl(T)
• Due to Moggi (1988)
• Figure from [Levy, 2016] (p.
15)
• Types -> objects in Kl(T) =
objects in C
• Terms -> arrows in Kl(T) =
Kleisli arrows
Semantics
• CbN’s semantics: EM(T)
• Eilenberg-Moore category
• Figure from [Levy, 2016] (p.
29)
• Types -> objects in EM(T) =
EM algebras
• Terms -> An arrow Γ → 𝑌
(in C) for some EM algebra 𝑌
Semantics
• CbPV’s semantics: The adjunction 𝐹: 𝐶 ↔ 𝐸𝑀(𝑇): 𝑈
• Value -> object in C
• Computation -> object in EM(T) (Eilenberg-Moore algebra)
• Embedding of CbV and CbN preserves semantics:
• Recall 𝐴 → 𝐵 in CbV becomes 𝑈(𝐴 → 𝐹𝐵) in CbPV
• This is isomorphic to 𝐴 → 𝑇𝐵!
• (𝐴 → − ) is a limit, so it is preserved by 𝑈 (right adjoint of 𝐹)
Semantics
• 𝐹 and 𝑈 are adjoint functors
• Recall: ([Levy, 2016] (p. 30))
Summary
• Embedding of CbV and CbN preserves semantics
• Monad is decomposed into adjunction
References
• [Levy, 2016] P.B.Levy, A tutorial on call-by-push-value (2016)
https://www.cs.bham.ac.uk/~pbl/papers/cbpvefftt.pdf
• It describes denotational semantics of CbV and CbN first, then introduces
CbPV using them.
• [Levy, 1999] P.B.Levy. Call-By-Push-Value: A Subsuming Paradigm
(Extended Abstract) (1999)
• [Moggi, 1988] E. Moggi, Computational lambda-calculus and monads
(1988)

Weitere ähnliche Inhalte

Kürzlich hochgeladen

BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 

Kürzlich hochgeladen (20)

BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 

Empfohlen

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
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
 

Empfohlen (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
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
 

An introduction to call-by-push-value

  • 1. An introduction to call-by- push-value calculus H Koba
  • 2. Overview of this talk • (1) Introduction • CbPV • Embedding CbV and CbN strategy in the same system • (2) Semantics • CbV, CbN’s semantics using monads • CbPV’s semantics, using EM adjunction
  • 4. Introduction • Computations with side effects • [Levy, 2016] (p. 8) • Behavior of constructs depends on the evaluation strategy • CbV, CbN, …
  • 5. Introduction • CbV strategy [Levy, 2016] (p.7) • Arguments are evaluated before substitution
  • 6. Introduction • CbN strategy [Levy, 2016] (p.6) • Substitutions occur before evaluating arguments
  • 7. Introduction • How can we handle them in a single calculus? • Need to control evaluation order • Call-by-push-value calculus • distinction between “values” and “computations” • Values: what do not need evaluation • Computations: what need evaluation
  • 8. Introduction • Call-by-push-value calculus [Levy, 2016] (p. 30) • Computation types are underlined
  • 9. Introduction • [Levy, 2016] (p. 32) • return and to • like Haskell’s return and >>= • thunk and force • No counterparts in Haskell
  • 10. Introduction • [Levy, 2016] (p. 37) • Embedding of CbV to CbPV • In function application, N is evaluated first
  • 11. Introduction • [Levy, 2016] (p. 38) • Embedding of CbN to CbPV • In function application, evaluation of N is delayed (until the thunk is evaluated)
  • 12. Summary • We have a calculus call-by-push-value • We have embeddings of CbV and CbN to CbPV
  • 13. Semantics • (Denotational) semantics of pure typed lambda calculus is CCC (like Sets) • Types -> objects, terms -> arrows • [𝐴] ∈ 𝑂𝑏(𝐶) • 𝐴 → 𝐵 = 𝐵 𝐴 , 𝐴 × 𝐵 = 𝐴 × 𝐵 , 𝐴 + 𝐵 = 𝐴 + [𝐵] • Semantics of 𝑥1: 𝐴1, … , 𝑥 𝑛: 𝐴 𝑛 ⊢ 𝑀: 𝐵 is 𝑀 : A1 × ⋯ 𝐴 𝑛 → [𝐵] • What about non-pure computations? • Use monads to define denotational semantics • CbV and CbN need different categories • CbV -> Kl(T), CbN -> EM(T)
  • 14. Semantics • CbV’s semantics: Kl(T) • Due to Moggi (1988) • Figure from [Levy, 2016] (p. 15) • Types -> objects in Kl(T) = objects in C • Terms -> arrows in Kl(T) = Kleisli arrows
  • 15. Semantics • CbN’s semantics: EM(T) • Eilenberg-Moore category • Figure from [Levy, 2016] (p. 29) • Types -> objects in EM(T) = EM algebras • Terms -> An arrow Γ → 𝑌 (in C) for some EM algebra 𝑌
  • 16. Semantics • CbPV’s semantics: The adjunction 𝐹: 𝐶 ↔ 𝐸𝑀(𝑇): 𝑈 • Value -> object in C • Computation -> object in EM(T) (Eilenberg-Moore algebra) • Embedding of CbV and CbN preserves semantics: • Recall 𝐴 → 𝐵 in CbV becomes 𝑈(𝐴 → 𝐹𝐵) in CbPV • This is isomorphic to 𝐴 → 𝑇𝐵! • (𝐴 → − ) is a limit, so it is preserved by 𝑈 (right adjoint of 𝐹)
  • 17. Semantics • 𝐹 and 𝑈 are adjoint functors • Recall: ([Levy, 2016] (p. 30))
  • 18. Summary • Embedding of CbV and CbN preserves semantics • Monad is decomposed into adjunction
  • 19. References • [Levy, 2016] P.B.Levy, A tutorial on call-by-push-value (2016) https://www.cs.bham.ac.uk/~pbl/papers/cbpvefftt.pdf • It describes denotational semantics of CbV and CbN first, then introduces CbPV using them. • [Levy, 1999] P.B.Levy. Call-By-Push-Value: A Subsuming Paradigm (Extended Abstract) (1999) • [Moggi, 1988] E. Moggi, Computational lambda-calculus and monads (1988)

Hinweis der Redaktion

  1. Hello, everyone. I would like to talk about call-by-push-value cal.
  2. Here is the overview of this talk. First we briefly review the lambda calculus, and two well-known evaluation strategies, call-by-value and call-by-name. Then we introduce the calculus named call-by-push-value and how ordinary lambda calculi are embedded in it. (TODO if we have time) Second we define the denotational semantics of call-by-push-value calculus on adjunction. This semantics subsumes ordinary semantics of call-by-value and call-by-name lambda calculi using monads. There is a supplementary material for this talk. It is the slide “The tutorial on call-by-push-value” written by Paul Blain Levy. I provided the link to this, so if you have any questions, it will be helpful. (54 sec)
  3. Here we consider an ordinary typed lambda calculus, with error handling and printing. Here are the rules of this system. Types are generated by Boolean, sum and arrow. Terms are defined as usual, except that they have case analyses (for Boolean and sum types) and let expressions.
  4. Here are constructs that have side effects. We have two kinds of side effects: error handling and printing. In this setting, behavior of these constructs depends on the evaluation strategy, in other words, in which order we calculate terms.
  5. This is an evaluation strategy named “call-by-value”. This name comes from the feature that when we evaluate function applications, arguments are fully evaluated before parameters are replaced with arguments. Let expressions are dealt with like function applications.
  6. There is another evaluation strategy named “call-by-name”. In contrast to call-by-value strategy, call-by-name strategy substitutes parameters with arguments before it evaluates arguments.
  7. We want to handle these two evaluation strategies in a single calculus. In order to achieve that, we need to somehow extend the calculus. That’s because we need to take care of what to evaluate and the order of evaluation. The system is TODO call-by-push-value calculus. It achieves this goal to make a distinction between values and computations. What does it mean?
  8. This is the type system of call-by-push-values. Computation types are underlined.
  9. We have return and to syntax. Return gives a computation that simply returns the given value. to expression evaluates M, and get a value and replace x with it in N, and then evaluate N. Audience familiar with Haskell’s monadic computation may find that this return and to syntax look like return and >>= (bind) operators of monads. In fact they are related. We will see this later, by way of denotational semantics using monads. We also have thunk and force syntax. Thunk captures a computation and turns it into a value. Force gives the computations which evaluate these captured thunks. They don’t have counterparts in Haskell.
  10. This figure describes how to embed call-by-value calculus to call-by-push-value calculus. Note that because of to syntax, we can ensure that in evaluation of a function application, N is evaluated before the substitution occurs.
  11. This figure describes how to embed call-by-name calculus to call-by-push-value calculus. In contrast to call-by-value calculus, in evaluation of a function application, N is captured in a thunk and directly passed to M.
  12. To summarize, we introduced a calculus named call-by-push-value. We have embedding of call-by-value and call-by-name calculi to call-by-push-value. (7:12)
  13. The categorical semantics of pure typed lambda calculus is Cartesian-closed categories, like Sets. The semantics of types are objects, the semantics of terms are arrows. Here “pure” means there are no side effects like printing characters, error handlings, stateful computations and continuations. Then we want denotational semantics of non-pure lambda calculus. There is a well-known approach to this using monads.
  14. It is widely accepted that Kleisli categories Kl(T) for a monad T give semantics of CbV calculus. This is due to Moggi’s work. Types are objects in Kl(T), in other words, objects in C. Terms are mapped to arrows in Kl(T).
  15. This is the call-by-name counterpart of monadic semantics. It is known that Eilenberg-Moore algebras give semantics of call-by-name calculus.
  16. Semantics of call-by-push-value is given by an adjunction between Eilenberg-Moore categories. Semantics of values are objects in C, and semantics of computations are objects in EM(T), in other words, Eilenberg-Moore algebras. Moreover, this embedding preserves semantics.::
  17. Semantics of call-by-push-value is given by an adjunction between Eilenberg-Moore categories.
  18. To summarize, the embedding of CbV and CbN preserves denotational semantics. The monad of computation is decomposed into adjunction.