skip to main content

Multiparty GV: functional multiparty session types with certified deadlock freedom

Published:31 August 2022Publication History
Skip Abstract Section

Abstract

Session types have recently been integrated with functional languages, bringing message-passing concurrency to functional programming. Channel endpoints then become first-class and can be stored in data structures, captured in closures, and sent along channels. Representatives of the GV (Wadler's "Good Variation") session type family are of particular appeal because they not only assert session fidelity but also deadlock freedom, inspired by a Curry-Howard correspondence to linear logic. A restriction of current versions of GV, however, is the focus on binary sessions, limiting concurrent interactions within a session to two participants. This paper introduces Multiparty GV (MPGV), a functional language with multiparty session types, allowing concurrent interactions among several participants. MPGV upholds the strong guarantees of its ancestor GV, including deadlock freedom, despite session interleaving and delegation. MPGV has a novel redirecting construct for modular programming with first-class endpoints, thanks to which we give a type-preserving translation from binary session types to MPGV to show that MPGV is strictly more general than binary GV. All results in this paper have been mechanized using the Coq proof assistant.

References

  1. Arnon Avron. 1991. Hypersequents, Logical Consequence and Intermediate Logics for Concurrency. Annals of Mathematics and Artificial Intelligence, 4 (1991), 225–248. https://doi.org/10.1007/BF01531058 Google ScholarGoogle ScholarCross RefCross Ref
  2. Stephanie Balzer and Frank Pfenning. 2017. Manifest Sharing with Session Types. PACMPL, 1, ICFP (2017), 37:1–37:29. https://doi.org/10.1145/3110281 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Stephanie Balzer, Frank Pfenning, and Bernardo Toninho. 2018. A Universal Session Type for Untyped Asynchronous Communication. In CONCUR (LIPIcs, Vol. 118). 30:1–30:18. https://doi.org/10.4230/LIPIcs.CONCUR.2018.30 Google ScholarGoogle ScholarCross RefCross Ref
  4. Stephanie Balzer, Bernardo Toninho, and Frank Pfenning. 2019. Manifest Deadlock-Freedom for Shared Session Types. In ESOP (LNCS, Vol. 11423). 611–639. https://doi.org/10.1007/978-3-030-17184-1_22 Google ScholarGoogle ScholarCross RefCross Ref
  5. 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 (LNCS, Vol. 5201). 418–433. https://doi.org/10.1007/978-3-540-85361-9_33 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Luís Caires and Jorge A. Pérez. 2016. Multiparty Session Types Within a Canonical Binary Theory, and Beyond. In FORTE (LNCS, Vol. 9688). 74–95. https://doi.org/10.1007/978-3-319-39570-8_6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Luís Caires and Frank Pfenning. 2010. Session Types as Intuitionistic Linear Propositions. In CONCUR (LNCS, Vol. 6269). 222–236. https://doi.org/10.1007/978-3-642-15375-4_16 Google ScholarGoogle ScholarCross RefCross Ref
  8. Marco Carbone, Sam Lindley, Fabrizio Montesi, Carsten Schürmann, and Philip Wadler. 2016. Coherence Generalises Duality: A Logical Explanation of Multiparty Session Types. In CONCUR (LIPIcs, Vol. 59). 33:1–33:15. https://doi.org/10.4230/LIPIcs.CONCUR.2016.33 Google ScholarGoogle ScholarCross RefCross Ref
  9. Marco Carbone, Fabrizio Montesi, Carsten Schürmann, and Nobuko Yoshida. 2015. Multiparty Session Types as Coherence Proofs. In CONCUR (LIPIcs, Vol. 42). 412–426. https://doi.org/10.4230/LIPIcs.CONCUR.2015.412 Google ScholarGoogle ScholarCross RefCross Ref
  10. Marco Carbone, Fabrizio Montesi, Carsten Schürmann, and Nobuko Yoshida. 2017. Multiparty session types as coherence proofs. Acta Informatica, 54, 3 (2017), 243–269. https://doi.org/10.1007/s00236-016-0285-y Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. David Castro-Perez, Francisco Ferreira, Lorenzo Gheri, and Nobuko Yoshida. 2021. Zooid: A DSL for Certified Multiparty Computation: From Mechanised Metatheory to Certified Multiparty Processes. In PLDI. 237–251. https://doi.org/10.1145/3453483.3454041 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. David Castro-Perez, Francisco Ferreira, and Nobuko Yoshida. 2020. EMTST: Engineering the Meta-theory of Session Types. In TACAS (2) (LNCS, Vol. 12079). 278–285. https://doi.org/10.1007/978-3-030-45237-7_17 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Ruofei Chen, Stephanie Balzer, and Bernardo Toninho. 2022. Ferrite: A Judgmental Embedding of Session Types in Rust. In ECOOP (LIPIcs, Vol. 222). 22:1–22:28. https://doi.org/10.4230/LIPIcs.ECOOP.2022.22 Google ScholarGoogle ScholarCross RefCross Ref
  14. Luca Ciccone and Luca Padovani. 2020. A Dependently Typed Linear π -Calculus in Agda. In PPDP. 8:1–8:14. https://doi.org/10.1145/3414080.3414109 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Mario Coppo, Mariangiola Dezani-Ciancaglini, Luca Padovani, and Nobuko Yoshida. 2013. Inference of Global Progress Properties for Dynamically Interleaved Multiparty Sessions. In COORDINATION. https://doi.org/10.1007/978-3-642-38493-6_4 Google ScholarGoogle ScholarCross RefCross Ref
  16. Mario Coppo, Mariangiola Dezani-Ciancaglini, Nobuko Yoshida, and Luca Padovani. 2016. Global Progress for Dynamically Interleaved Multiparty Sessions. MSCS, 26, 2 (2016), 238–302. https://doi.org/10.1017/S0960129514000188 Google ScholarGoogle ScholarCross RefCross Ref
  17. Karl Crary, Robert Harper, and Sidd Puri. 1999. What is a Recursive Module? In PLDI. 50–63. https://doi.org/10.1145/301618.301641 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Luís Cruz-Filipe, Fabrizio Montesi, and Marco Peressotti. 2021. Certifying Choreography Compilation. In ICTAC (LNCS, Vol. 12819). 115–133. https://doi.org/10.1007/978-3-030-85315-0_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Luís Cruz-Filipe, Fabrizio Montesi, and Marco Peressotti. 2021. Formalising a Turing-Complete Choreographic Language in Coq. In ITP (LIPIcs, Vol. 193). 15:1–15:18. https://doi.org/10.4230/LIPIcs.ITP.2021.15 Google ScholarGoogle ScholarCross RefCross Ref
  20. Ornela Dardha and Simon J. Gay. 2018. A New Linear Logic for Deadlock-Free Session-Typed Processes. In FOSSACS (LNCS, Vol. 10803). 91–109. https://doi.org/10.1007/978-3-319-89366-2_5 Google ScholarGoogle ScholarCross RefCross Ref
  21. Romain Demangeon and Kohei Honda. 2012. Nested Protocols in Session Types. In CONCUR (LNCS, Vol. 7454). 272–286. https://doi.org/10.1007/978-3-642-32940-1_20 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Pierre-Malo Deniélou and Nobuko Yoshida. 2011. Dynamic multirole session types. In POPL. 435–446. https://doi.org/10.1145/1926385.1926435 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mariangiola Dezani-Ciancaglini, Dimitris Mostrous, Nobuko Yoshida, and Sophia Drossopoulou. 2006. Session Types for Object-Oriented Languages. In ESOP (LNCS, Vol. 4067). 328–352. https://doi.org/10.1007/11785477_20 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Simon Fowler, Wen Kokke, Ornela Dardha, Sam Lindley, and J. Garrett Morris. 2021. Separating Sessions Smoothly. In CONCUR (LIPIcs, Vol. 203). 36:1–36:18. https://doi.org/10.4230/LIPIcs.CONCUR.2021.36 Google ScholarGoogle ScholarCross RefCross Ref
  25. Simon Fowler, Sam Lindley, J. Garrett Morris, and Sára Decova. 2019. Exceptional Asynchronous Session Types: Session Types Without Tiers. PACMPL, 3, POPL (2019), 28:1–28:29. https://doi.org/10.1145/3290341 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Simon J. Gay, Peter Thiemann, and Vasco T. Vasconcelos. 2020. Duality of Session Types: The Final Cut. In PLACES (EPTCS, Vol. 314). 23–33. https://doi.org/10.4204/EPTCS.314.3 Google ScholarGoogle ScholarCross RefCross Ref
  27. Simon J. Gay and Vasco Thudichum Vasconcelos. 2010. Linear Type Theory for Asynchronous Session Types. JFP, 20, 1 (2010), 19–50. https://doi.org/10.1017/S0956796809990268 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Silvia Ghilezan, Jovanka Pantovic, Ivan Prokic, Alceste Scalas, and Nobuko Yoshida. 2021. Precise subtyping for asynchronous multiparty sessions. PACMPL, 5, POPL (2021), 1–28. https://doi.org/10.1145/3434297 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Elena Giachino, Naoki Kobayashi, and Cosimo Laneve. 2014. Deadlock Analysis of Unbounded Process Networks. In CONCUR (LNCS, Vol. 8704). 63–77. https://doi.org/10.1007/978-3-662-44584-6_6 Google ScholarGoogle ScholarCross RefCross Ref
  30. Matthew A. Goto, Radha Jagadeesan, Alan Jeffrey, Corin Pitcher, and James Riely. 2016. An Extensible Approach to Session Polymorphism. MSCS, 26, 3 (2016), 465–509. https://doi.org/10.1017/S0960129514000231 Google ScholarGoogle ScholarCross RefCross Ref
  31. Jonas Kastberg Hinrichsen, Daniël Louwrink, Robbert Krebbers, and Jesper Bengtson. 2021. Machine-checked semantic session typing. In CPP. 178–198. https://doi.org/10.1145/3437992.3439914 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Kohei Honda. 1993. Types for Dyadic Interaction. In CONCUR (LNCS, Vol. 715). 509–523. https://doi.org/10.1007/3-540-57208-2_35 Google ScholarGoogle ScholarCross RefCross Ref
  33. Kohei Honda, Vasco Thudichum Vasconcelos, and Makoto Kubo. 1998. Language Primitives and Type Discipline for Structured Communication-Based Programming. In ESOP (LNCS, Vol. 1381). 122–138. https://doi.org/10.1007/BFb0053567 Google ScholarGoogle ScholarCross RefCross Ref
  34. Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2008. Multiparty Asynchronous Session Types. In POPL. 273–284. https://doi.org/10.1145/1328438.1328472 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. 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
  36. Raymond Hu and Nobuko Yoshida. 2017. Explicit Connection Actions in Multiparty Session Types. In FASE (LNCS, Vol. 10202). 116–133. https://doi.org/10.1007/978-3-662-54494-5_7 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Keigo Imai, Nobuko Yoshida, and Shoji Yuen. 2019. Session-Ocaml: A Session-Based Library with Polarities and Lenses. Science of Computer Programming, 172 (2019), 135–159. https://doi.org/10.1016/j.scico.2018.08.005 Google ScholarGoogle ScholarCross RefCross Ref
  38. Keigo Imai, Shoji Yuen, and Kiyoshi Agusa. 2010. Session Type Inference in Haskell. In PLACES (EPTCS, Vol. 69). 74–91. https://doi.org/10.4204/EPTCS.69.6 Google ScholarGoogle ScholarCross RefCross Ref
  39. Jules Jacobs, Stephanie Balzer, and Robbert Krebbers. 2022. Connectivity graphs: a method for proving deadlock freedom based on separation logic. PACMPL, 6, POPL, 1–33. https://doi.org/10.1145/3498662 Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Jules Jacobs, Stephanie Balzer, and Robbert Krebbers. 2022. Coq development. https://doi.org/10.5281/zenodo.6884760 Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Thomas Bracht Laumann Jespersen, Philip Munksgaard, and Ken Friis Larsen. 2015. Session Types for Rust. In WGP. 13–22. https://doi.org/10.1145/2808098.2808100 Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Alex C. Keizer, Henning Basold, and Jorge A. Pérez. 2021. Session Coalgebras: A Coalgebraic View on Session Types and Communication Protocols. In ESOP (LNCS, Vol. 12648). 375–403. https://doi.org/10.1007/978-3-030-72019-3_14 Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Naoki Kobayashi. 1997. A Partially Deadlock-Free Typed Process Calculus. In LICS. 128–139. https://doi.org/10.1109/LICS.1997.614941 Google ScholarGoogle ScholarCross RefCross Ref
  44. Naoki Kobayashi. 2002. A Type System for Lock-Free Processes. I&C, 177, 2 (2002), 122–159. https://doi.org/10.1006/inco.2002.3171 Google ScholarGoogle ScholarCross RefCross Ref
  45. Naoki Kobayashi. 2006. A New Type System for Deadlock-Free Processes. In CONCUR (LNCS, Vol. 4137). 233–247. https://doi.org/10.1007/11817949_16 Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Naoki Kobayashi and Cosimo Laneve. 2017. Deadlock Analysis of Unbounded Process Networks. Inf. Comput., 252 (2017), 48–70. https://doi.org/10.1016/j.ic.2016.03.004 Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Wen Kokke. 2019. Rusty Variation: Deadlock-free Sessions with Failure in Rust. In ICE (EPTCS, Vol. 304). 48–60. https://doi.org/10.4204/EPTCS.304.4 Google ScholarGoogle ScholarCross RefCross Ref
  48. Wen Kokke and Ornela Dardha. 2021. Deadlock-Free Session Types in Linear Haskell. In Haskell Symposium. 1–13. https://doi.org/10.1145/3471874.3472979 Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Wen Kokke and Ornela Dardha. 2021. Prioritise the Best Variation. In FORTE (LNCS, Vol. 12719). 100–119. https://doi.org/10.1007/978-3-030-78089-0_6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Wen Kokke, Fabrizio Montesi, and Marco Peressotti. 2019. Better Late Than Never: a Fully-Abstract Semantics for Classical Processes. PACMPL, 3, POPL (2019), 24:1–24:29. https://doi.org/10.1145/3290337 Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Robbert Krebbers, Jacques-Henri Jourdan, Ralf Jung, Joseph Tassarotti, Jan-Oliver Kaiser, Amin Timany, Arthur Charguéraud, and Derek Dreyer. 2018. MoSeL: A General, Extensible Modal Framework for Interactive Proofs in Separation Logic. PACMPL, 2, ICFP (2018), 77:1–77:30. https://doi.org/10.1145/3236772 Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Robbert Krebbers, Amin Timany, and Lars Birkedal. 2017. Interactive Proofs in Higher-Order Concurrent Separation Logic. In POPL. 205–217. https://doi.org/10.1145/3009837.3009855 Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Sam Lindley and J. Garrett Morris. 2015. A Semantics for Propositions as Sessions. In ESOP (LNCS, Vol. 9032). 560–584. https://doi.org/10.1007/978-3-662-46669-8_23 Google ScholarGoogle ScholarCross RefCross Ref
  54. Sam Lindley and J. Garrett Morris. 2016. Embedding Session Types in Haskell. In Haskell Symposium. 133–145. https://doi.org/10.1145/2976002.2976018 Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Sam Lindley and J. Garrett Morris. 2016. Talking Bananas: Structural Recursion For Session Types. In ICFP. 434–447. https://doi.org/10.1145/2951913.2951921 Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Sam Lindley and J. Garrett Morris. 2017. Lightweight Functional Session Types. In Behavioural Types: from Theory to Tools. https://homepages.inf.ed.ac.uk/slindley/papers/fst.pdf Google ScholarGoogle Scholar
  57. Fabrizio Montesi. 2020. Introduction to Choreographies. https://www.fabriziomontesi.com/teaching/ct-2020/files/chor-notes.pdf Draft Google ScholarGoogle Scholar
  58. Fabrizio Montesi and Marco Peressotti. 2018. Classical Transitions. CoRR, abs/1803.01049 (2018), arxiv:1803.01049. arxiv:1803.01049 Google ScholarGoogle Scholar
  59. Dimitris Mostrous, Nobuko Yoshida, and Kohei Honda. 2009. Global Principal Typing in Partially Commutative Asynchronous Sessions. In ESOP (LNCS, Vol. 5502). 316–332. https://doi.org/10.1007/978-3-642-00590-9_23 Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Peter W. O’Hearn and David J. Pym. 1999. The Logic Of Bunched Implications. Bulletin of Symbolic Logic, 5, 2 (1999), 215–244. https://doi.org/10.2307/421090 Google ScholarGoogle ScholarCross RefCross Ref
  61. Peter W. O’Hearn, John C. Reynolds, and Hongseok Yang. 2001. Local Reasoning about Programs that Alter Data Structures. In CSL (LNCS, Vol. 2142). 1–19. https://doi.org/10.1007/3-540-44802-0_1 Google ScholarGoogle ScholarCross RefCross Ref
  62. Luca Padovani. 2014. Deadlock and lock freedom in the linear π -calculus. In LICS. 72:1–72:10. https://doi.org/10.1145/2603088.2603116 Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. Luca Padovani. 2017. A Simple Library Implementation of Binary Sessions. JFP, 27 (2017), e4. https://doi.org/10.1017/S0956796816000289 Google ScholarGoogle ScholarCross RefCross Ref
  64. Frank Pfenning and Dennis Griffith. 2015. Polarized Substructural Session Types. In FoSSaCS (LNCS, Vol. 9034). 3–22. https://doi.org/10.1007/978-3-662-46678-0_1 Google ScholarGoogle ScholarCross RefCross Ref
  65. Riccardo Pucella and Jesse A. Tov. 2008. Haskell Session Types with (Almost) No Class. In Haskell Symposium. 25–36. https://doi.org/10.1145/1411286.1411290 Google ScholarGoogle ScholarDigital LibraryDigital Library
  66. Arjen Rouvoet, Casper Bach Poulsen, Robbert Krebbers, and Eelco Visser. 2020. Intrinsically-Typed Definitional Interpreters for Linear, Session-Typed Languages. In CPP. 284–298. https://doi.org/10.1145/3372885.3373818 Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Alceste Scalas and Nobuko Yoshida. 2016. Lightweight Session Programming in Scala. In ECOOP (LIPIcs, 56). 21:1–21:28. https://doi.org/10.4230/LIPIcs.ECOOP.2016.21 Google ScholarGoogle ScholarCross RefCross Ref
  68. 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
  69. Alceste Scalas and Nobuko Yoshida. 2019. Less is more: multiparty session types revisited (technical report). https://www.doc.ic.ac.uk/research/technicalreports/2018/DTRS18-6.pdf Google ScholarGoogle Scholar
  70. Joseph Tassarotti, Ralf Jung, and Robert Harper. 2017. A Higher-Order Logic for Concurrent Termination-Preserving Refinement. In ESOP (LNCS, Vol. 10201). 909–936. https://doi.org/10.1007/978-3-662-54434-1_34 Google ScholarGoogle ScholarDigital LibraryDigital Library
  71. Peter Thiemann. 2019. Intrinsically-Typed Mechanized Semantics for Session Types. In PPDP. 19:1–19:15. https://doi.org/10.1145/3354166.3354184 Google ScholarGoogle ScholarDigital LibraryDigital Library
  72. Bernardo Toninho. 2015. A Logical Foundation for Session-Based Concurrent Computation. Ph. D. Dissertation. Carnegie Mellon University and New University of Lisbon. Google ScholarGoogle Scholar
  73. Bernardo Toninho, Luís Caires, and Frank Pfenning. 2013. Higher-Order Processes, Functions, and Sessions: A Monadic Integration. In ESOP (LNCS, Vol. 7792). 350–369. https://doi.org/10.1007/978-3-642-37036-6_20 Google ScholarGoogle ScholarDigital LibraryDigital Library
  74. Bernardo Toninho and Nobuko Yoshida. 2018. Interconnectability of Session-Based Logical Processes. TOPLAS, 40, 4 (2018), 17:1–17:42. https://doi.org/10.1145/3242173 Google ScholarGoogle ScholarDigital LibraryDigital Library
  75. Philip Wadler. 2012. Propositions as Sessions. In ICFP. 273–286. https://doi.org/10.1145/2364527.2364568 Google ScholarGoogle ScholarDigital LibraryDigital Library
  76. Uma Zalakain and Ornela Dardha. 2021. π with Leftovers: A Mechanisation in Agda. In FORTE (LNCS, Vol. 12719). 157–174. https://doi.org/10.1007/978-3-030-78089-0_9 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Multiparty GV: functional multiparty session types with certified deadlock freedom

    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