The Challenge of Typed Expressiveness in Concurrency Jorge A. Prez - - PowerPoint PPT Presentation
The Challenge of Typed Expressiveness in Concurrency Jorge A. Prez - - PowerPoint PPT Presentation
The Challenge of Typed Expressiveness in Concurrency Jorge A. Prez University of Groningen & CWI, Amsterdam Open Problems in Concurrency Theory Vienna, June 27, 2017 This Talk, In One Slide My view on the need for mature foundations for
This Talk, In One Slide
My view on the need for mature foundations for communication, distribution, and types
Based on a FORTE 2016 paper
The Future (According to Gartner)
Communication and distribution at a (very) large-scale:
- 2018: 6 billion connected ‘things’ requesting support
- 2020: Autonomous agents part of 5% of all transactions
- 2020: Smart agents facilitate 40% of mobile interactions
The Present: Languages Promoted by Industry
- Facebook’s Flow (gradual types for JavaScript)
- Google’s Go (concurrency, message-passing communication)
- Mozilla’s Rust (affine references/ownership types)
- Erlang (actor-based concurrency)
The Future (According to Gartner)
Communication and distribution at a (very) large-scale:
- 2018: 6 billion connected ‘things’ requesting support
- 2020: Autonomous agents part of 5% of all transactions
- 2020: Smart agents facilitate 40% of mobile interactions
Communication & Types: Here to Stay!
The Present: Languages Promoted by Industry
- Facebook’s Flow (gradual types for JavaScript)
- Google’s Go (concurrency, message-passing communication)
- Mozilla’s Rust (affine references/ownership types)
- Erlang (actor-based concurrency)
The Future (According to Gartner)
Communication and distribution at a (very) large-scale:
- 2018: 6 billion connected ‘things’ requesting support
- 2020: Autonomous agents part of 5% of all transactions
- 2020: Smart agents facilitate 40% of mobile interactions
We Need Foundations. But Which Ones?
Much research on models of concurrency and communication.
- Petri Nets, graph transformation & rewriting techniques,
declarative formalisms, process calculi, etc Process calculi already support communication and types:
- Simple formalization of message-passing concurrency
- Basis for type systems for concurrent programs
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 5 / 30
We Need Foundations. But Which Ones?
Much research on models of concurrency and communication.
- Petri Nets, graph transformation & rewriting techniques,
declarative formalisms, process calculi, etc Process calculi already support communication and types:
- Simple formalization of message-passing concurrency
- Basis for type systems for concurrent programs
Challenges
- Many different foundations for types and communication
→ No single notion of correctness, but many!
- How to transfer their analysis techniques into practice?
- How to relate the tools derived from the different foundations?
→ A “Chomsky hierarchy” of [typed] concurrent languages?
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 5 / 30
This Talk: A Plea for Typed Expressiveness
- We need rigorous comparisons between well-established
(but distinct) typed process frameworks
- New bridges between different typed models
- Understand complementarities of their analysis techniques
- Clear practical significance, given reality and trends in IT
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 6 / 30
This Talk: A Plea for Typed Expressiveness
- We need rigorous comparisons between well-established
(but distinct) typed process frameworks
- New bridges between different typed models
- Understand complementarities of their analysis techniques
- Clear practical significance, given reality and trends in IT
My Claim: Maturity via Expressiveness
- We may build upon approaches to relative expressiveness,
as studied in concurrency theory
- Fruitful in the untyped setting, they should elucidate
connections in a typed setting
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 6 / 30
Outline
Expressiveness in Concurrency Towards Relative Expressiveness for Behavioral Types Future Directions Concluding Remarks (and Shameless Publicity)
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 7 / 30
Untyped Expressiveness: Key Ideas
Many efforts on assessing the expressivity of process calculi. Typical questions:
- What is the nature of a process construct?
- Can we transfer reasoning techniques across languages?
Main technical device: Language encodings
- Translate a source language LS into a target language LT
satisfying certain encodability criteria
- Criteria represent abstract indicators of an encoding’s quality;
they can be syntactic or semantic
- No agreement on “good encodings”...
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 8 / 30
Untyped Expressiveness: Outcomes
Encodability results:
- A positive encodability result
→ All behaviors expressible in LS can also be expressed in LT
- A negative encodability result
→ There are behaviors expressible in LS but not in LT Combinations of results may indicate expressiveness gaps.
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 9 / 30
Sucesses of Untyped Expressiveness
Encodability results have clarified our understanding on interaction and communication as abstracted by process calculi.
- Formally relate different computational models
- Encoding the λ-calculus in the π-calculus [cf. Milner]
- (Un)decidability of termination/convergence in CCS [cf. Busi et al]
- Assess the expressive power of process languages
- The interplay of choice and (a)synchronous communication, and
its influence on the π-calculus [cf. Palamidessi, Honda, Boudol]
- Transfer proof techniques between different calculi
- Encoding of process mobility into name mobility: key to the
behavioral theory of higher-order process calculi [cf. Sangiorgi]
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 10 / 30
Outline
Expressiveness in Concurrency Towards Relative Expressiveness for Behavioral Types Future Directions Concluding Remarks (and Shameless Publicity)
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 11 / 30
Type Systems for Concurrency
The development of process languages with type-based techniques has received much attention Type systems have revealed a rich landscape of concurrent models with disciplined communication
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 12 / 30
Behavioral Type Systems
- In contrast to usual data types, behavioral types represent
causality, alternatives, repetition.
- A behavioral type for a communication channel defines
- its resource-usage policy
- the series of actions realized through that channel along time
- Often defined on top of process calculi. General verification
techniques that may be tailored to different actual languages
- A notable class of behavioral types: session types
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 13 / 30
Behavioral Types: An Incomplete Timeline
1990 2017
Sortings for the π-calculus
[Milner]
1991
Behavioral Types: An Incomplete Timeline
1990 2017
Sortings for the π-calculus
[Milner]
1991
Type & Effect System for CML
[Nielson & Nielson]
1993
Types for Dyadic Interaction
[Honda]
1993
A Typed Interaction-based Language
[Takeuchi et al.]
1994
Linear Types for π
[Kobayashi et al.]
1996
Types for Deadlock-freedom in π
[Kobayashi]
1997
Binary Session Types
[Honda et al.]
1998
Behavioral Types: An Incomplete Timeline
1990 2017
Sortings for the π-calculus
[Milner]
1991
Type & Effect System for CML
[Nielson & Nielson]
1993
Types for Dyadic Interaction
[Honda]
1993
A Typed Interaction-based Language
[Takeuchi et al.]
1994
Linear Types for π
[Kobayashi et al.]
1996
Types for Deadlock-freedom in π
[Kobayashi]
1997
Binary Session Types
[Honda et al.]
1998
Types for Non-Uniform Objects
[Ravara & Vasconcelos]
2000
Generic Process Types
[Igarashi & Kobayashi]
2001
Spatial-behavioral Types
[Caires]
2008
Multiparty Session Types
[Honda et al.]
2008
Behavioral Types: An Incomplete Timeline
1990 2017
Sortings for the π-calculus
[Milner]
1991
Type & Effect System for CML
[Nielson & Nielson]
1993
Types for Dyadic Interaction
[Honda]
1993
A Typed Interaction-based Language
[Takeuchi et al.]
1994
Linear Types for π
[Kobayashi et al.]
1996
Types for Deadlock-freedom in π
[Kobayashi]
1997
Binary Session Types
[Honda et al.]
1998
Types for Non-Uniform Objects
[Ravara & Vasconcelos]
2000
Generic Process Types
[Igarashi & Kobayashi]
2001
Spatial-behavioral Types
[Caires]
2008
Multiparty Session Types
[Honda et al.]
2008
Conversation Types
[Caires & Vieira]
2009
Parameterized Multiparty Session Types
[Yoshida et al.]
2010
Linear Session Types, Revisited
[Giunti & Vasconcelos]
2010
Session Types as Linear Logic
[Caires & Pfenning]
2010
Behavioral Types: An Incomplete Timeline
1990 2017
Sortings for the π-calculus
[Milner]
1991
Type & Effect System for CML
[Nielson & Nielson]
1993
Types for Dyadic Interaction
[Honda]
1993
A Typed Interaction-based Language
[Takeuchi et al.]
1994
Linear Types for π
[Kobayashi et al.]
1996
Types for Deadlock-freedom in π
[Kobayashi]
1997
Binary Session Types
[Honda et al.]
1998
Types for Non-Uniform Objects
[Ravara & Vasconcelos]
2000
Generic Process Types
[Igarashi & Kobayashi]
2001
Spatial-behavioral Types
[Caires]
2008
Multiparty Session Types
[Honda et al.]
2008
Conversation Types
[Caires & Vieira]
2009
Parameterized Multiparty Session Types
[Yoshida et al.]
2010
Linear Session Types, Revisited
[Giunti & Vasconcelos]
2010
Session Types as Linear Logic
[Caires & Pfenning]
2010
Dynamic Multirole Session Types
[Deniélou & Yoshida]
2011
Choreographic Programming
[Carbone & Montesi]
2013
Behavioral Separation Types
[Caires & Seco]
2013
Context-free Session Types
[Thiemann & Vasconcelos]
2016
Challenges on Typed Expressiveness
Given the jungle of typed process models, the need for establishing formal relations becomes pressing Research would benefit from efforts aimed at:
- 1. Relating different typed models
- 2. Assessing the expressivity of behaviorally typed languages
- 3. Transferring techniques between different typed formalisms
These are challenging issues!
As different type systems rely on unrelated concepts, discrepancies on typability arise easily Hence, objective comparisons are hard to establish
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 15 / 30
A Brief Overview of Related Efforts
Existing Works
- 1. Connections Between Linear Types and Session Types
- 2. Connections Between Session Types and Automata
- 3. Other Approaches (e.g., Types and Declarative Models)
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 16 / 30
A Brief Overview of Related Efforts (1/3)
Connections Between Linear Types and Session Types
- Kobayashi observed that linear types can represent session
types, using a continuation-passing style translation1
- Dardha et al. formalized and extended this observation2
- Carbone et al. used this encoding to formally relate progress
in session π-calculus to lock-freedom in the linear π-calculus3
- The encoding has had significant impact—cf. Scalas et al.’s
integration of binary sessions into Scala4
1“Type systems for concurrent programs” in Formal Methods at the Crossroads, 2003. 2“Session types revisited”, in PPDP 2012. 3“Progress as compositional lock-freedom’,’ in COORDINATION 2014. 4“A Linear Decomposition of Multiparty Sessions for Safe Distributed Programming”, in
ECOOP 2017.
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 17 / 30
A Brief Overview of Related Efforts (2/3)
Connections Between Session Types and Automata
- Villard showed that a subclass of communicating finite state
machines (CFSMs) characterizes binary session types5
- Deniélou and Yoshida extended this characterization to
multiparty session types, inhering safety / liveness from CFSMs.6 Later they gave a sound and complete characterization of multiparty session types as CFSMs7
- Lange et al. developed techniques to synthesize global
graphs from CFSMs, covering more global protocols8
5“Heaps and Hops”. Ph.D. thesis, 2011. 6“Multiparty session types meet communicating automata”, in ESOP 2012. 7“Multiparty compatibility in communicating automata: characterisation and synthesis”, in
ICALP 2013.
8“From communicating machines to graphical choreographies”, in POPL 2015.
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 18 / 30
A Brief Overview of Related Efforts (3/3)
Other Approaches
- Hüttel has given type systems for the ψ-calculus that
generalize different type systems for the π-calculus9
- López et al. encoded binary sessions into a declarative
process calculus, enabling the transfer of LTL reasoning10
- Padovani has related labeled choice operators in session
types with intersection and union types11
- Orchard and Yoshida encoded PCF with an effect type system
into a session π-calculus; a reverse encoding enables a new implementation of sessions into Haskell12
9“Typed ψ-calculi”, in CONCUR 2011. 10“Towards a unified framework for declarative structured communications”, in PLACES 2009. 11“Session types = intersection types + union types”, in ITRS 2010. 12“Effects as sessions, sessions as effects”, in POPL 2016.
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 19 / 30
Outline
Expressiveness in Concurrency Towards Relative Expressiveness for Behavioral Types Future Directions Concluding Remarks (and Shameless Publicity)
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 20 / 30
Future Directions
Although existing works offer insightful relations between different frameworks of behavioral types, they are isolated. Since each work uses different techniques to relate typed models, further research is needed to integrate their results.
Promising Research Directions
- 1. Expressiveness Without Processes
- 2. Typed Encodability Criteria
- 3. A Logic Yardstick for Typed Expressiveness
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 21 / 30
Expressiveness Without Processes
While process approaches are convenient in theory, the analysis
- f practical multiparty communications uses mostly types
Very rich type theories, increasingly closer to process languages Recent works explore relative expressiveness for types, exploiting process techniques to define their their semantics:
- Demangeon and Yoshida contrasted different classes of
multiparty session types by comparing trace denotations13
- Cruz-Filipe and Montesi have studied the relative expressivity
- f choreographies (multiparty session types)14
13“On the expressiveness of multiparty sessions”, in FSTTCS 2015. 14“Choreographies, Computationally”, in arXiv (1510.03271).
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 22 / 30
Typed Encodability Criteria
Clarifying how existing frameworks for (untyped) relative expressiveness can account for behavioral types Understand how types induce encodability results and to relate different behavioral types in source/target languages Kouzapas et al. (ESOP’16) define a notion of typed encoding that extends Gorla’s framework with session types. Both processes and types need to be translated.15
15“On the relative expressiveness of higher- order session processes”, in ESOP 2016.
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 23 / 30
CHoCO: Yardstick for Typed Expressiveness
What should be a fair yardstick to compare behavioral types? Curry-Howard correspondences for concurrency (CHoCO) define a fundamental model of behavioral types, which naturally identifies type preserving and deadlock-free process models:16 CONCURRENCY LOGIC Session types ⇐
⇒
Propositions π-calculus processes ⇐
⇒
Proofs Process communication ⇐
⇒
Proof reduction
16Caires and Pfenning: “Session types as intuitionistic linear propositions”. In CONCUR
2010.
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 24 / 30
CHoCO: Yardstick for Typed Expressiveness
Some recent steps:
- EXPRESS/SOS’15
Dardha and P . compare two classes of deadlock-free, session processes: one results from CHoCO; the other mixes Dardha et al.’s encoding and Kobayashi’s usage types17
- FORTE’16
Caires and P . define the first logical explanation of multiparty sessions, using binary session types / CHoCO 18
- ESOP’17
Caires and P . extend CHoCO with logical modalities for non-deterministic behavior. It supports a typed encoding of the λ-calculus with threads, sessions, and exceptions19
17“Comparing deadlock-free session typed processes”, in EXPRESS/SOS 2015. 18“Multiparty session types within a canonical binary theory, and beyond”, in FORTE 2016. 19“Linearity, Control Effects, and Behavioral Types”, in ESOP 2017.
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 25 / 30
Curry-Howard for Concurrency
Polymorphism (2013) Proof-Carrying Code (2011) Objects (2015) Logical Relations (2012) Dependent Types (2011) Multiparty Protocols (2016) Monitors & Blame (2016) Co-recursion (2014) Conversation Types Multiparty STs Choreographic Programming Linear Types w. Usages Linear/Affine Types Generic Process Types Non Determinism (2017)
Outline
Expressiveness in Concurrency Towards Relative Expressiveness for Behavioral Types Future Directions Concluding Remarks (and Shameless Publicity)
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 27 / 30
Wrapping Up
We need mature models of concurrency and distribution!
- Significant progresses on formal specification and analysis
techniques for concurrent processes
- Our understanding is scattered around in valuable, yet
isolated, models and frameworks Maturity from systematic comparisons of known techniques:
- We can draw inspiration from approaches and techniques
developed for untyped concurrent models
- Curry-Howard for concurrency (CHoCO) should be a yardstick
in comparisons
- A community-wide effort needed to clarify relationships and
enable tool interoperability
Jorge A. Pérez The Challenge of Typed Expressiveness in Concurrency 28 / 30
RADICAL 2017
A Workshop on Recent Advances in Concurrency and Logic
- Co-located with CONCUR 2017 (Monday, September 4)
- Deadline (3-page talk proposals): 30 June 2017 (this Friday!)
- Invited speakers: Luís Caires & Luke Ong
Topics of interest include:
- design, verification, synthesis for concurrent systems
- strategic reasoning for distributed and multi-agent systems
- analysis and validation of concurrent and distributed programs