Label-dependent session types

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.

[1]  Nobuko Yoshida,et al.  Session-Based Distributed Programming in Java , 2008, ECOOP.

[2]  Philip Wadler Propositions as sessions , 2014, J. Funct. Program..

[3]  Benjamin C. Pierce,et al.  Local type inference , 1998, POPL '98.

[4]  Luca Padovani,et al.  A simple library implementation of binary sessions* , 2016, Journal of Functional Programming.

[5]  Edwin Brady Type-driven Development of Concurrent Communicating Systems , 2017, Comput. Sci..

[6]  Kohei Honda,et al.  Types for Dyadic Interaction , 1993, CONCUR.

[7]  Conor McBride,et al.  I Got Plenty o' Nuttin' , 2016, A List of Successes That Can Change the World.

[8]  Frank Pfenning,et al.  Session Types as Intuitionistic Linear Propositions , 2010, CONCUR.

[9]  Bernardo Toninho,et al.  Dependent session types via intuitionistic linear type theory , 2011, PPDP.

[10]  Simon J. Gay,et al.  Subtyping for session types in the pi calculus , 2005, Acta Informatica.

[11]  Luca Padovani Context-Free Session Type Inference , 2017, ESOP.

[12]  Neelakantan R. Krishnaswami,et al.  Complete and easy bidirectional typechecking for higher-rank polymorphism , 2013, ICFP.

[13]  Bernardo Toninho,et al.  Linear logic propositions as session types , 2016, Math. Struct. Comput. Sci..

[14]  ThiemannPeter,et al.  Label-dependent session types , 2019 .

[15]  António Ravara,et al.  Modular session types for distributed object-oriented programming , 2010, POPL '10.

[16]  Nobuko Yoshida,et al.  Multiparty asynchronous session types , 2008, POPL '08.

[17]  Ugo Dal Lago,et al.  Linear dependent types in a call-by-value scenario , 2012, Sci. Comput. Program..

[18]  Frank Pfenning,et al.  A linear logical framework , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[19]  António Ravara,et al.  Type checking a multithreaded functional language with session types , 2006, Theor. Comput. Sci..

[20]  Hongwei Xi,et al.  Dependent Session Types , 2017, ArXiv.

[21]  Gary Brown,et al.  Scribbling Interactions with a Formal Foundation , 2011, ICDCIT.

[22]  Stephanie Weirich,et al.  Irrelevance, Heterogeneous Equality, and Call-by-value Dependent Type Systems , 2012, MSFP.

[23]  David Aspinall,et al.  Subtyping dependent types , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[24]  Kohei Honda,et al.  An Interaction-based Language and its Typing System , 1994, PARLE.

[25]  Brigitte Pientka,et al.  Bidirectional Elaboration of Dependently Typed Programs , 2014, PPDP '14.

[26]  Mario Tokoro,et al.  A Typing System for a Calculus of Objects , 1993, ISOTAS.

[27]  Bernardo Toninho,et al.  Depending on Session-Typed Processes , 2018, FoSSaCS.

[28]  Susumu Nishimura,et al.  Static typing for dynamic messages , 1998, POPL '98.

[29]  Sam Lindley,et al.  Talking bananas: structural recursion for session types , 2016, ICFP.

[30]  Stephanie Weirich,et al.  Combining proofs and programs in a dependently typed language , 2014, POPL.

[31]  Sophia Drossopoulou,et al.  Objects and session types , 2009, Inf. Comput..

[32]  J. Garrett Morris,et al.  Abstracting extensible data types: or, rows by any other name , 2019, Proc. ACM Program. Lang..

[33]  Vasco Thudichum Vasconcelos,et al.  Language Primitives and Type Discipline for Structured Communication-Based Programming Revisited: Two Systems for Higher-Order Session Communication , 1998, SecReT@ICALP.

[34]  K. Maillard,et al.  Recalling a Witness , 2017 .

[35]  Jacques Garrigue,et al.  Programming with Polymorphic Variants , 2010 .

[36]  Benjamin C. Pierce,et al.  Linearity and the pi-calculus , 1999, TOPL.

[37]  Eduardo Bonelli,et al.  Correspondence assertions for process synchronization in concurrent communications , 2004, J. Funct. Program..

[38]  Nobuko Yoshida,et al.  Lightweight Session Programming in Scala , 2016, ECOOP.

[39]  Peter Thiemann,et al.  Gradual session types , 2017, Journal of Functional Programming.

[40]  Mariangiola Dezani-Ciancaglini,et al.  On the Preciseness of Subtyping in Session Types , 2014, PPDP '14.

[41]  Vasco Thudichum Vasconcelos,et al.  Linearly Refined Session Types , 2012, LINEARITY.

[42]  Edwin Brady,et al.  Idris, a general-purpose dependently typed programming language: Design and implementation , 2013, Journal of Functional Programming.

[43]  Simon L. Peyton Jones,et al.  Linear Haskell: practical linearity in a higher-order polymorphic language , 2017, Proc. ACM Program. Lang..

[44]  Juan Chen,et al.  Secure distributed programming with value-dependent types , 2011, Journal of Functional Programming.

[45]  Vasco Thudichum Vasconcelos,et al.  Linear type theory for asynchronous session types , 2009, Journal of Functional Programming.

[46]  Davide Sangiorgi,et al.  Session types revisited , 2012, PPDP.

[47]  Nick Benton,et al.  Integrating Linear and Dependent Types , 2015, POPL.

[48]  Rui Shi,et al.  A linear type system for multicore programming in ATS , 2013, Sci. Comput. Program..

[49]  Steve Zdancewic,et al.  Lolliproc: to concurrency from classical linear logic via curry-howard and control , 2010, ICFP '10.

[50]  Vasco Thudichum Vasconcelos,et al.  Fundamentals of session types , 2009, Inf. Comput..

[51]  Naoki Kobayashi,et al.  Type Systems for Concurrent Programs , 2002, 10th Anniversary Colloquium of UNU/IIST.

[52]  Sam Lindley,et al.  Sessions as Propositions , 2014, PLACES.

[53]  Ugo Dal Lago,et al.  Linear Dependent Types and Relative Completeness , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[54]  Frank Pfenning,et al.  A Linear Logical Framework , 2002, Inf. Comput..

[55]  Luca Padovani,et al.  Foundations of session types , 2009, PPDP '09.

[56]  Radha Jagadeesan,et al.  An extensible approach to session polymorphism † , 2015, Mathematical Structures in Computer Science.

[57]  Davide Sangiorgi An Interpretation of Typed Objects into Typed pi-Calculus , 1998, Inf. Comput..

[58]  Robert Atkey,et al.  Syntax and Semantics of Quantitative Type Theory , 2018, LICS.

[59]  Robert Harper,et al.  Practical Foundations for Programming Languages , 2012 .

[60]  Nikhil Swamy,et al.  Recalling a witness: foundations and applications of monotonic state , 2017, Proc. ACM Program. Lang..

[61]  Giuseppe Castagna,et al.  Set-theoretic types for polymorphic variants , 2016, ICFP.