skip to main content
research-article
Open Access

Precise subtyping for asynchronous multiparty sessions

Published:04 January 2021Publication History
Skip Abstract Section

Abstract

Session subtyping is a cornerstone of refinement of communicating processes: a process implementing a session type (i.e., a communication protocol) T can be safely used whenever a process implementing one of its supertypes T′ is expected, in any context, without introducing deadlocks nor other communication errors. As a consequence, whenever T T′ holds, it is safe to replace an implementation of T′ with an implementation of the subtype T, which may allow for more optimised communication patterns.

We present the first formalisation of the precise subtyping relation for asynchronous multiparty sessions. We show that our subtyping relation is sound (i.e., guarantees safe process replacement, as outlined above) and also complete: any extension of the relation is unsound. To achieve our results, we develop a novel session decomposition technique, from full session types (including internal/external choices) into single input/output session trees (without choices).

Previous work studies precise subtyping for binary sessions (with just two participants), or multiparty sessions (with any number of participants) and synchronous interaction. Here, we cover multiparty sessions with asynchronous interaction, where messages are transmitted via FIFO queues (as in the TCP/IP protocol), and prove that our subtyping is both operationally and denotationally precise. In the asynchronous multiparty setting, finding the precise subtyping relation is a highly complex task: this is because, under some conditions, participants can permute the order of their inputs and outputs, by sending some messages earlier or receiving some later, without causing errors; the precise subtyping relation must capture all such valid permutations — and consequently, its formalisation, reasoning and proofs become challenging. Our session decomposition technique overcomes this complexity, expressing the subtyping relation as a composition of refinement relations between single input/output trees, and providing a simple reasoning principle for asynchronous message optimisations.

