Abstract
A binary session is a private communication channel that connects two processes, each adhering to a protocol description called session type. In this work, we study the first type system that ensures the fair termination of binary sessions. A session fairly terminates if all of the infinite executions admitted by its protocol are deemed unrealistic because they violate certain fairness assumptions. Fair termination entails the eventual completion of all pending input/output actions, including those that depend on the completion of an unbounded number of other actions in possibly different sessions. This form of lock freedom allows us to address a large family of natural communication patterns that fall outside the scope of existing type systems. Our type system is also the first to adopt fair subtyping, a liveness-preserving refinement of the standard subtyping relation for session types that so far has only been studied theoretically. Fair subtyping is surprisingly subtle not only to characterize concisely but also to use appropriately, to the point that the type system must carefully account for all usages of fair subtyping to avoid compromising its liveness-preserving properties.
Supplemental Material
Available for Download
Appendix with proofs, auxiliary definitions and results.
- Peter Aczel. 1977. An Introduction to Inductive Definitions. In Handbook of Mathematical Logic, Jon Barwise (Ed.) (Studies in Logic and the Foundations of Mathematics, Vol. 90). Elsevier, 739 – 782. issn:0049-237X https://doi.org/10.1016/S0049-237X(08)71120-0 Google Scholar
Cross Ref
- Davide Ancona, Francesco Dagnino, and Elena Zucca. 2017. Generalizing Inference Systems by Coaxioms. In Programming Languages and Systems - 26th European Symposium on Programming, ESOP 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings, Hongseok Yang (Ed.) (Lecture Notes in Computer Science, Vol. 10201). Springer, 29–55. https://doi.org/10.1007/978-3-662-54434-1_2 Google Scholar
Digital Library
- Krzysztof R. Apt, Nissim Francez, and Shmuel Katz. 1987. Appraising Fairness in Languages for Distributed Programming. In Conference Record of the Fourteenth Annual ACM Symposium on Principles of Programming Languages, Munich, Germany, January 21-23, 1987. ACM Press, 189–198. https://doi.org/10.1145/41625.41642 Google Scholar
Digital Library
- David Baelde. 2012. Least and Greatest Fixed Points in Linear Logic. ACM Trans. Comput. Log., 13, 1 (2012), 2:1–2:44. https://doi.org/10.1145/2071368.2071370 Google Scholar
Digital Library
- Stephanie Balzer, Bernardo Toninho, and Frank Pfenning. 2019. Manifest Deadlock-Freedom for Shared Session Types. In Programming Languages and Systems - 28th European Symposium on Programming, ESOP 2019, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019, Prague, Czech Republic, April 6-11, 2019, Proceedings, Luís Caires (Ed.) (Lecture Notes in Computer Science, Vol. 11423). Springer, 611–639. https://doi.org/10.1007/978-3-030-17184-1_22 Google Scholar
Cross Ref
- Giovanni Bernardi and Matthew Hennessy. 2016. Using higher-order contracts to model session types. Log. Methods Comput. Sci., 12, 2 (2016), https://doi.org/10.2168/LMCS-12(2:10)2016 Google Scholar
Cross Ref
- Philippe Bidinger and Adriana B. Compagnoni. 2009. Pict correctness revisited. Theor. Comput. Sci., 410, 2-3 (2009), 114–127. https://doi.org/10.1016/j.tcs.2008.09.014 Google Scholar
Digital Library
- Mario Bravetti, Julien Lange, and Gianluigi Zavattaro. 2021. Fair Refinement for Asynchronous Session Types. In Foundations of Software Science and Computation Structures - 24th International Conference, FOSSACS 2021, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2021, Luxembourg City, Luxembourg, March 27 - April 1, 2021, Proceedings, Stefan Kiefer and Christine Tasson (Eds.) (Lecture Notes in Computer Science, Vol. 12650). Springer, 144–163. https://doi.org/10.1007/978-3-030-71995-1_8 Google Scholar
Digital Library
- Mario Bravetti and Gianluigi Zavattaro. 2009. A theory of contracts for strong service compliance. Math. Struct. Comput. Sci., 19, 3 (2009), 601–638. https://doi.org/10.1017/S0960129509007658 Google Scholar
Digital Library
- Michele Bugliesi, Damiano Macedonio, Luca Pino, and Sabina Rossi. 2009. Compliance Preorders for Web Services. In Web Services and Formal Methods, 6th International Workshop, WS-FM 2009, Bologna, Italy, September 4-5, 2009, Revised Selected Papers, Cosimo Laneve and Jianwen Su (Eds.) (Lecture Notes in Computer Science, Vol. 6194). Springer, 76–91. https://doi.org/10.1007/978-3-642-14458-5_5 Google Scholar
Cross Ref
- Diletta Cacciagrano, Flavio Corradini, and Catuscia Palamidessi. 2006. Fair Pi. In Proceedings of the 13th International Workshop on Expressiveness in Concurrency, EXPRESS 2006, Bonn, Germany, August 26, 2006, Roberto M. Amadio and Iain Phillips (Eds.) (Electronic Notes in Theoretical Computer Science, Vol. 175). Elsevier, 3–26. https://doi.org/10.1016/j.entcs.2006.10.051 Google Scholar
Digital Library
- Diletta Cacciagrano, Flavio Corradini, and Catuscia Palamidessi. 2009. Explicit fairness in testing semantics. Log. Methods Comput. Sci., 5, 2 (2009), https://doi.org/10.2168/LMCS-5(2:15)2009 Google Scholar
Cross Ref
- Luís Caires, Frank Pfenning, and Bernardo Toninho. 2016. Linear logic propositions as session types. Math. Struct. Comput. Sci., 26, 3 (2016), 367–423. https://doi.org/10.1017/S0960129514000218 Google Scholar
Cross Ref
- Giuseppe Castagna, Mariangiola Dezani-Ciancaglini, Elena Giachino, and Luca Padovani. 2009. Foundations of session types. In Proceedings of the 11th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, September 7-9, 2009, Coimbra, Portugal, António Porto and Francisco Javier López-Fraguas (Eds.). ACM, 219–230. https://doi.org/10.1145/1599410.1599437 Google Scholar
Digital Library
- Luca Ciccone and Luca Padovani. 2021. FairCheck. https://github.com/boystrange/FairCheckGoogle Scholar
- Luca Ciccone and Luca Padovani. 2021. Inference Systems with Corules for Fair Subtyping and Liveness Properties of Binary Session Types. In Proceedings of the 48superscript th International Colloquium on Automata, Languages, and Programming (ICALP’21), Nikhil Bansal, Emanuela Merelli, and James Worrell (Eds.) (LIPIcs, Vol. 198). Schloss Dagstuhl–Leibniz-Zentrum für Informatik, Dagstuhl, Germany. 125:1–125:16. https://doi.org/10.4230/LIPIcs.ICALP.2021.125 Google Scholar
Cross Ref
- Byron Cook, Alexey Gotsman, Andreas Podelski, Andrey Rybalchenko, and Moshe Y. Vardi. 2007. Proving that programs eventually do something good. In Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2007, Nice, France, January 17-19, 2007, Martin Hofmann and Matthias Felleisen (Eds.). ACM, 265–276. https://doi.org/10.1145/1190216.1190257 Google Scholar
Digital Library
- Bruno Courcelle. 1983. Fundamental Properties of Infinite Trees. Theor. Comput. Sci., 25 (1983), 95–169. https://doi.org/10.1016/0304-3975(83)90059-2 Google Scholar
Cross Ref
- Francesco Dagnino. 2019. Coaxioms: flexible coinductive definitions by inference systems. Log. Methods Comput. Sci., 15, 1 (2019), https://doi.org/10.23638/LMCS-15(1:26)2019 Google Scholar
Cross Ref
- Ornela Dardha and Simon J. Gay. 2018. A New Linear Logic for Deadlock-Free Session-Typed Processes. In Foundations of Software Science and Computation Structures - 21st International Conference, FOSSACS 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Thessaloniki, Greece, April 14-20, 2018, Proceedings, Christel Baier and Ugo Dal Lago (Eds.) (Lecture Notes in Computer Science, Vol. 10803). Springer, 91–109. https://doi.org/10.1007/978-3-319-89366-2_5 Google Scholar
- Ornela Dardha, Elena Giachino, and Davide Sangiorgi. 2017. Session types revisited. Inf. Comput., 256 (2017), 253–286. https://doi.org/10.1016/j.ic.2017.06.002 Google Scholar
Digital Library
- Ornela Dardha and Jorge A. Pérez. 2015. Comparing Deadlock-Free Session Typed Processes. In Proceedings of the Combined 22th International Workshop on Expressiveness in Concurrency and 12th Workshop on Structural Operational Semantics, EXPRESS/SOS 2015, Madrid, Spain, 31st August 2015, Silvia Crafa and Daniel Gebler (Eds.) (EPTCS, Vol. 190). 1–15. https://doi.org/10.4204/EPTCS.190.1 Google Scholar
Cross Ref
- Romain Demangeon, Daniel Hirschkoff, and Davide Sangiorgi. 2009. Mobile Processes and Termination. In Semantics and Algebraic Specification, Essays Dedicated to Peter D. Mosses on the Occasion of His 60th Birthday, Jens Palsberg (Ed.) (Lecture Notes in Computer Science, Vol. 5700). Springer, 250–273. https://doi.org/10.1007/978-3-642-04164-8_13 Google Scholar
Cross Ref
- Yuxin Deng and Davide Sangiorgi. 2006. Ensuring termination by typability. Inf. Comput., 204, 7 (2006), 1045–1082. https://doi.org/10.1016/j.ic.2006.03.002 Google Scholar
Digital Library
- Amina Doumane. 2017. On the infinitary proof theory of logics with fixed points. (Théorie de la démonstration infinitaire pour les logiques à points fixes). Ph. D. Dissertation. Paris Diderot University, France. https://tel.archives-ouvertes.fr/tel-01676953Google Scholar
- Sebastian Erdweg, Oliver Bracevac, Edlira Kuci, Matthias Krebs, and Mira Mezini. 2015. A co-contextual formulation of type rules and its application to incremental type checking. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, Jonathan Aldrich and Patrick Eugster (Eds.). ACM, 880–897. https://doi.org/10.1145/2814270.2814277 Google Scholar
Digital Library
- Nissim Francez. 1986. Fairness. Springer. isbn:978-3-540-96235-9 https://doi.org/10.1007/978-1-4612-4886-6 Google Scholar
Cross Ref
- Pierre Ganty, Rupak Majumdar, and Andrey Rybalchenko. 2009. Verifying liveness for asynchronous programs. In Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2009, Savannah, GA, USA, January 21-23, 2009, Zhong Shao and Benjamin C. Pierce (Eds.). ACM, 102–113. https://doi.org/10.1145/1480881.1480895 Google Scholar
Digital Library
- Simon J. Gay. 2016. Subtyping Supports Safe Session Substitution. In A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday, Sam Lindley, Conor McBride, Philip W. Trinder, and Donald Sannella (Eds.) (Lecture Notes in Computer Science, Vol. 9600). Springer, 95–108. https://doi.org/10.1007/978-3-319-30936-1_5 Google Scholar
Cross Ref
- Simon J. Gay and Malcolm Hole. 2005. Subtyping for session types in the pi calculus. Acta Informatica, 42, 2-3 (2005), 191–225. https://doi.org/10.1007/s00236-005-0177-z Google Scholar
Digital Library
- Simon J. Gay and Vasco Thudichum Vasconcelos. 2010. Linear type theory for asynchronous session types. J. Funct. Program., 20, 1 (2010), 19–50. https://doi.org/10.1017/S0956796809990268 Google Scholar
Digital Library
- Orna Grumberg, Nissim Francez, and Shmuel Katz. 1984. Fair Termination of Communicating Processes. In Proceedings of the Third Annual ACM Symposium on Principles of Distributed Computing (PODC ’84). Association for Computing Machinery, New York, NY, USA. 254–265. isbn:0897911431 https://doi.org/10.1145/800222.806752 Google Scholar
Digital Library
- Kohei Honda. 1993. Types for Dyadic Interaction. In CONCUR ’93, 4th International Conference on Concurrency Theory, Hildesheim, Germany, August 23-26, 1993, Proceedings, Eike Best (Ed.) (Lecture Notes in Computer Science, Vol. 715). Springer, 509–523. https://doi.org/10.1007/3-540-57208-2_35 Google Scholar
Cross Ref
- Kohei Honda, Vasco Thudichum Vasconcelos, and Makoto Kubo. 1998. Language Primitives and Type Discipline for Structured Communication-Based Programming. In Programming Languages and Systems - ESOP’98, 7th European Symposium on Programming, Held as Part of the European Joint Conferences on the Theory and Practice of Software, ETAPS’98, Lisbon, Portugal, March 28 - April 4, 1998, Proceedings, Chris Hankin (Ed.) (Lecture Notes in Computer Science, Vol. 1381). Springer, 122–138. https://doi.org/10.1007/BFb0053567 Google Scholar
Cross Ref
- Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2008. Multiparty asynchronous session types. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, San Francisco, California, USA, January 7-12, 2008, George C. Necula and Philip Wadler (Eds.). ACM, 273–284. https://doi.org/10.1145/1328438.1328472 Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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. 2016. Foundations of Session Types and Behavioural Contracts. ACM Comput. Surv., 49, 1 (2016), 3:1–3:36. https://doi.org/10.1145/2873052 Google Scholar
Digital Library
- Naoki Kobayashi. 2002. A Type System for Lock-Free Processes. Inf. Comput., 177, 2 (2002), 122–159. https://doi.org/10.1006/inco.2002.3171 Google Scholar
Cross Ref
- Naoki Kobayashi. 2006. A New Type System for Deadlock-Free Processes. In CONCUR 2006 - Concurrency Theory, 17th International Conference, CONCUR 2006, Bonn, Germany, August 27-30, 2006, Proceedings, Christel Baier and Holger Hermanns (Eds.) (Lecture Notes in Computer Science, Vol. 4137). Springer, 233–247. https://doi.org/10.1007/11817949_16 Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Naoki Kobayashi and Davide Sangiorgi. 2010. A hybrid type system for lock-freedom of mobile processes. ACM Trans. Program. Lang. Syst., 32, 5 (2010), 16:1–16:49. https://doi.org/10.1145/1745312.1745313 Google Scholar
Digital Library
- M.Z. Kwiatkowska. 1989. Survey of fairness notions. Information and Software Technology, 31, 7 (1989), 371–386. issn:0950-5849 https://doi.org/10.1016/0950-5849(89)90159-6 Google Scholar
Digital Library
- Leslie Lamport. 2000. Fairness and hyperfairness. Distributed Comput., 13, 4 (2000), 239–245. https://doi.org/10.1007/PL00008921 Google Scholar
Digital Library
- Sam Lindley and J. Garrett Morris. 2016. Talking bananas: structural recursion for session types. In Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, ICFP 2016, Nara, Japan, September 18-22, 2016, Jacques Garrigue, Gabriele Keller, and Eijiro Sumii (Eds.). ACM, 434–447. https://doi.org/10.1145/2951913.2951921 Google Scholar
Digital Library
- Barbara Liskov and Jeannette M. Wing. 1994. A Behavioral Notion of Subtyping. ACM Trans. Program. Lang. Syst., 16, 6 (1994), 1811–1841. https://doi.org/10.1145/197320.197383 Google Scholar
Digital Library
- V. Natarajan and Rance Cleaveland. 1995. Divergence and Fair Testing. In Automata, Languages and Programming, 22nd International Colloquium, ICALP95, Szeged, Hungary, July 10-14, 1995, Proceedings, Zoltán Fülöp and Ferenc Gécseg (Eds.) (Lecture Notes in Computer Science, Vol. 944). Springer, 648–659. https://doi.org/10.1007/3-540-60084-1_112 Google Scholar
Cross Ref
- Susan S. Owicki and Leslie Lamport. 1982. Proving Liveness Properties of Concurrent Programs. ACM Trans. Program. Lang. Syst., 4, 3 (1982), 455–495. https://doi.org/10.1145/357172.357178 Google Scholar
Digital Library
- Luca Padovani. 2013. Fair Subtyping for Open Session Types. In Automata, Languages, and Programming - 40th International Colloquium, ICALP 2013, Riga, Latvia, July 8-12, 2013, Proceedings, Part II, Fedor V. Fomin, Rusins Freivalds, Marta Z. Kwiatkowska, and David Peleg (Eds.) (Lecture Notes in Computer Science, Vol. 7966). Springer, 373–384. https://doi.org/10.1007/978-3-642-39212-2_34 Google Scholar
Digital Library
- Luca Padovani. 2014. Deadlock and lock freedom in the linear π -calculus. In Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), CSL-LICS ’14, Vienna, Austria, July 14 - 18, 2014, Thomas A. Henzinger and Dale Miller (Eds.). ACM, 72:1–72:10. https://doi.org/10.1145/2603088.2603116 Google Scholar
Digital Library
- Luca Padovani. 2016. Fair subtyping for multi-party session types. Math. Struct. Comput. Sci., 26, 3 (2016), 424–464. https://doi.org/10.1017/S096012951400022X Google Scholar
Cross Ref
- Luca Padovani, Vasco Thudichum Vasconcelos, and Hugo Torres Vieira. 2014. Typing Liveness in Multiparty Communicating Systems. In Coordination Models and Languages - 16th IFIP WG 6.1 International Conference, COORDINATION 2014, Held as Part of the 9th International Federated Conferences on Distributed Computing Techniques, DisCoTec 2014, Berlin, Germany, June 3-5, 2014, Proceedings, eva Kühn and Rosario Pugliese (Eds.) (Lecture Notes in Computer Science, Vol. 8459). Springer, 147–162. https://doi.org/10.1007/978-3-662-43376-8_10 Google Scholar
Digital Library
- Arend Rensink and Walter Vogler. 2007. Fair testing. Inf. Comput., 205, 2 (2007), 125–198. https://doi.org/10.1016/j.ic.2006.06.002 Google Scholar
Digital Library
- Alceste Scalas and Nobuko Yoshida. 2019. Less is more: multiparty session types revisited. Proc. ACM Program. Lang., 3, POPL (2019), 30:1–30:29. https://doi.org/10.1145/3290343 Google Scholar
Digital Library
- Joseph Tassarotti, Ralf Jung, and Robert Harper. 2017. A Higher-Order Logic for Concurrent Termination-Preserving Refinement. In Programming Languages and Systems - 26th European Symposium on Programming, ESOP 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings, Hongseok Yang (Ed.) (Lecture Notes in Computer Science, Vol. 10201). Springer, 909–936. https://doi.org/10.1007/978-3-662-54434-1_34 Google Scholar
Digital Library
- Rob van Glabbeek. 2019. Justness - A Completeness Criterion for Capturing Liveness Properties (Extended Abstract). In Foundations of Software Science and Computation Structures - 22nd International Conference, FOSSACS 2019, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019, Prague, Czech Republic, April 6-11, 2019, Proceedings, Mikolaj Bojanczyk and Alex Simpson (Eds.) (Lecture Notes in Computer Science, Vol. 11425). Springer, 505–522. https://doi.org/10.1007/978-3-030-17127-8_29 Google Scholar
Cross Ref
- Rob van Glabbeek and Peter Höfner. 2019. Progress, Justness, and Fairness. ACM Comput. Surv., 52, 4 (2019), 69:1–69:38. https://doi.org/10.1145/3329125 Google Scholar
Digital Library
- Rob van Glabbeek, Peter Höfner, and Ross Horne. 2021. Assuming Just Enough Fairness to make Session Types Complete for Lock-freedom. In 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2021, Rome, Italy, June 29 - July 2, 2021. IEEE, 1–13. https://doi.org/10.1109/LICS52264.2021.9470531 Google Scholar
Digital Library
- Philip Wadler. 2014. Propositions as sessions. J. Funct. Program., 24, 2-3 (2014), 384–418. https://doi.org/10.1017/S095679681400001X Google Scholar
Cross Ref
- Nobuko Yoshida, Martin Berger, and Kohei Honda. 2004. Strong normalisation in the pi -calculus. Inf. Comput., 191, 2 (2004), 145–202. https://doi.org/10.1016/j.ic.2003.08.004 Google Scholar
Digital Library
Index Terms
Fair termination of binary sessions
Recommendations
A polymorphic type system with progress for binary sessions
WISM'12: Proceedings of the 2012 international conference on Web Information Systems and MiningA static bounded polymorphic type system is presented in this paper, which ensures the progress property, i.e., the property that once a communication has been established, well-formed programs will never starve at communication points. The introduction ...
A decentralized analysis of multiparty protocols
AbstractProtocols provide the unifying glue in concurrent and distributed software today; verifying that message-passing programs conform to such governing protocols is important but difficult. Static approaches based on multiparty session ...
Highlights- A new analysis of multiparty protocols expressed as Multiparty Session Types (MPST).
On action permutation and progress for partially commutative asynchronous binary sessions
IDCS'12: Proceedings of the 5th international conference on Internet and Distributed Computing SystemsA theory of asynchronous binary sessions is generalized by asynchronous communication subtyping, which actually permutates and optimizes the actions on each participant. With the types of messages distinguished between dependent and independent types, a ...






Comments