Session Types With Multiple Senders Single Receiver (report version) (2310.12187v2)
Abstract: Message passing is a fundamental element in software development, ranging from concurrent and mobile computing to distributed services, but it suffers from communication errors such as deadlocks. Session types are a typing discipline for enforcing safe structured interactions between multiple participants. However, each typed interaction is restricted to having one fixed sender and one fixed receiver. In this paper, we extend session types with existential branching types, to handle a common interaction pattern with multiple senders and a single receiver in a synchronized setting, i.e. a receiver is available to receive messages from multiple senders, and which sender actually participates in the interaction cannot be determined till execution. We build the type system with existential branching types, which retain the important properties induced by standard session types: type safety, progress (i.e. deadlock-freedom), and fidelity. We further provide a novel communication type system to guarantee progress of dynamically interleaved multiparty sessions, by abandoning the strong restrictions of existing type systems. Finally, we encode Rust multi-thread primitives in the extended session types to show its expressivity, which can be considered as an attempt to check the deadlock-freedom of Rust multi-thread programs.
- Generalised multiparty session types with crash-stop failures. In CONCUR 2022, volume 243 of LIPIcs, pages 1–25. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022.
- Global progress in dynamically interleaved multiparty sessions. In CONCUR 2008, volume 5201 of LNCS, pages 418–433. Springer, 2008.
- Ferrite: A judgmental embedding of session types in Rust. In ECOOP 2022, volume 222 of LIPIcs, pages 1–28. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022.
- On progress for structured communications. In TGC 2007, volume 4912 of LNCS, pages 257–275. Springer, 2007.
- P.-M. Deniélou and N. Yoshida. Dynamic multirole session types. In POPL 2011, pages 435–446. ACM, 2011.
- Exceptional asynchronous session types: Session types without tiers. In POPL 2019, pages 1–29. ACM, 2019.
- Design-by-contract for flexible multiparty session protocols. In ECOOP 2022, volume 222 of LIPIcs, pages 1–28. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022.
- Precise subtyping for synchronous multiparty sessions. J. Log. Algebraic Methods Program., 104:127–173, 2019.
- K. Honda. Types for dyadic interaction. In CONCUR ’93, volume 715 of LNCS, pages 509–523. Springer, 1993.
- Language primitives and type discipline for structured communication-based programming. In ESOP’98, volume 1381 of LNCS, pages 122–138. Springer, 1998.
- Multiparty asynchronous session types. In POPL 2008, pages 273–284. ACM, 2008.
- Kmclib: Automated inference and verification of session types from OCaml programs. In TACAS 2022, volume 13243 of LNCS, pages 379–386. Springer, 2022.
- Session types for Rust. In WGP@ICFP 2015, pages 13–22. ACM, 2015.
- N. Kobayashi. Type-based information flow analysis for the pi-calculus. Acta Informatica, 42(4-5):291–347, 2005.
- N. Kobayashi. A new type system for deadlock-free processes. In CONCUR 2006, volume 4137 of LNCS, pages 233–247. Springer, 2006.
- W. Kokke. Rusty variation: Deadlock-free sessions with failure in Rust. In ICE 2019, volume 304 of EPTCS, pages 48–60, 2019.
- Implementing multiparty session types in Rust. In COORDINATION 2020, volume 12134 of LNCS, pages 127–136. Springer, 2020.
- J. Lange and N. Yoshida. Verifying asynchronous interactions via communicating session automata. In CAV 2019, volume 11561 of LNCS, pages 97–117. Springer, 2019.
- Multiparty motion coordination: From choreographies to robotics programs. Proc. ACM Program. Lang., 4(OOPSLA):1–30, 2020.
- Benjamin C. Pierce. Types and Programming Languages. MIT Press, 2002.
- A. Scalas and N. Yoshida. Multiparty session types, beyond duality. J. Log. Algebraic Methods Program., 97:55–84, 2018.
- A. Scalas and N. Yoshida. Less is more: Multiparty session types revisited. In POPL 2019, pages 1–29, 2019.
- B. Toninho and N. Yoshida. Certifying data in multiparty session types. J. Log. Algebraic Methods Program., 90:61–83, 2017.
- B. Toninho and N. Yoshida. Depending on session-typed processes. In FOSSACS’18, volume 10803 of LNCS, pages 128–145. Springer, 2018.
- Understanding real-world concurrency bugs in Go. In ASPLOS 2019, pages 865–878. ACM, 2019.
- H. Wu and H. Xi. Dependent session types. In http://arxiv.org/abs/1704.07004. (2017). arXiv CoRR., 2017.
- Parameterised multiparty session types. In FOSSACS 2010, volume 6014 of LNCS, pages 128–145. Springer, 2010.
- N. Yoshida and L. Gheri. A very gentle introduction to multiparty session types. In ICDCIT 2020, volume 11969 of LNCS, pages 73–93. Springer, 2020.