Modular session types for distributed object-oriented programming

Session types allow communication protocols to be specified type-theoretically so that protocol implementations can be verified by static type-checking. We extend previous work on session types for distributed object-oriented languages in three ways. (1) We attach a session type to a class definition, to specify the possible sequences of method calls. (2) We allow a session type (protocol) implementation to be modularized , i.e. partitioned into separately-callable methods. (3) We treat session-typed communication channels as objects, integrating their session types with the session types of classes. The result is an elegant unification of communication channels and their session types, distributed object-oriented programming, and a form of typestates supporting non-uniform objects, i.e. objects that dynamically change the set of available methods. We define syntax, operational semantics, a sound type system, and a correct and complete type checking algorithm for a small distributed class-based object-oriented language. Static typing guarantees that both sequences of messages on channels, and sequences of method calls on objects, conform to type-theoretic specifications, thus ensuring type-safety. The language includes expected features of session types, such as delegation, and expected features of object-oriented programming, such as encapsulation of local state. We also describe a prototype implementation as an extension of Java.

[1]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[2]  James R. Larus,et al.  Language support for fast and reliable message-based communication in singularity OS , 2006, EuroSys.

[3]  Dave Clarke,et al.  Ownership, Uniqueness, and Immutability , 2008, TOOLS.

[4]  Luís Caires,et al.  Spatial-behavioral types for concurrency and resource control in distributed systems , 2008, Theor. Comput. Sci..

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

[6]  Filipe David Oliveira Militão Design and implementation of a behaviorally typed programming system for web services , 2008 .

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

[8]  Nobuko Yoshida,et al.  Structured Communication-Centred Programming for Web Services , 2007, ESOP.

[9]  Sophia Drossopoulou,et al.  A type safe state abstraction for coordination in Java-like languages , 2008, Acta Informatica.

[10]  Oscar Nierstrasz,et al.  Regular types for active objects , 1993, OOPSLA '93.

[11]  Marco Carbone,et al.  Structured Global Programming for Communication Behaviour , 2006 .

[12]  Sophia Drossopoulou,et al.  Amalgamating sessions and methods in object-oriented languages with generics , 2009, Theor. Comput. Sci..

[13]  Henry G. Baker,et al.  “Use-once” variables and linear objects: storage management, reflection and multi-threading , 1995, SIGP.

[14]  Andrei Paun,et al.  ReMembrane Systems with Coupled Transport: Universality and Normal Forms , 2002, Fundam. Informaticae.

[15]  Antonio Vallecillo,et al.  Typing the Behavior of Software Components using Session Types , 2006, Fundam. Informaticae.

[16]  Eduardo Bonelli,et al.  Multipoint Session Types for a Distributed Calculus , 2007, TGC.

[17]  Sophia Drossopoulou,et al.  Bounded Session Types for Object Oriented Languages , 2006, FMCO.

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

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

[20]  Sophia Drossopoulou,et al.  A Distributed Object-Oriented Language with Session Types , 2005, TGC.

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

[22]  Naoki Kobayashi Type-based information flow analysis for the π-calculus , 2005, Acta Informatica.

[23]  Franz Puntigam State inference for dynamically changing interfaces , 2001, Comput. Lang..

[24]  John Hogg,et al.  Islands: aliasing protection in object-oriented languages , 1991, OOPSLA '91.

[25]  Naoki Kobayashi,et al.  Resource Usage Analysis for the p-Calculus , 2006, Log. Methods Comput. Sci..

[26]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[27]  James Noble,et al.  Ownership types for flexible alias protection , 1998, OOPSLA '98.

[28]  Michael R. Clarkson,et al.  Polyglot: An Extensible Compiler Framework for Java , 2003, CC.

[29]  Robert DeLine,et al.  The fugue protocol checker: is your software baroque? technical report msr-tr-2004-07 , 2004 .

[30]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[31]  Robert E. Strom,et al.  Typestate: A programming language concept for enhancing software reliability , 1986, IEEE Transactions on Software Engineering.

[32]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[33]  António Ravara,et al.  Dynamic Interfaces , 2007 .

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

[35]  Paulo Sérgio Almeida Balloon Types: Controlling Sharing of State in Data Types , 1997, ECOOP.

[36]  Jonathan Aldrich,et al.  Practical API Protocol Checking with Access Permissions , 2009, ECOOP.

[37]  Alexander Aiken,et al.  Flow-sensitive type qualifiers , 2002, PLDI '02.

[38]  Jonathan Aldrich,et al.  PLURAL: checking protocol compliance under aliasing , 2008, ICSE Companion '08.

[39]  Atsushi Igarashi,et al.  Resource usage analysis , 2002, POPL '02.

[40]  Sophia Drossopoulou,et al.  Session Types for Object-Oriented Languages , 2006, ECOOP.

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

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

[43]  James Cheney,et al.  Region-based memory management in cyclone , 2002, PLDI '02.

[44]  Dimitris Mostrous A Session Object Calculus for Structured Communication-Based Programming , 2008 .

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

[46]  Jonathan Aldrich,et al.  Verifying correct usage of atomic blocks and typestate , 2008, OOPSLA.

[47]  Jonathan Aldrich,et al.  Modular typestate checking of aliased objects , 2007, OOPSLA.

[48]  António Ravara,et al.  Session Types for Inter-Process Communication , 2003 .

[49]  Jonathan Aldrich,et al.  Lightweight object specification with typestates , 2005, ESEC/FSE-13.

[50]  Sagar Chaki,et al.  Types as models: model checking message-passing programs , 2002, POPL '02.

[51]  Atsushi Igarashi,et al.  A generic type system for the Pi-calculus , 2004, Theor. Comput. Sci..

[52]  Robert DeLine,et al.  Typestates for Objects , 2004, ECOOP.

[53]  Franz Puntigam,et al.  Types for Active Objects with Static Deadlock Prevention , 2001, Fundam. Informaticae.

[54]  António Ravara,et al.  Typing Non-uniform Concurrent Objects , 2000, CONCUR.