Session Types in a Linearly Typed Multi-Threaded Lambda-Calculus

We present a formalization of session types in a multi-threaded lambda-calculus (MTLC) equipped with a linear type system, establishing for the MTLC both type preservation and global progress. The latter (global progress) implies that the evaluation of a well-typed program in the MTLC can never reach a deadlock. As this formulated MTLC can be readily embedded into ATS, a full-fledged language with a functional programming core that supports both dependent types (of DML-style) and linear types, we obtain a direct implementation of session types in ATS. In addition, we gain immediate support for a form of dependent session types based on this embedding into ATS. Compared to various existing formalizations of session types, we see the one given in this paper is unique in its closeness to concrete implementation. In particular, we report such an implementation ready for practical use that generates Erlang code from well-typed ATS source (making use of session types), thus taking great advantage of the infrastructural support for distributed computing in Erlang.

[1]  António Ravara,et al.  Session Types for Functional Multithreading , 2004, CONCUR.

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

[3]  Vasco Thudichum Vasconcelos,et al.  A Concurrent Programming Language with Refined Session Types , 2013, SEFM Workshops.

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

[5]  Hongwei Xi,et al.  A Linear Type System for Multicore Programming ∗ , 2009 .

[6]  Søren Debois,et al.  A Graphical Approach to Progress for Structured Communication in Web Services , 2010, ICE.

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

[8]  Bernardo Toninho,et al.  Functions as Session-Typed Processes , 2012, FoSSaCS.

[9]  Riccardo Pucella,et al.  Haskell session types with (almost) no class , 2008, Haskell '08.

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

[11]  Peter Thiemann,et al.  An Implementation of Session Types , 2004, PADL.

[12]  Jean-Yves Girard,et al.  Linear Logic , 1987, Theor. Comput. Sci..

[13]  Lars Birkedal Foundations of Software Science and Computational Structures , 2012, Lecture Notes in Computer Science.

[14]  Bernardo Toninho,et al.  Higher-Order Processes, Functions, and Sessions: A Monadic Integration , 2013, ESOP.

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

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

[17]  Graham Hutton,et al.  Higher-order functions for parsing , 1992, Journal of Functional Programming.

[18]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

[19]  Hongwei Xi,et al.  Dependent ML An approach to practical programming with dependent types , 2007, Journal of Functional Programming.

[20]  Naoki Kobayashi,et al.  A Generalized Deadlock-Free Process Calculus , 1998, Electron. Notes Theor. Comput. Sci..

[21]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

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

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

[24]  Chiyan Chen,et al.  Combining programming with theorem proving , 2005, ICFP '05.

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

[26]  Hongwei Xi,et al.  Applied Type System: Extended Abstract , 2003, TYPES.

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

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