References

  1. Davide Ancona, Viviana Bono, Mario Bravetti, Giuseppe Castagna, Joana Campos, Simon J. Gay, Elena Giachino, Einar Broch Johnsen, Viviana Mascardi, Nicholas Ng, Luca Padovani, Pierre-Malo Deniélou, Nils Gesbert, Raymond Hu, Francisco Martins, Fabrizio Montesi, Rumyana Neykova, Vasco T. Vasconcelos, and Nobuko Yoshida. 2016. Behavioral Types in Programming Languages. Foundations and Trends in Programming Languages 3, 2-3, 95-230. https://doi.org/10.1561/ 2500000031 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Henk Barendregt, Mario Coppo, and Mariangiola Dezani-Ciancaglini. 1983. A Filter Lambda Model and the Completeness of Type Assignment. Journal of Symbolic Logic 48, 4 ( 1983 ), 931-940. https://doi.org/10.2307/2273659 Google ScholarGoogle ScholarCross RefCross Ref
  3. Lorenzo Bettini, Mario Coppo, Loris D'Antoni, Marco De Luca, Mariangiola Dezani-Ciancaglini, and Nobuko Yoshida. 2008. Global Progress in Dynamically Interleaved Multiparty Sessions. In CONCUR 2008 (LNCS, Vol. 5201 ), Franck van Breugel and Marsha Chechik (Eds.). Springer, 418-433. https://doi.org/10.1007/978-3-540-85361-9_33 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Jeremy Blackburn, Ivory Hernandez, Jay Ligatti, and Michael Nachtigal. 2012. Completely Subtyping Iso-recursive Types. Technical Report CSE-071012. University of South Florida.Google ScholarGoogle Scholar
  5. Daniel Brand and Pitro Zafiropulo. 1983. On Communicating Finite-State Machines. JACM 30, 2 ( 1983 ). https://doi.org/10. 1145/322374.322380 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Mario Bravetti, Marco Carbone, Julien Lange, Nobuko Yoshida, and Gianluigi Zavattaro. 2019a. A Sound Algorithm for Asynchronous Session Subtyping. 140 ( 2019 ), 38 : 1-38 : 16. https://doi.org/10.4230/LIPIcs.CONCUR. 2019.38 Google ScholarGoogle ScholarCross RefCross Ref
  7. Mario Bravetti, Marco Carbone, Julien Lange, Nobuko Yoshida, and Gianluigi Zavattaro. 2019b. A Sound Algorithm for Asynchronous Session Subtyping (extended version). Extended version of [Bravetti et al. 2019a], available at: http://arxiv.org/abs/ 1907.00421.Google ScholarGoogle Scholar
  8. Mario Bravetti, Marco Carbone, and Gianluigi Zavattaro. 2018. On the boundary between decidability and undecidability of asynchronous session subtyping. Theoretical Computer Science 722 ( 2018 ), 19-51. https://doi.org/10.1016/j.tcs. 2018. 02.010 Google ScholarGoogle ScholarCross RefCross Ref
  9. Giuseppe Castagna, Rocco De Nicola, and Daniele Varacca. 2008. Semantic subtyping for the pi-calculus. Theoretical Computer Science 398, 1-3 ( 2008 ), 217-242. https://doi.org/10.1016/j.tcs. 2008. 01.049 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Giuseppe Castagna, Mariangiola Dezani-Ciancaglini, Elena Giachino, and Luca Padovani. 2009a. Foundations of session types. In PPDP 2009. ACM, 219-230. https://doi.org/10.1145/1599410.1599437 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Giuseppe Castagna and Alain Frisch. 2005. A Gentle Introduction to Semantic Subtyping. In ICALP 2005 (LNCS, Vol. 3580 ). Springer, 30-34. https://doi.org/10.1007/11523468_3 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Giuseppe Castagna, Nils Gesbert, and Luca Padovani. 2009b. A Theory of Contracts for Web Services. ACM Trans. Program. Lang. Syst. 31, 5, Article 19 ( July 2009 ). https://doi.org/10.1145/1538917.1538920 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. David Castro-Perez and Nobuko Yoshida. 2020a. CAMP: Cost-Aware Multiparty Session Protocols. PACMPL SPLASH/OOPSLA ( 2020 ), 30 pages. To appear.Google ScholarGoogle Scholar
  14. David Castro-Perez and Nobuko Yoshida. 2020b. Compiling First-Order Functions to Session-Typed Parallel Code. In 29th International Conference on Compiler Construction. ACM, 143-154. https://doi.org/10.1145/3377555.3377889 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, Alceste Scalas, and Nobuko Yoshida. 2017. On the Preciseness of Subtyping in Session Types. Logical Methods in Computer Science 13, 2 ( 2017 ). https://doi.org/10.23638/LMCS-13 ( 2 :12) 2017 Google ScholarGoogle ScholarCross RefCross Ref
  16. Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, and Nobuko Yoshida. 2014. On the Preciseness of Subtyping in Session Types. In PPDP'14. ACM, 135-146. https://doi.org/10.1145/2643135.2643138 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Romain Demangeon and Kohei Honda. 2011. Full Abstraction in a Subtyped pi-Calculus with Linear Types. In CONCUR 2011 (LNCS, Vol. 6901 ). Springer, 280-296. https://doi.org/10.1007/978-3-642-23217-6_19 Google ScholarGoogle ScholarCross RefCross Ref
  18. Romain Demangeon and Nobuko Yoshida. 2015. On the Expressiveness of Multiparty Sessions. In 35th IARCS Annual Conference on Foundation of Software Technology and Theoretical Computer Science, FSTTCS 2015, December 16-18, 2015, Bangalore, India (LIPIcs, Vol. 45 ), Prahladh Harsha and G. Ramalingam (Eds.). https://doi.org/10.4230/LIPIcs.FSTTCS. 2015.560 Google ScholarGoogle ScholarCross RefCross Ref
  19. Pierre-Malo Deniélou and Nobuko Yoshida. 2012. Multiparty Session Types Meet Communicating Automata. In ESOP 2012. 194-213. https://doi.org/10.1007/978-3-642-28869-2_10 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Pierre-Malo Deniélou and Nobuko Yoshida. 2013. Multiparty Compatibility in Communicating Automata: Characterisation and Synthesis of Global Session Types. In ICALP 2013 (LNCS, Vol. 7966 ). Springer, 174-186. https://doi.org/10.1007/978-3-642-39212-2_18 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Mariangiola Dezani-Ciancaglini, Ugo de'Liguoro, and Adolfo Piperno. 1998. A Filter Model for Concurrent lambda-Calculus. SIAM J. Comput. 27, 5 ( 1998 ), 1376-1419. https://doi.org/10.1137/S0097539794275860 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Mariangiola Dezani-Ciancaglini and Silvia Ghilezan. 2014. Preciseness of Subtyping on Intersection and Union Types. In RTA-TLCA 2-14 (LNCS, Vol. 8560 ). Springer, 194-207. https://doi.org/10.1007/978-3-319-08918-8_14 Google ScholarGoogle ScholarCross RefCross Ref
  23. Alain Frisch, Giuseppe Castagna, and Véronique Benzaken. 2008. Semantic Subtyping: Dealing set-theoretically with function, union, intersection, and negation types. Journal of ACM 55, 4 ( 2008 ), 19 : 1-19 : 64. https://doi.org/10.1145/1391289.1391293 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Simon Gay and Malcolm Hole. 2005. Subtyping for session types in the pi calculus. 42, 2-3 ( 2005 ), 191-225. https: //doi.org/10.1007/s00236-005-0177-z Google ScholarGoogle ScholarCross RefCross Ref
  25. Simon Gay and Antonio Ravara (Eds.). 2017. Behavioural Types: from Theory to Tools. River Publishers. https://doi.org/10. 13052/rp-9788793519817 Google ScholarGoogle ScholarCross RefCross Ref
  26. Silvia Ghilezan, Svetlana Jakšić, Jovanka Pantović, Alceste Scalas, and Nobuko Yoshida. 2019. Precise subtyping for synchronous multiparty sessions. J. Log. Algebr. Meth. Program. 104 ( 2019 ), 127-173. https://doi.org/10.1016/j.jlamp. 2018. 12.002 Google ScholarGoogle ScholarCross RefCross Ref
  27. Silvia Ghilezan, Jovanka Pantović, Ivan Prokić, Alceste Scalas, and Nobuko Yoshida. 2020. Precise Subtyping for Asynchronous Multiparty Sessions (Extended Version). Available at: https://arxiv.org/abs/ 2010.13925.Google ScholarGoogle Scholar
  28. J. Roger Hindley. 1983. The Completeness Theorem for Typing Lambda-Terms. Theoretical Computer Science 22 ( 1983 ), 1-17. https://doi.org/10.1016/ 0304-3975 ( 83 ) 90136-6 Google ScholarGoogle ScholarCross RefCross Ref
  29. Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. 1998. In ESOP' 98 ( LNCS, Vol. 1381 ). Springer, 122-138. https: //doi.org/10.1007/BFb0053567 Google ScholarGoogle ScholarCross RefCross Ref
  30. Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2008. Multiparty asynchronous session types. In POPL 2008. ACM, 273-284. https://doi.org/10.1145/1328438.1328472 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2016. Multiparty Asynchronous Session Types. J. ACM 63, 1 ( 2016 ), 9 : 1-9 : 67. https://doi.org/10.1145/2827695 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Ross Horne. 2020. Session Subtyping and Multiparty Compatibility Using Circular Sequents. In 31st International Conference on Concurrency Theory, CONCUR 2020, September 1-4, 2020, Vienna, Austria (Virtual Conference) (LIPIcs, Vol. 171 ), Igor Konnov and Laura Kovács (Eds.). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 12 : 1-12 : 22. https://doi.org/10. 4230/LIPIcs.CONCUR. 2020.12 Google ScholarGoogle ScholarCross RefCross Ref
  33. Raymond Hu. 2017. Distributed Programming Using Java APIs Generated from Session Types. ( 2017 ), 287-308. https: //doi.org/10.13052/rp-9788793519817 Google ScholarGoogle ScholarCross RefCross Ref
  34. Hai Huang, Padmanabhan Pillai, and Kang G. Shin. 2002. Improving Wait-Free Algorithms for Interprocess Communication in Embedded Real-Time Systems. In USENIX Annual Technical Conference, General Track. https://www.usenix.org/legacy/ event/usenix02/full_papers/huang/huang.pdfGoogle ScholarGoogle Scholar
  35. Julien Lange and Nobuko Yoshida. 2017. On the Undecidability of Asynchronous Session Subtyping. In FoSSaCS 2017 (LNCS, Vol. 10203 ). 441-457. https://doi.org/10.1007/978-3-662-54458-7_26 Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Julien Lange and Nobuko Yoshida. 2019. Verifying Asynchronous Interactions via Communicating Session Automata. In Computer Aided Verification-31st International Conference, CAV 2019, New York City, NY, USA, July 15-18, 2019, Proceedings, Part I. 97-117. https://doi.org/10.1007/978-3-030-25540-4_6 Google ScholarGoogle ScholarCross RefCross Ref
  37. Jay Ligatti, Jeremy Blackburn, and Michael Nachtigal. 2017. On Subtyping-Relation Completeness, with an Application to IsoRecursive Types. ACM Trans. Program. Lang. Syst. 39, 1, Article 4 (March 2017 ), 36 pages. https://doi.org/10.1145/2994596 Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Barbara H. Liskov and Jeannette M. Wing. 1994. A behavioral notion of subtyping. ACM Trans. Program. Lang. Syst. 16, 6 (Nov. 1994 ), 1811-1841. https://doi.org/10.1145/197320.197383 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Dimitris Mostrous and Nobuko Yoshida. 2015. Session Typing and Asynchronous Subtying for Higher-Order-Calculus. Information and Computation 241 ( 2015 ), 227-263. https://doi.org/10.1016/j.ic. 2015. 02.002 Google ScholarGoogle ScholarCross RefCross Ref
  40. Dimitris Mostrous, Nobuko Yoshida, and Kohei Honda. 2009. Global Principal Typing in Partially Commutative Asynchronous Sessions. In Programming Languages and Systems, 18th European Symposium on Programming, ESOP 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, York, UK, March 22-29, 2009. Proceedings (LNCS, Vol. 5502 ), Giuseppe Castagna (Ed.). Springer, 316-332. https://doi.org/10.1007/978-3-642-00590-9_23 Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Nicholas Ng, Jose G.F. Coutinho, and Nobuko Yoshida. 2015. Protocols by Default: Safe MPI Code Generation based on Session Types. In CC 2015 (LNCS, Vol. 9031 ). Springer, 212-232. https://doi.org/10.1007/978-3-662-46663-6_11 Google ScholarGoogle ScholarCross RefCross Ref
  42. Nicholas Ng, Nobuko Yoshida, and Kohei Honda. 2012. Multiparty Session C: Safe Parallel Programming with Message Optimisation. In TOOLS 2012 (LNCS, Vol. 7304 ). Springer, 202-218. https://doi.org/10.1007/978-3-642-30561-0_15 Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Benjamin C. Pierce. 2002. Types and programming languages. MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Benjamin C. Pierce and Davide Sangiorgi. 1996. Typing and Subtyping for Mobile Processes. Mathematical Structures in Computer Science 6, 5 ( 1996 ), 409-453.Google ScholarGoogle Scholar
  45. Davide Sangiorgi. 2011. Introduction to Bisimulation and Coinduction. Cambridge University Press. https://doi.org/10.1017/ CBO9780511777110 Google ScholarGoogle ScholarCross RefCross Ref
  46. Alceste Scalas and Nobuko Yoshida. 2019. Less is more: multiparty session types revisited. PACMPL 3, POPL ( 2019 ), 30 : 1-30 : 29. https://doi.org/10.1145/3290343 Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Kaku Takeuchi, Kohei Honda, and Makoto Kubo. 1994. An Interaction-based Language and its Typing System. In PARLE '94 (LNCS, Vol. 817 ). Springer, 398-413. https://doi.org/10.1007/3-540-58184-7_118 Google ScholarGoogle ScholarCross RefCross Ref
  48. Nobuko Yoshida, Vasco Thudichum Vasconcelos, Hervé Paulino, and Kohei Honda. 2008. Session-Based Compilation Framework for Multicore Programming. In Formal Methods for Components and Objects, 7th International Symposium, FMCO 2008, Sophia Antipolis, France, October 21-23, 2008, Revised Lectures (LNCS, Vol. 5751 ), Frank S. de Boer, Marcello M. Bonsangue, and Eric Madelaine (Eds.). Springer, 226-246. https://doi.org/10.1007/978-3-642-04167-9_12 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Precise subtyping for asynchronous multiparty sessions

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!