Mailbox Types for Unordered Interactions

Authors Ugo de'Liguoro , Luca Padovani

Thumbnail PDF


  • Filesize: 0.6 MB
  • 28 pages

Document Identifiers

Author Details

Ugo de'Liguoro
  • Università di Torino, Dipartimento di Informatica, Torino, Italy
Luca Padovani
  • Università di Torino, Dipartimento di Informatica, Torino, Italy

Cite AsGet BibTex

Ugo de'Liguoro and Luca Padovani. Mailbox Types for Unordered Interactions. In 32nd European Conference on Object-Oriented Programming (ECOOP 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 109, pp. 15:1-15:28, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


We propose a type system for reasoning on protocol conformance and deadlock freedom in networks of processes that communicate through unordered mailboxes. We model these networks in the mailbox calculus, a mild extension of the asynchronous pi-calculus with first-class mailboxes and selective input. The calculus subsumes the actor model and allows us to analyze networks with dynamic topologies and varying number of processes possibly mixing different concurrency abstractions. Well-typed processes are deadlock free and never fail because of unexpected messages. For a non-trivial class of them, junk freedom is also guaranteed. We illustrate the expressiveness of the calculus and of the type system by encoding instances of non-uniform, concurrent objects, binary sessions extended with joins and forks, and some known actor benchmarks.

Subject Classification

