Abstract
Extending the pi calculus with the session types proposed by Honda et al. allows high-level specifications of structured patterns of communication, such as client-server protocols, to be expressed as types and verified by static typechecking. We define a notion of subtyping for session types, which allows protocol specifications to be extended in order to describe richer behaviour; for example, an implemented server can be refined without invalidating type-correctness of an overall system. We formalize the syntax, operational semantics and typing rules of an extended pi calculus, prove that typability guarantees absence of run-time communication errors, and show that the typing rules can be transformed into a practical typechecking algorithm.
Similar content being viewed by others
References
Bonelli, E., Compagnoni, A., Gunter, E.: Correspondence assertions for process synchronization in concurrent communication. Journal of Functional Programming 15(2), 219–247 (2005)
Bonelli, E., Compagnoni, A., Gunter, E.: Typechecking safe process synchronization. In Proceedings of the Third EATCS Workshop on the Foundations of Global Ubiquitous Computing, Electronic Notes on Theoretical Computer Science. Elsevier, 2005. To appear. (2005)
Chaki, S., Rajamani, S.K., Rehof, J.: Types as models: model checking message-passing programs. In Proceedings, 29th ACM Symposium on Principles of Programming Languages, pages 45–57. ACM Press (2002)
DeLine, R., Fähndrich, M.: Enforcing high-level protocols in low-level software. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (SIGPLAN Notices 36(5)), pages 59–69. ACM Press (2001)
Dezani-Ciancaglini, M., Yoshida, N., Ahern, A., Drossopolou, S.: A distributed object-oriented language with session types. In Proceedings of the Symposium on Trustworthy Global Computing. Springer, To appear. (2005)
Gay, S.J.: A sort inference algorithm for the polyadic π-calculus. In Proceedings, 20th ACM Symposium on Principles of Programming Languages. ACM Press, (1993)
Gay, S.J., Hole, M.J.: Types and subtypes for client-server interactions. In ESOP'99: Proceedings of the European Symposium on Programming Languages and Systems, volume 1576 of Lecture Notes in Computer Science, pp. 74–90. (1999) Springer
Gay, S.J., Hole, M.J.: Types and subtypes for correct communication in client-server systems. Technical Report TR-2003-131, Department of Computing Science, University of Glasgow (February 2003)
Girard, J.-Y.: Linear Logic. Theoretical Computer Science 50(1), 1–102 (1987)
Gordon, A.D., Jeffrey, A.: Typing correspondence assertions for communication protocols. Theoretical Computer Science 300(1–3), 379–409 (2003)
Grossman, D.: Type-safe multithreading in cyclone. In Proceedings of the ACM Workshop on Types in Language Design and Implementation (SIGPLAN Notices 38(3)), pp. 13–25. ACM Press (2003)
Grossman, D., Morrisett, G., Jim, T., Hicks, M., Wang, Y., Cheney, J.: Region-based memory management in cyclone. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (SIGPLAN Notices 37(5)), pp. 282–293. ACM Press (2002)
Hole, M.J., Gay, S.J.: Bounded polymorphism in session types. Technical Report TR-2003-132, Department of Computing Science, University of Glasgow (March 2003)
Honda, K.: Types for dyadic interaction. In CONCUR'93: Proceedings of the International Conference on Concurrency Theory, volume 715 of Lecture Notes in Computer Science, pp. 509–523 (Springer, 1993)
Honda, K., Vasconcelos, V., Kubo, M.: Language primitives and type discipline for structured communication-based programming. In ESOP'98: Proceedings of the European Symposium on Programming, volume 1381 of Lecture Notes in Computer Science, pp. 122–138. Springer-Verlag (1998)
Igarashi, A., Kobayashi, N.: A generic type system for the pi-calculus. Theoretical Computer Science, 311(1–3), 121–163 (2004)
Kobayashi, N.: A partially deadlock-free typed process calculus. ACM Transactions on Programming Languages and Systems 20, 436–482 (1998)
Kobayashi, N., Pierce, B.C., Turner, D.N.: Linearity and the Pi-Calculus. ACM Transactions on Programming Languages and Systems 21(5), 914–947 (September 1999)
Mackie, I.: Lilac : A functional programming language based on linear logic. Journal of Functional Programming 4(4), 1–39 (October 1994)
Milner, R.: The polyadic π-calculus: A tutorial. Technical Report 91-180, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh (1991)
Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes, I and II. Information and Computation 100(1), 1–77 (September 1992)
Myers, J., Rose, M.: Post office protocol version 3. Internet Standards RFC1939. (May 1996)
Neubauer, M., Thiemann, P.: An implementation of session types. In Practical Aspects of Declarative Languages (PADL'04), volume 3057 of Lecture Notes in Computer Science, pp. 56–70 (Springer, 2004)
Neubauer, M., Thiemann, P.: Protocol specialization. In Proceedings of the Second Asian Symposium on Programming Languages and Systems (APLAS 2004), volume 3302 of Lecture Notes in Computer Science, pp. 246–261 (Springer, 2004)
Pierce, B.C.: Types and programming languages. MIT Press (2002)
Pierce, B.C., Sangiorgi, D.: Typing and subtyping for mobile processes. Mathematical Structures in Computer Science, 6(5) (1996)
Pierce, B.C., Sangiorgi, D.: Behavioral equivalence in the polymorphic pi-calculus. Journal of the ACM 47(3), (2000)
Pierce, B.C., Turner, D.N.: Pict: A programming language based on the pi-calculus. In G. Plotkin, C. Stirling, and M. Tofte, editors, Proof, Language and Interaction: Essays in Honour of Robin Milner. MIT Press (2000)
Rajamani, S.K., Rehof, J.: A behavioral module system for the pi-calculus. In Static Analysis: 8th International Symposium, SAS 2001, volume 2126 of Lecture Notes in Computer Science, pp. 375–394. Springer (2001)
Sangiorgi, D., Walker, D.: The π-calculus: a Theory of Mobile Processes. Cambridge University Press (2001)
Takeuchi, K., Honda, K., Kubo, M.: An interaction-based language and its typing system. In PARLE '94: Parallel Architectures and Languages Europe, volume 817 of Lecture Notes in Computer Science, Springer (1994)
Turner, D.N.: The Polymorphic Pi-Calculus: theory and implementation. PhD thesis, University of Edinburgh (1996)
Vallecillo, A., Vasconcelos, V.T., Ravara, A.: Typing the behavior of objects and components using session types. In International Workshop on Foundations of Coordination Languages and Software Architectures, volume 68(3) of Electronic Notes in Theoretical Computer Science. Elsevier (2003)
Vasconcelos, V.T., Honda, K.: Principal typing schemes in a polyadic π-calculus. In CONCUR'93: Proceedings of the International Conference on Concurrency Theory, volume 715 of Lecture Notes in Computer Science. Springer, (1993)
Vasconcelos, V.T., Ravara, A., Gay, S.J.: Session types for functional multithreading. In CONCUR'04: Proceedings of the International Conference on Concurrency Theory, volume 3170 of Lecture Notes in Computer Science, pages 497–511. Springer. Full version to appear in Theoretical Computer Science. (2004)
Author information
Authors and Affiliations
Corresponding author
Additional information
Malcolm Hole died on 28th February 2004, a few weeks after the original submission of this paper.
Rights and permissions
About this article
Cite this article
Gay, S., Hole, M. Subtyping for session types in the pi calculus. Acta Informatica 42, 191–225 (2005). https://doi.org/10.1007/s00236-005-0177-z
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00236-005-0177-z