Bounded polymorphism in session types

SIMON J. GAY
2008 Mathematical Structures in Computer Science  
We review work on session types and the π-calculus, and give an example identifying a use for bounded polymorphic types in this setting. We then define a variant of the π-calculus with the appropriate syntax, and propose a static bounded polymorphic type system, for which we prove type soundness. We use our rules to give a typing derivation and show the sequence of reductions in our example. Finally, we discuss related work and possible future work in this area. This research was funded by the
more » ... PSRC project "Novel Type Systems for Concurrent Programming Languages" (GR/L75177,GR/N39494). Distributed client-server systems are structured around protocols which specify the form and sequence of communications between agents. Such protocols are often complex, involving substantial numbers of states and a variety of state transitions caused by different types of message. When implementing a client or server which is meant to follow a particular protocol, it is clearly desirable to be able to verify (preferably automatically) that the sequence and structure of messages sent and received is correct according to the protocol. However, standard programming languages do not provide good support for this kind of verification. The theory of session types addresses this problem by defining a notion of type which can capture the specification of a client-server protocol. Session types can be associated with communication channels, and the actual use of a channel by a program can be statically checked against its type. Session types were proposed (in the context of a language based on the π-calculus [13, 20] ) by Takeuchi, Honda and Kubo [21] and have been studied further by Honda, Vasconcelos and Kubo [8] and the present authors [3, 4]. More recently Vallecillo, Vasconcelos and Ravara [23] have applied session types to the specification of component object systems, and Gay, Ravara and Vasconcelos [6] have begun to transfer session types from the π-calculus to a more conventional programming language. In previous papers [3, 5] we increased the expressive power of session types in the πcalculus by defining a notion of subtyping, based on Pierce and Sangiorgi's [14, 15] system of subtyping in the π-calculus but extended to the additional type constructors involved in session types. The main application of subtyping is to allow certain kinds of server upgrades, which alter the protocol and hence its session type, to be made without removing the type-correctness of older clients which are unaware of the upgrade. However, the range of permissible upgrades is not as large as we would like, and the goal of the present paper is to extend it. We are still working within a language based on the π-calculus. Our solution is to introduce a notion of bounded polymorphism, similar in general terms to kernel F <: [1, 16] but adapted to the π-calculus. As far as we know this is the first study of bounded polymorphism in the π-calculus, and the first study of any form of polymorphism in relation to session types. We discuss some previous work on polymorphism in the π-calculus in Section 7. The rest of the paper is structured as follows. In Section 2 we review session types, illustrate their application to the specification of client-server protocols, describe the additional expressive power provided by subtyping, and explain how we can use bounded polymorphism to increase the expressive power still further. In Sections 3, 4 and 5 we formalise the syntax, type system and operational semantics of our version of the π-calculus, and outline the proof of soundness of the type system. In Section 6 we present example derivations, and in Section 7 we conclude, discuss related work, and indicate directions for further work. Session Types in the Pi Calculus Session types in the π-calculus provide the facility for a greater degree of structure in the interaction between a client and a server. Both parties participating in a sequence of communications are statically type checked, not only to ensure that the types of messages sent are those expected, but also that the ordering of messages is correct. Furthermore, choices can be offered and selections made by both client and server, the whole dialogue taking place
doi:10.1017/s0960129508006944 fatcat:5owtkrmv35dtbdt4iz6pmeidce