Abstract
Session types have emerged as a typing discipline for communication protocols. Existing calculi with session types come equipped with many different primitives that combine communication with the introduction or elimination of the transmitted value.
We present a foundational session type calculus with a lightweight operational semantics. It fully decouples communication from the introduction and elimination of data and thus features a single communication reduction, which acts as a rendezvous between senders and receivers. We achieve this decoupling by introducing label-dependent session types, a minimalist value-dependent session type system with subtyping. The system is sufficiently powerful to simulate existing functional session type systems. Compared to such systems, label-dependent session types place fewer restrictions on the code. We further introduce primitive recursion over natural numbers at the type level, thus allowing to describe protocols whose behaviour depends on numbers exchanged in messages. An algorithmic type checking system is introduced and proved equivalent to its declarative counterpart. The new calculus showcases a novel lightweight integration of dependent types and linear typing, with has uses beyond session type systems.
Supplemental Material
- Danel Ahman, Cédric Fournet, Catalin Hritcu, Kenji Maillard, Aseem Rastogi, and Nikhil Swamy. 2018. Recalling a Witness: Foundations and Applications of Monotonic State. PACMPL 2, POPL (2018), 65:1–65:30.Google Scholar
Digital Library
- David Aspinall and Adriana B. Compagnoni. 2001. Subtyping Dependent Types. Theoretical Computer Science 266, 1-2 (2001), 273–309. Google Scholar
Digital Library
- Robert Atkey. 2018. Syntax and Semantics of Quantitative Type Theory. In LICS. ACM, 56–65.Google Scholar
- Pedro Baltazar, Dimitris Mostrous, and Vasco Thudichum Vasconcelos. 2012. Linearly Refined Session Types. In LINEARITY (EPTCS), Vol. 101. 38–49.Google Scholar
- Jean-Philippe Bernardy, Mathieu Boespflug, Ryan R. Newton, Simon Peyton Jones, and Arnaud Spiwack. 2018. Linear Haskell: Practical Linearity in a Higher-Order Polymorphic Language. PACMPL 2, POPL (2018), 5:1–5:29.Google Scholar
- Eduardo Bonelli, Adriana B. Compagnoni, and Elsa L. Gunter. 2004. Correspondence Assertions for Process Synchronization in Concurrent Communications. Electr. Notes Theor. Comput. Sci. 97 (2004), 175–195. Google Scholar
Cross Ref
- Edwin Brady. 2013. Idris, A General-Purpose Dependently Typed Programming Language: Design and Implementation. J. Funct. Program. 23, 5 (2013), 552–593. Google Scholar
Cross Ref
- Edwin Brady. 2017. Type-driven Development of Concurrent Communicating Systems. Computer Science (AGH) 18, 3 (2017). Google Scholar
Cross Ref
- Luís Caires and Frank Pfenning. 2010. Session Types as Intuitionistic Linear Propositions. In CONCUR (LNCS), Vol. 6269. Springer, Paris, France, 222–236.Google Scholar
- Luís Caires, Frank Pfenning, and Bernardo Toninho. 2016. Linear logic propositions as session types. Mathematical Structures in Computer Science 26, 3 (2016), 367–423. Google Scholar
Cross Ref
- Chris Casinghino, Vilhelm Sjöberg, and Stephanie Weirich. 2014. Combining Proofs and Programs in a Dependently Typed Language. In POPL, Suresh Jagannathan and Peter Sewell (Eds.). ACM, 33–46. Google Scholar
Digital Library
- Giuseppe Castagna, Mariangiola Dezani-Ciancaglini, Elena Giachino, and Luca Padovani. 2009. Foundations of Session Types. In Principles and Practice of Declarative Programming, PPDP 2009, António Porto and Francisco J. López-Fraguas (Eds.). ACM, Coimbra, Portugal, 219–230.Google Scholar
Digital Library
- Giuseppe Castagna, Tommaso Petrucciani, and Kim Nguyen. 2016. Set-Theoretic Types for Polymorphic Variants. In ICFP. ACM, 378–391.Google Scholar
- Iliano Cervesato and Frank Pfenning. 1996. A Linear Logical Framework. In LICS. IEEE Computer Society, 264–275.Google Scholar
- Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, Alceste Scalas, and Nobuko Yoshida. 2017. On the Preciseness of Subtyping in Session Types. Logical Methods in Computer Science 13, 2 (2017).Google Scholar
- Ugo Dal Lago and Marco Gaboardi. 2011. Linear Dependent Types and Relative Completeness. Logical Methods in Computer Science 8, 4 (2011).Google Scholar
- Ugo Dal Lago and Barbara Petit. 2012. Linear Dependent Types in a Call-By-Value Scenario. In PPDP. ACM, 115–126.Google Scholar
- Ornela Dardha, Elena Giachino, and Davide Sangiorgi. 2012. Session Types Revisited. In PPDP. ACM, 139–150.Google Scholar
- Mariangiola Dezani-Ciancaglini, Sophia Drossopoulou, Dimitris Mostrous, and Nobuko Yoshida. 2009. Objects and Session Types. Information and Computation 207, 5 (2009), 595–641.Google Scholar
Digital Library
- Joshua Dunfield and Neelakantan R. Krishnaswami. 2013. Complete and easy bidirectional typechecking for higher-rank polymorphism. In ICFP. ACM, 429–442.Google Scholar
- Francisco Ferreira and Brigitte Pientka. 2014. Bidirectional Elaboration of Dependently Typed Programs. In PPDP. ACM, 161–174.Google Scholar
- Jacques Garrigue. 1998. Programming with Polymorphic Variants. In In ACM Workshop on ML.Google Scholar
- Simon J. Gay and Malcolm Hole. 2005. Subtyping for Session Types in the Pi Calculus. Acta Informatica 42, 2-3 (2005), 191–225.Google Scholar
Cross Ref
- Simon J. Gay and Vasco Thudichum Vasconcelos. 2010. Linear Type Theory for Asynchronous Session Types. J. Funct. Program. 20, 1 (2010), 19–50.Google Scholar
Digital Library
- Simon J. Gay, Vasco T. Vasconcelos, António Ravara, Nils Gesbert, and Alexandre Z. Caldeira. 2010. Modular Session Types for Distributed Object-Oriented Programming, See [ POPL 2010 2010 ], 299–312. Google Scholar
Digital Library
- Matthew A. Goto, Radha Jagadeesan, Alan Jeffrey, Corin Pitcher, and James Riely. 2016. An Extensible Approach to Session Polymorphism. Mathematical Structures in Computer Science 26, 3 (2016), 465–509.Google Scholar
Cross Ref
- Robert Harper. 2016. Practical Foundations for Programming Languages (second ed.). Cambridge University Press.Google Scholar
- Kohei Honda. 1993. Types for Dyadic Interaction. In Proceedings of 4th International Conference on Concurrency Theory (LNCS), Eike Best (Ed.). Springer, 509–523.Google Scholar
Cross Ref
- Kohei Honda, Aybek Mukhamedov, Gary Brown, Tzu-Chun Chen, and Nobuko Yoshida. 2011. Scribbling Interactions with a Formal Foundation. In ICDCIT 2011 (LNCS), Vol. 6536. Springer, Bhubaneshwar, India, 55–75.Google Scholar
Cross Ref
- Kohei Honda, Vasco Thudichum Vasconcelos, and Makoto Kubo. 1998. Language Primitives and Type Discipline for Structured Communication-Based Programming. In Proc. 7th ESOP (LNCS), Chris Hankin (Ed.), Vol. 1381. Springer, Lisbon, Portugal, 122–138.Google Scholar
Digital Library
- Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2008. Multiparty Asynchronous Session Types. In Proc. 35th ACM Symp. POPL, Phil Wadler (Ed.). ACM Press, San Francisco, CA, USA, 273–284.Google Scholar
Digital Library
- Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2016. Multiparty Asynchronous Session Types. J. ACM 63, 1 (2016), 9:1–9:67. Google Scholar
Digital Library
- Raymond Hu, Nobuko Yoshida, and Kohei Honda. 2008. Session-Based Distributed Programming in Java. In 22nd ECOOP (LNCS), Jan Vitek (Ed.), Vol. 5142. Springer, Paphos, Cyprus, 516–541.Google Scholar
- Atsushi Igarashi, Peter Thiemann, Vasco T. Vasconcelos, and Philip Wadler. 2017. Gradual Session Types. Proc. ACM Program. Lang. 1, ICFP, Article 38 (Sept. 2017), 28 pages. Google Scholar
Digital Library
- Naoki Kobayashi. 2002. Type Systems for Concurrent Programs. In 10th Anniversary Colloquium of UNU/IIST (Lecture Notes in Computer Science), Vol. 2757. Springer, 439–453.Google Scholar
- Naoki Kobayashi, Benjamin C. Pierce, and David N. Turner. 1996. Linearity and the pi-calculus. In Proc. 1996 ACM Symp. POPL. ACM Press, St. Petersburg Beach, FL, USA, 358–371.Google Scholar
- Neelakantan R. Krishnaswami, Pierre Pradic, and Nick Benton. 2015. Integrating Linear and Dependent Types. In POPL. ACM, 17–30.Google Scholar
- Sam Lindley and J. Garrett Morris. 2014. Sessions as Propositions. In Proceedings 7th Workshop on Programming Language Approaches to Concurrency and Communication-cEntric Software, PLACES 2014, Grenoble, France, 12 April 2014. (EPTCS), Alastair F. Donaldson and Vasco T. Vasconcelos (Eds.), Vol. 155. 9–16. Google Scholar
Cross Ref
- Sam Lindley and J. Garrett Morris. 2016. Talking Bananas: Structural Recursion for Session Types. In ICFP. ACM, 434–447.Google Scholar
- Karl Mazurak and Steve Zdancewic. 2010. Lolliproc: to concurrency from classical linear logic via curry-howard and control. In ICFP. ACM, 39–50.Google Scholar
- Conor McBride. 2016. I Got Plenty o’ Nuttin’. In A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday (LNCS), Sam Lindley, Conor McBride, Philip W. Trinder, and Donald Sannella (Eds.), Vol. 9600. Springer, 207–233. Google Scholar
Cross Ref
- J. Garrett Morris and James McKinna. 2019. Abstracting Extensible Data Types: or, Rows by Any Other Name. PACMPL 3, POPL (2019), 12:1–12:28. https://dl.acm.org/citation.cfm?id=3290325Google Scholar
- Susumu Nishimura. 1998. Static Typing for Dynamic Messages. In Proc. 25th ACM Symp. POPL, Luca Cardelli (Ed.). ACM Press, San Diego, CA, USA, 266–278. Google Scholar
Digital Library
- Luca Padovani. 2017a. Context-Free Session Type Inference. In ESOP (Lecture Notes in Computer Science), Vol. 10201. Springer, 804–830.Google Scholar
- Luca Padovani. 2017b. A Simple Library Implementation of Binary Sessions. J. Funct. Program. 27 (2017), e4. Google Scholar
Cross Ref
- Benjamin C. Pierce and David N. Turner. 2000. Local Type Inference. ACM TOPLAS 22, 1 (2000), 1–44. Google Scholar
Digital Library
- POPL 2010 2010. Proc. 37th ACM Symp. POPL. ACM Press, Madrid, Spain.Google Scholar
- Davide Sangiorgi. 1998. An Interpretation of Typed Objects into Typed pi-Calculus. Inf. Comput. 143, 1 (1998), 34–73.Google Scholar
Digital Library
- Alceste Scalas and Nobuko Yoshida. 2016. Lightweight Session Programming in Scala. In ECOOP (LIPIcs), Vol. 56. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 21:1–21:28.Google Scholar
- Rui Shi and Hongwei Xi. 2013. A Linear Type System for Multicore Programming in ATS. Science of Computer Programming 78, 8 (2013), 1176–1192. Google Scholar
Digital Library
- Vilhelm Sjöberg, Chris Casinghino, Ki Yung Ahn, Nathan Collins, Harley D. Eades III, Peng Fu, Garrin Kimmell, Tim Sheard, Aaron Stump, and Stephanie Weirich. 2012. Irrelevance, Heterogeneous Equality, and Call-by-value Dependent Type Systems. In Proceedings Fourth Workshop on Mathematically Structured Functional Programming, MSFP 2012, Tallinn, Estonia, 25 March 2012. (EPTCS), James Chapman and Paul Blain Levy (Eds.), Vol. 76. 112–162. Google Scholar
Cross Ref
- Nikhil Swamy, Juan Chen, Cédric Fournet, Pierre-Yves Strub, Karthikeyan Bhargavan, and Jean Yang. 2013. Secure Distributed Programming With Value-Dependent Types. J. Funct. Program. 23, 4 (2013), 402–451. Google Scholar
Cross Ref
- Kaku Takeuchi, Kohei Honda, and Makoto Kubo. 1994. An Interaction-Based Language and its Typing System. In 6th International PARLE Conference, C. Halatsis, D. Maritsas, G. Philokyprou, and S. Theodoridis (Eds.). LNCS, Vol. 817. Springer, Athens, Greece, 398–413.Google Scholar
Cross Ref
- Peter Thiemann and Vasco T. Vasconcelos. 2019. Label-Dependent Session Types. CoRR abs/1911.00705 (2019). http: //arxiv.org/abs/1911.00705 extended version.Google Scholar
- Bernardo Toninho, Luís Caires, and Frank Pfenning. 2011. Dependent Session Types via Intuitionistic Linear Type Theory. In PPDP, Peter Schneider-Kamp and Michael Hanus (Eds.). ACM, Odense, Denmark, 161–172.Google Scholar
- Bernardo Toninho and Nobuko Yoshida. 2018. Depending on Session-Typed Processes. In FoSSaCS (Lecture Notes in Computer Science), Vol. 10803. Springer, 128–145.Google Scholar
- Vasco T. Vasconcelos. 2012. Fundamentals of Session Types. Information and Control 217 (2012), 52–70.Google Scholar
Digital Library
- Vasco T. Vasconcelos, António Ravara, and Simon J. Gay. 2006. Type Checking a Multithreaded Functional Language with Session Types. Theoretical Computer Science 368, 1-2 (2006), 64–87.Google Scholar
Digital Library
- Vasco Thudichum Vasconcelos and Mario Tokoro. 1993. A Typing System for a Calculus of Objects. In ISOTAS (Lecture Notes in Computer Science), Vol. 742. Springer, 460–474.Google Scholar
- Philip Wadler. 2012. Propositions as Sessions. In ICFP’12, Robby Bruce Findler (Ed.). ACM, Copenhagen, Denmark, 273–286.Google Scholar
- David Walker. 2005. Substructural Type Systems. In Advanced Topics in Types and Programming Languages, Benjamin C. Pierce (Ed.). MIT Press, Chapter 1.Google Scholar
- Hanwen Wu and Hongwei Xi. 2017. Dependent Session Types. http://arxiv.org/abs/1704.07004. (2017). arXiv CoRR.Google Scholar
Index Terms
Label-dependent session types
Recommendations
Session types revisited
Session types are a formalism used to model structured communication-based programming. A binary session type describes communication by specifying the type and direction of data exchanged between two parties. When session types and session processes ...
Session types revisited
PPDP '12: Proceedings of the 14th symposium on Principles and practice of declarative programmingSession types are a formalism to model structured communication-based programming. A session type describes communication by specifying the type and direction of data exchanged between two parties. When session types and session primitives are added to ...
Intrinsically-Typed Mechanized Semantics for Session Types
PPDP '19: Proceedings of the 21st International Symposium on Principles and Practice of Declarative ProgrammingSession types have emerged as a powerful paradigm for structuring communication-based programs. They guarantee type soundness and session fidelity for concurrent programs with sophisticated communication protocols. As type soundness proofs for languages ...






Comments