Hostname: page-component-7479d7b7d-fwgfc Total loading time: 0 Render date: 2024-07-11T18:14:06.588Z Has data issue: false hasContentIssue false

Bounded polymorphism in session types

Published online by Cambridge University Press:  01 October 2008

SIMON J. GAY*
Affiliation:
Department of Computing Science, University of Glasgow, United Kingdom Email: simon@dcs.gla.ac.uk

Abstract

Session types allow high-level specifications of structured patterns of communication, such as client-server protocols, to be expressed as types and verified by static typechecking. In collaboration with Malcolm Hole, we previously introduced a notion of subtyping for session types, which was formulated for an extended pi calculus. Subtyping allows one part of a system, for example, a server, to be refined without invalidating type-correctness of other parts, for example, clients. In this paper we introduce bounded polymorphism, which is based on the same notion of subtyping, in order to support more precise and flexible specifications of protocols; in particular, a choice of type in one message may affect the types of future messages. We formalise the syntax, operational semantics and typing rules of an extended pi calculus, and prove that typechecking guarantees the absence of run-time communication errors. We study algorithms for checking instances of the subtype relation in two versions of our system, which we call Kernel S and Full S, and establish that subtyping in Kernel S is decidable, and that subtyping in Full S is undecidable.

Type
Paper
Copyright
Copyright © Cambridge University Press 2008

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Bonelli, E., Compagnoni, A. and Gunter, E. (2005) Correspondence assertions for process synchronization in concurrent communication. Journal of Functional Programming 15 (2)219247.CrossRefGoogle Scholar
Carbone, M., Honda, K., Yoshida, N., Milner, R., Brown, G. and Ross-Talbot, S. (2006) A theoretical basis of communication-centred concurrent programming. W3C Web Services Choreography Working Group Report. www.w3.org/2002/ws/chor/edcopies/theory/note.pdf.Google Scholar
Cardelli, L. and Wegner, P. (1985) On understanding types, data abstraction, and polymorphism. Computing Surveys 17 (4)471522.CrossRefGoogle Scholar
Dezani-Ciancaglini, M., Mostrous, D., Yoshida, N. and Drossopolou, S. (2006) Session types for object-oriented languages. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). Springer-Verlag Lecture Notes in Computer Science 4067 328352.CrossRefGoogle Scholar
Dezani-Ciancaglini, M., Yoshida, N., Ahern, A. and Drossopolou, S. (2005) A distributed object-oriented language with session types. In: Proceedings of the Symposium on Trustworthy Global Computing. Springer-Verlag Lecture Notes in Computer Science 3705 299318.CrossRefGoogle Scholar
Fähndrich, M., Aiken, M., Hawblitzel, C., Hodson, O., Hunt, G., Larus, J. R. and Levi, S. (2006) Language support for fast and reliable message-based communication in Singularity OS. In: EuroSys 2006, ACM Press.Google Scholar
Garralda, P., Compagnoni, A. and Dezani-Ciancaglini, M. (2006) BASS: Boxed Ambients with Safe Sessions. In: Proceedings of the ACM Symposium on Principles and Practice of Declarative Programming, ACM Press 6172.Google Scholar
Gay, S. J. (1993) A sort inference algorithm for the polyadic π-calculus. In: Proceedings of the 20th ACM Symposium on Principles of Programming Languages, ACM Press.Google Scholar
Gay, S. J. and Hole, M. J. (1999) Types and subtypes for client-server interactions. In: ESOP'99: Proceedings of the European Symposium on Programming Languages and Systems. Springer-Verlag Lecture Notes in Computer Science 1576 7490.CrossRefGoogle Scholar
Gay, S. J. and Hole, M. J. (2005) Subtyping for session types in the pi calculus. Acta Informatica 42 (2/3)191225.CrossRefGoogle Scholar
Girard, J.-Y. (1972) Interprétation fonctionelle et élimination des coupures dans l'arithmétique d'ordre supérieur, Ph.D. thesis, University of Paris VII.Google Scholar
Girard, J.-Y. (1987) Linear Logic. Theoretical Computer Science 50 (1)1102.CrossRefGoogle Scholar
Honda, K. (1993) Types for dyadic interaction. In: CONCUR'93: Proceedings of the International Conference on Concurrency Theory. Springer-Verlag Lecture Notes in Computer Science 715 509523.CrossRefGoogle Scholar
Honda, K., Vasconcelos, V. and Kubo, M. (1998) Language primitives and type discipline for structured communication-based programming. In: ESOP'98: Proceedings of the European Symposium on Programming. Springer-Verlag Lecture Notes in Computer Science 1381 122138.CrossRefGoogle Scholar
Katiyar, D. and Sankar, S. (1992) Completely bounded quantification is decidable. In: Proceedings of the ACM SIGPLAN Workshop on ML and its Applications.Google Scholar
Kobayashi, N., Pierce, B. C. and Turner, D. N. (1999) Linearity and the Pi-Calculus. ACM Transactions on Programming Languages and Systems 21 (5)914947.CrossRefGoogle Scholar
Liu, X. and Walker, D. (1995) A polymorphic type system for the polyadic π-calculus. In: CONCUR'95: Proceedings of the International Conference on Concurrency Theory. Springer-Verlag Lecture Notes in Computer Science 962.CrossRefGoogle Scholar
Milner, R. (1991) The polyadic π-calculus: a tutorial. Technical Report 91-180, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh.Google Scholar
Milner, R., Parrow, J. and Walker, D. (1992) A calculus of mobile processes, I and II. Information and Computation 100 (1)177.CrossRefGoogle Scholar
Neubauer, M. and Thiemann, P. (2004a) An implementation of session types. In: Practical Aspects of Declarative Languages (PADL'04). Springer-Verlag Lecture Notes in Computer Science 3057 5670.CrossRefGoogle Scholar
Neubauer, M. and Thiemann, P. (2004b) Session types for asynchronous communication (manuscript).Google Scholar
Pierce, B. C. (2002) Types and Programming Languages, MIT Press.Google Scholar
Pierce, B. C. and Sangiorgi, D. (1993) Types and subtypes for mobile processes. In: Proceedings, Eighth Annual IEEE Symposium on Logic in Computer Science, IEEE Computer Society Press.Google Scholar
Pierce, B. C. and Sangiorgi, D. (1996) Typing and subtyping for mobile processes. Mathematical Structures in Computer Science 6 (5)409454.CrossRefGoogle Scholar
Pierce, B. C. and Sangiorgi, D. (2000) Behavioral equivalence in the polymorphic pi-calculus. Journal of the ACM 47 (3).CrossRefGoogle Scholar
Pierce, B. C. and Turner, D. N. (2000) Pict: A programming language based on the pi-calculus. In: Plotkin, G., Stirling, C. and Tofte, M. (eds.) Proof, Language and Interaction: Essays in Honour of Robin Milner, MIT Press.Google Scholar
Reynolds, J. C. (1974) Towards a theory of type structure. In: Paris colloquium on programming. Springer-Verlag Lecture Notes in Computer Science 19.CrossRefGoogle Scholar
Sangiorgi, D. and Walker, D. (2001) The π-calculus: a Theory of Mobile Processes, Cambridge University Press.Google Scholar
Takeuchi, K., Honda, K. and Kubo, M. (1994) An interaction-based language and its typing system. In: PARLE '94: Parallel Architectures and Languages Europe. Springer-Verlag Lecture Notes in Computer Science 817.CrossRefGoogle Scholar
Turner, D. N. (1996) The Polymorphic Pi-Calculus: Theory and Implementation, Ph.D. thesis, University of Edinburgh.Google Scholar
Vallecillo, A., Vasconcelos, V. T. and Ravara, A. (2006) Typing the behavior of software components using session types. Fundamenta Informaticae 73 (4)583598.Google Scholar
Vasconcelos, V. T., Gay, S. J. and Ravara, A. (2006) Type checking a multithreaded functional language with session types. Theoretical Computer Science 368 (12) 6487.CrossRefGoogle Scholar
Vasconcelos, V. T. and Honda, K. (1993) Principal typing schemes in a polyadic π-calculus. In: CONCUR'93: Proceedings of the International Conference on Concurrency Theory. Springer-Verlag Lecture Notes in Computer Science 715.CrossRefGoogle Scholar
Vasconcelos, V. T., Ravara, A. and Gay, S. J. (2004) Session types for functional multithreading. In: CONCUR'04: Proceedings of the International Conference on Concurrency Theory. Springer-Verlag Lecture Notes in Computer Science 3170 497511.CrossRefGoogle Scholar
Yoshida, N. and Vasconcelos, V. T. (2006) Language primitives and type discipline for structured communication-based programming revisited – two systems for higher-order session communication. In: Procedings of the 1st International Workshop on Security and Rewriting Techniques (SecReT 2006). Electronic Notes in Theoretical Computer Science.Google Scholar