Talking bananas: structural recursion for session types

Session types provide static guarantees that concurrent programs respect communication protocols. We give a novel account of recursive session types in the context of GV, a small concurrent extension of the linear λ-calculus. We extend GV with recursive types and catamorphisms, following the initial algebra semantics of recursion, and show that doing so naturally gives rise to recursive session types. We show that this principled approach to recursion resolves long-standing problems in the treatment of duality for recursive session types. We characterize the expressiveness of GV concurrency by giving a CPS translation to (non-concurrent) λ-calculus and proving that reduction in GV is simulated by full reduction in λ-calculus. This shows that GV remains terminating in the presence of positive recursive types, and that such arguments extend to other extensions of GV, such as polymorphism or non-linear types, by appeal to normalization results for sequential λ-calculi. We also show that GV remains deadlock free and deterministic in the presence of recursive types. Finally, we extend CP, a session-typed process calculus based on linear logic, with recursive types, and show that doing so preserves the connection between reduction in GV and cut elimination in CP.

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

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

[3]  Andrzej Filinski Linear continuations , 1992, POPL '92.

[4]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[5]  Michele Boreale On the Expressiveness of Internal Mobility in Name-Passing Calculi , 1998, Theor. Comput. Sci..

[6]  David Baelde,et al.  Least and Greatest Fixed Points in Linear Logic , 2007, TOCL.

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

[8]  Michele Boreale,et al.  On the Expressiveness of Internal Mobility in Name-Passing Calculi , 1996, Theor. Comput. Sci..

[9]  Robert Atkey,et al.  Conflation Confers Concurrency , 2016, A List of Successes That Can Change the World.

[10]  Sam Lindley,et al.  A Semantics for Propositions as Sessions , 2015, ESOP.

[11]  Ornela Dardha,et al.  Recursive Session Types Revisited , 2014, BEAT.

[12]  Bernardo Toninho,et al.  Corecursion and Non-divergence in Session-Typed Processes , 2014, TGC.

[13]  Olivier Danvy,et al.  A first-order one-pass CPS transformation , 2001, Theor. Comput. Sci..

[14]  Dimitrios Kouzapas,et al.  On Duality Relations for Session Types , 2014, TGC.

[15]  Philip Wadler,et al.  Coherence Generalises Duality: A Logical Explanation of Multiparty Session Types , 2016, CONCUR.

[16]  Gianluigi Bellin,et al.  On the pi-Calculus and Linear Logic , 1992, Theor. Comput. Sci..

[17]  Luca Padovani,et al.  Polymorphic Types for Leak Detection in a Session-Oriented Functional Language , 2013, FMOODS/FORTE.

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

[19]  Liuba Shrira,et al.  Promises: linguistic support for efficient asynchronous procedure calls in distributed systems , 1988, PLDI '88.

[20]  Luca Padovani,et al.  Typing Copyless Message Passing , 2012, Log. Methods Comput. Sci..

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

[22]  Kohei Honda,et al.  Types for Dynamic Interaction , 1993 .

[23]  Samson Abramsky,et al.  Proofs as Processes , 1992, Theor. Comput. Sci..

[24]  Erik Poll,et al.  Algebra of Programming by Richard Bird and Oege de Moor, Prentice Hall, 1996 (dated 1997). , 1999 .

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

[26]  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.

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

[28]  P. Freyd Algebraically complete categories , 1991 .

[29]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.

[30]  Matthew Hennessy,et al.  Using higher-order contracts to model session types , 2016, Log. Methods Comput. Sci..

[31]  Jean-Jacques Lévy,et al.  Explicit Substitutions and Programming Languages , 1999, FSTTCS.

[32]  Sam Lindley,et al.  Lightweight functional session types , 2017 .

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

[34]  Maarten M. Fokkinga,et al.  Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire , 1991, FPCA.

[35]  Claire Pagès Corps et travail dans la pensée freudienne de la cure , 2014 .

[36]  Matthew Hennessy,et al.  Using Higher-Order Contracts to Model Session Types (Extended Abstract) , 2013, CONCUR.