ACM Subject Classification
  • Theory of computation → Type structures
  • Theory of computation → Process calculi
  • Software and its engineering → Concurrent programming structures
  • Software and its engineering → Message passing
  • actors
  • concurrent objects
  • first-class mailboxes
  • unordered communication protocols
  • behavioral types
  • protocol conformance
  • deadlock freedom
  • junk freedom


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Gul Agha. Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, 1986. Google Scholar
  2. Davide Ancona, Viviana Bono, Mario Bravetti, Joana Campos, Giuseppe Castagna, Pierre-Malo Deniélou, Simon J. Gay, Nils Gesbert, Elena Giachino, Raymond Hu, Einar Broch Johnsen, Francisco Martins, Viviana Mascardi, Fabrizio Montesi, Rumyana Neykova, Nicholas Ng, Luca Padovani, Vasco T. Vasconcelos, and Nobuko Yoshida. Behavioral Types in Programming Languages. Foundations and Trends in Programming Languages, 3:95-230, 2016. URL:
  3. Joe Armstrong. Programming Erlang: Software for a Concurrent World. Pragmatic Bookshelf, 2013. Google Scholar
  4. Janusz A. Brzozowski. Derivatives of Regular Expressions. Journal of ACM, 11(4):481-494, 1964. URL:
  5. Luís Caires and Jorge A. Pérez. Multiparty session types within a canonical binary theory, and beyond. In Proceedings of FORTE'16, LNCS 9688, pages 74-95. Springer, 2016. URL:
  6. Luís Caires and Frank Pfenning. Session Types as Intuitionistic Linear Propositions. In Proceedings of CONCUR'10, LNCS 6269, pages 222-236. Springer, 2010. URL:
  7. Minas Charalambides, Peter Dinges, and Gul A. Agha. Parameterized, concurrent session types for asynchronous multi-actor interactions. Science of Computer Programming, 115-116:100-126, 2016. URL:
  8. Dominik Charousset, Raphael Hiesgen, and Thomas C. Schmidt. Revisiting actor programming in C++. Computer Languages, Systems & Structures, 45:105-131, 2016. URL:
  9. Arghya Chatterjee, Branko Gvoka, Bing Xue, Zoran Budimlic, Shams Imam, and Vivek Sarkar. A distributed selectors runtime system for java applications. In Proceedings of PPPJ'16, pages 3:1-3:11. ACM, 2016. URL:
  10. Maria Christakis and Konstantinos Sagonas. Detection of asynchronous message passing errors using static analysis. In Proceedings of PADL'11, LNCS 6539, pages 5-18. Springer, 2011. URL:
  11. John Conway. Regular Algebra and Finite Machines. William Clowes &Sons Ltd, 1971. Google Scholar
  12. Mario Coppo, Mariangiola Dezani-Ciancaglini, Nobuko Yoshida, and Luca Padovani. Global Progress for Dynamically Interleaved Multiparty Sessions. Mathematical Structures in Computer Science, 26:238-302, 2016. URL:
  13. Bruno Courcelle. Fundamental Properties of Infinite Trees. Theoretical Computer Science, 25:95-169, 1983. URL:
  14. Silvia Crafa. Behavioural types for actor systems. Technical Report 1206.1687, arXiv, 2012. URL:
  15. Silvia Crafa and Luca Padovani. The Chemical Approach to Typestate-Oriented Programming. ACM Transactions on Programming Languages and Systems, 39:13:1-13:45, 2017. URL:
  16. Ornela Dardha, Elena Giachino, and Davide Sangiorgi. Session types revisited. Information and Computation, 256:253-286, 2017. URL:
  17. Ugo de'Liguoro and Luca Padovani. Mailbox types for unordered interactions. CoRR, abs/1801.04167, 2018. URL:
  18. Javier Esparza, Stefan Kiefer, and Michael Luttenberger. Newtonian program analysis. Journal of the ACM, 57(6):33:1-33:47, 2010. URL:
  19. Simon Fowler. An Erlang implementation of multiparty session actors. In Proceedings of ICE'16, EPTCS 223, pages 36-50, 2016. URL:
  20. Simon Fowler, Sam Lindley, and Philip Wadler. Mixing metaphors: Actors as channels and channels as actors. In Proceedings of ECOOP'17, LIPIcs 74, pages 11:1-11:28, 2017. URL:
  21. Simon J. Gay and Malcolm Hole. Subtyping for session types in the pi calculus. Acta Informatica, 42(2-3):191-225, 2005. URL:
  22. Elena Giachino, Ludovic Henrio, Cosimo Laneve, and Vincenzo Mastandrea. Actors may synchronize, safely! In Proceedings PPDP'16, pages 118-131. ACM, 2016. URL:
  23. Philipp Haller. On the integration of the actor model in mainstream technologies: the scala perspective. In Proceedings of AGERE! 2012, pages 1-6. ACM, 2012. URL:
  24. Philipp Haller and Frank Sommers. Actors in Scala - concurrent programming for the multi-core era. Artima, 2011. Google Scholar
  25. Jiansen He, Philip Wadler, and Philip Trinder. Typecasting actors: From akka to takka. In Proceedings of the Fifth Annual Scala Workshop (SCALA'14), pages 23-33. ACM, 2014. URL:
  26. Carl Hewitt, Peter Bishop, and Richard Steiger. A Universal Modular ACTOR Formalism for Artificial Intelligence. In Proceedings of IJCAI'73, pages 235-245. William Kaufmann, 1973. Google Scholar
  27. Kohei Honda. Types for Dyadic Interaction. In Proceedings of CONCUR'93, volume LNCS 715, pages 509-523. Springer, 1993. URL:
  28. Mark W. Hopkins and Dexter Kozen. Parikh’s Theorem in Commutative Kleene Algebra. In Proceedings of LICS'99, pages 394-401. IEEE, 1999. URL:
  29. Hans Hüttel, Ivan Lanese, Vasco T. Vasconcelos, Luís Caires, Marco Carbone, Pierre-Malo Deniélou, Dimitris Mostrous, Luca Padovani, António Ravara, Emilio Tuosto, Hugo Torres Vieira, and Gianluigi Zavattaro. Foundations of Session Types and Behavioural Contracts. ACM Computing Surveys, 49(1):3:1-3:36, 2016. URL:
  30. Atsushi Igarashi and Naoki Kobayashi. A generic type system for the pi-calculus. Theoretical Computer Science, 311(1-3):121-163, 2004. URL:
  31. Shams Mahmood Imam and Vivek Sarkar. Integrating task parallelism with actors. SIGPLAN Notices, 47(10):753-772, 2012. URL:
  32. Shams Mahmood Imam and Vivek Sarkar. Savina - an actor benchmark suite: Enabling empirical evaluation of actor libraries. In Proceedings of AGERE! 2014, pages 67-80. ACM, 2014. URL:
  33. Shams Mahmood Imam and Vivek Sarkar. Selectors: Actors with multiple guarded mailboxes. In Proceedings of AGERE! 2014, pages 1-14. ACM, 2014. URL:
  34. Naoki Kobayashi. A Type System for Lock-Free Processes. Information and Computation, 177(2):122-159, 2002. URL:
  35. Naoki Kobayashi. Type systems for concurrent programs. Technical report, Tohoku University, 2007. Short version appeared in 10th Anniversary Colloquium of UNU/IIST, 2002. URL:
  36. Naoki Kobayashi and Cosimo Laneve. Deadlock analysis of unbounded process networks. Information and Computation, 252:48-70, 2017. URL:
  37. Naoki Kobayashi and Akinori Yonezawa. Type-theoretic foundations for concurrent object-oriented programming. In Proceedings of OOPSLA'94, pages 31-45. ACM, 1994. URL:
  38. Naoki Kobayashi and Akinori Yonezawa. Asynchronous communication model based on linear logic. Formal Aspects of Computing, 7(2):113-149, 1995. URL:
  39. Sam Lindley and J. Garrett Morris. A semantics for propositions as sessions. In Proceedings of ESOP'15, LNCS 9032, pages 560-584. Springer, 2015. URL:
  40. Vincenzo Mastandrea. Deadlock analysis with behavioral types for actors. In Proceedings of ICTCS'16, volume 1720 of CEUR Workshop Proceedings, pages 257-262, 2016. URL:
  41. Dimitris Mostrous and Vasco T. Vasconcelos. Session typing for a featherweight Erlang. In Proceedings of COORDINATION'11, LNCS 6721, pages 95-109. Springer, 2011. URL:
  42. Elie Najm, Abdelkrim Nimour, and Jean-Bernard Stefani. Guaranteeing liveness in an object calculus through behavioural typing. In Proceedings of FORTE'99, volume 156, pages 203-221. Kluwer, 1999. Google Scholar
  43. Rumyana Neykova and Nobuko Yoshida. Multiparty session actors. Logical Methods in Computer Science, 13(1), 2017. URL:
  44. Luca Padovani. Deadlock and Lock Freedom in the Linear π-Calculus. In Proceedings of CSL-LICS'14, pages 72:1-72:10. ACM, 2014. URL:
  45. Luca Padovani. Deadlock-Free Typestate-Oriented Programming. Programming Journal, 2, 2018. URL:
  46. Luca Padovani. MC², the Mailbox Calculus Checker, 2018. URL:
  47. Benjamin C. Pierce and Davide Sangiorgi. Typing and subtyping for mobile processes. Mathematical Structures in Computer Science, 6(5):409-453, 1996. Google Scholar
  48. Franz Puntigam. Strong types for coordinating active objects. Concurrency and Computation: Practice and Experience, 13(4):293-326, 2001. URL:
  49. Franz Puntigam and Christof Peter. Types for active objects with static deadlock prevention. Fundamenta Informaticae, 48(4):315-341, 2001. URL:
  50. António Ravara and Vasco T. Vasconcelos. Typing non-uniform concurrent objects. In Proceedings of CONCUR'00, LNCS 1877, pages 474-488. Springer, 2000. URL:
  51. Davide Sangiorgi and David Walker. The Pi-Calculus - A theory of mobile processes. Cambridge University Press, 2001. Google Scholar
  52. Sriram Srinivasan and Alan Mycroft. Kilim: Isolation-typed actors for java. In Proceedings of ECOOP'08, LNCS 5142, pages 104-128. Springer, 2008. URL:
  53. Samira Tasharofi, Peter Dinges, and Ralph E. Johnson. Why do scala developers mix the actor model with other concurrency models? In Proceedings of ECOOP'13, LNCS 7920, pages 302-326. Springer, 2013. URL:
  54. Carlos A. Varela and Gul Agha. Programming dynamically reconfigurable open systems with SALSA. SIGPLAN Notices, 36(12):20-34, 2001. URL:
  55. Philip Wadler. Propositions as sessions. Journal of Functional Programming, 24(2-3):384-418, 2014. URL: