Abstract
We develop a principled integration of shared mutable state into a proposition-as-types linear logic interpretation of a session-based concurrent programming language. While the foundation of type systems for the functional core of programming languages often builds on the proposition-as-types correspondence, automatically ensuring strong safety and liveness properties, imperative features have mostly been handled by extra-logical constructions. Our system crucially builds on the integration of nondeterminism and sharing, inspired by logical rules of differential linear logic, and ensures session fidelity, progress, confluence and normalisation, while being able to handle first-class shareable reference cells storing any persistent object. We also show how preservation and, perhaps surprisingly, progress, resiliently survive in a natural extension of our language with first-class locks. We illustrate the expressiveness of our language with examples highlighting detailed features, up to simple shareable concurrent ADTs.
Supplemental Material
- Amal Ahmed, Matthew Fluet, and Greg Morrisett. 2007. L^3: A Linear Language with Locations. Fundam. Inf., 77, 4 (2007), Dec., 397–449. issn:0169-2968Google Scholar
Digital Library
- J-M. Andreoli. 1992. Logic Programming with Focusing Proofs in Linear Logic. J. Logic Comput., 2, 3 (1992), 197–347.Google Scholar
Cross Ref
- Robert Atkey, Sam Lindley, and J. Garrett Morris. 2016. Conflation Confers Concurrency. Springer International Publishing, Cham. 32–55. isbn:978-3-319-30936-1 https://doi.org/10.1007/978-3-319-30936-1_2 Google Scholar
Cross Ref
- Stephanie Balzer and Frank Pfenning. 2017. Manifest Sharing with Session Types. Proc. ACM Program. Lang., 1, ICFP (2017), Article 37, Aug., 29 pages. https://doi.org/10.1145/3110281 Google Scholar
Digital Library
- Stephanie Balzer, Bernardo Toninho, and Frank Pfenning. 2019. Manifest Deadlock-Freedom for Shared Session Types. In Programming Languages and Systems, Luís Caires (Ed.). Springer International Publishing, Cham. 611–639. isbn:978-3-030-17184-1Google Scholar
- Emmanuel Beffara. 2008. An Algebraic Process Calculus. In Proceedings of the 2008 23rd Annual IEEE Symposium on Logic in Computer Science (LICS ’08). IEEE Computer Society, USA. 130–141. isbn:9780769531830 https://doi.org/10.1109/LICS.2008.40 Google Scholar
Digital Library
- Michele Boreale. 1996. On the Expressiveness of Internal Mobility in Name-Passing Calculi. In Proceedings of the 7th International Conference on Concurrency Theory (CONCUR ’96). Springer-Verlag, Berlin, Heidelberg. 163–178. isbn:3540616047Google Scholar
Cross Ref
- Luís Caires and Jorge A. Pérez. 2016. Multiparty Session Types Within a Canonical Binary Theory, and Beyond. In Formal Techniques for Distributed Objects, Components, and Systems, Elvira Albert and Ivan Lanese (Eds.). Springer International Publishing, Cham. 74–95. isbn:978-3-319-39570-8Google Scholar
- Luís Caires and Jorge A. Pérez. 2017. Linearity, Control Effects, and Behavioral Types. In Proceedings of the 26th European Symposium on Programming Languages and Systems - Volume 10201. Springer-Verlag, Berlin, Heidelberg. 229–259. isbn:9783662544334 https://doi.org/10.1007/978-3-662-54434-1_9 Google Scholar
Digital Library
- Luís Caires, Jorge A. Pérez, Frank Pfenning, and Bernardo Toninho. 2013. Behavioral Polymorphism and Parametricity in Session-Based Communication. In Proceedings of the 22nd European Conference on Programming Languages and Systems (ESOP’13). Springer-Verlag, Berlin, Heidelberg. 330–349. isbn:9783642370359 https://doi.org/10.1007/978-3-642-37036-6_19 Google Scholar
Digital Library
- Luís Caires and Frank Pfenning. 2010. Session Types as Intuitionistic Linear Propositions. In CONCUR 2010 - Concurrency Theory, Paul Gastin and François Laroussinie (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 222–236. isbn:978-3-642-15375-4Google Scholar
Cross Ref
- Luís Caires, Frank Pfenning, and Bernardo Toninho. 2012. Towards Concurrent Type Theory. In Proceedings of the 8th ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI ’12). Association for Computing Machinery, New York, NY, USA. 1–12. isbn:9781450311205 https://doi.org/10.1145/2103786.2103788 Google Scholar
Digital Library
- Luís Caires, Frank Pfenning, and Bernardo Toninho. 2016. Linear logic propositions as session types. Mathematical Structures in Computer Science, 26, 3 (2016), 367–423. https://doi.org/10.1017/S0960129514000218 Google Scholar
Cross Ref
- Luís Caires and João C. Seco. 2013. The Type Discipline of Behavioral Separation. In Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’13). Association for Computing Machinery, New York, NY, USA. 275–286. isbn:9781450318327 https://doi.org/10.1145/2429069.2429103 Google Scholar
Digital Library
- Marco Carbone, Sam Lindley, Fabrizio Montesi, Carsten Schürmann, and Philip Wadler. 2016. Coherence Generalises Duality: a logical explanation of multiparty session types. In 27 International Conference on Concurrency Theory (CONCUR’16). Québec City, Canada. https://hal.inria.fr/hal-01336600Google Scholar
- Luca Cardelli. 1991. Typeful Programming. IFIP State-of-the-Art Reports: Formal Description of Programming Concepts, 431–507.Google Scholar
- Luca Cardelli and Peter Wegner. 1985. On understanding types, data abstraction, and polymorphism. ACM Computing Surveys (CSUR), 17, 4 (1985), 471–523.Google Scholar
Digital Library
- David G. Clarke, John M. Potter, and James Noble. 1998. Ownership Types for Flexible Alias Protection. In Proceedings of the 13th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’98). Association for Computing Machinery, New York, NY, USA. 48–64. isbn:1581130058 https://doi.org/10.1145/286936.286947 Google Scholar
Digital Library
- Robert DeLine and Manuel Fähndrich. 2001. Enforcing High-Level Protocols in Low-Level Software. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation (PLDI ’01). Association for Computing Machinery, New York, NY, USA. 59–69. isbn:1581134142 https://doi.org/10.1145/378795.378811 Google Scholar
Digital Library
- Mariangiola Dezani-Ciancaglini, Ugo de’Liguoro, and Nobuko Yoshida. 2008. On Progress for Structured Communications. In Trustworthy Global Computing, Gilles Barthe and Cédric Fournet (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 257–275. isbn:978-3-540-78663-4Google Scholar
- Thomas Dinsdale-Young, Lars Birkedal, Philippa Gardner, Matthew Parkinson, and Hongseok Yang. 2013. Views: Compositional Reasoning for Concurrent Programs. In Proceedings of POPL (proceedings of popl ed.). https://www.microsoft.com/en-us/research/publication/views-compositional-reasoning-for-concurrent-programs/Google Scholar
Digital Library
- Thomas Ehrhard. 2018. An introduction to differential linear logic: proof-nets, models and antiderivatives. Mathematical Structures in Computer Science, 28, 7 (2018), 995–1060.Google Scholar
Cross Ref
- Thomas Ehrhard and Olivier Laurent. 2010. Interpreting a finitary pi-calculus in differential interaction nets. Inf. Comput., 208, 6 (2010), 606–633.Google Scholar
Digital Library
- Thomas Ehrhard and Laurent Regnier. 2003. The differential lambda-calculus. Theoretical Computer Science, 309, 1-3 (2003), 1–41.Google Scholar
Digital Library
- Thomas Ehrhard and Laurent Regnier. 2006. Differential Interaction Nets. Theor. Comput. Sci., 364, 2 (2006), 166–195.Google Scholar
Digital Library
- Matthias Felleisen and Daniel P. Friedman. 1989. A Syntactic Theory of Sequential State. Theor. Comput. Sci., 69, 3 (1989), 243–287.Google Scholar
Digital Library
- Jean-Yves Girard, Paul Taylor, and Yves Lafont. 1989. Proofs and Types. Cambridge University Press, USA. isbn:0521371813Google Scholar
- Matthew Hennessy and Robin Milner. 1985. Algebraic Laws for Nondeterminism and Concurrency. J. ACM, 32, 1 (1985), 137–161.Google Scholar
Digital Library
- Joshua S Hodas and Dale Miller. 1994. Logic programming in a fragment of intuitionistic linear logic. Information and computation, 110, 2 (1994), 327–365.Google Scholar
- Kohei Honda. 1993. Types for dyadic interaction. In CONCUR’93, Eike Best (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 509–523. isbn:978-3-540-47968-0Google Scholar
- Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. 1998. Language primitives and type discipline for structured communication-based programming. In Programming Languages and Systems, Chris Hankin (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 122–138. isbn:978-3-540-69722-0Google Scholar
- W. A. Howard. 1980. The formulae-as-types notion of construction. In To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, J. P. Seldin and J. R. Hindley (Eds.). Academic Press, 479–490.Google Scholar
- Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2018. RustBelt: securing the foundations of the rust programming language. Proc. ACM Program. Lang., 2 (2018), 66:1–66:34.Google Scholar
Digital Library
- Ralf Jung, Robbert Krebbers, Jacques-Henri Jourdan, Ales Bizjak, Lars Birkedal, and Derek Dreyer. 2018. Iris from the ground up: A modular foundation for higher-order concurrent separation logic. Journal of Functional Programming, 28 (2018), e20. https://doi.org/10.1017/S0956796818000151 Google Scholar
Cross Ref
- Wen Kokke, J. Garrett Morris, and Philip Wadler. 2019. Towards Races in Linear Logic. In Coordination Models and Languages, Hanne Riis Nielson and Emilio Tuosto (Eds.). Springer International Publishing, Cham. 37–53. isbn:978-3-030-22397-7Google Scholar
- Neelakantan R. Krishnaswami, Aaron Turon, Derek Dreyer, and Deepak Garg. 2012. Superficially Substructural Types. In Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming (ICFP ’12). Association for Computing Machinery, New York, NY, USA. 41–54. isbn:9781450310543 https://doi.org/10.1145/2364527.2364536 Google Scholar
Digital Library
- Nancy A. Lynch. 1980. Fast Allocation of Nearby Resources in a Distributed System. In Proceedings of the Twelfth Annual ACM Symposium on Theory of Computing (STOC ’80). Association for Computing Machinery, New York, NY, USA. 70–81. isbn:0897910176 https://doi.org/10.1145/800141.804654 Google Scholar
Digital Library
- Nicholas D. Matsakis and Felix S. Klock. 2014. The Rust Language. In Proceedings of the 2014 ACM SIGAda Annual Conference on High Integrity Language Technology (HILT ’14). Association for Computing Machinery, New York, NY, USA. 103–104. isbn:9781450332170 https://doi.org/10.1145/2663171.2663188 Google Scholar
Digital Library
- Filipe Militão, Jonathan Aldrich, and Luís Caires. 2016. Composing Interfering Abstract Protocols. In 30th European Conference on Object-Oriented Programming, ECOOP 2016, July 18-22, 2016, Rome, Italy, Shriram Krishnamurthi and Benjamin S. Lerner (Eds.) (LIPIcs, Vol. 56). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 16:1–16:26. https://doi.org/10.4230/LIPIcs.ECOOP.2016.16 Google Scholar
Cross Ref
- John C Mitchell and Gordon D Plotkin. 1988. Abstract types have existential type. ACM Transactions on Programming Languages and Systems (TOPLAS), 10, 3 (1988), 470–502.Google Scholar
Digital Library
- Aleksandar Nanevski, J. Gregory Morrisett, and Lars Birkedal. 2008. Hoare type theory, polymorphism and separation. J. Funct. Program., 18, 5-6 (2008), 865–911.Google Scholar
Digital Library
- Peter W. O’Hearn and John C. Reynolds. 2000. From Algol to polymorphic linear lambda-calculus. J. ACM, 47, 1 (2000), 167–223.Google Scholar
Digital Library
- Chris Okasaki. 1998. Purely Functional Data Structures. Cambridge University Press. https://doi.org/10.1017/CBO9780511530104 Google Scholar
Cross Ref
- Michele Pagani and Paolo Tranquilli. 2009. Parallel Reduction in Resource Lambda-Calculus. In Programming Languages and Systems, Zhenjiang Hu (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 226–242. isbn:978-3-642-10672-9Google Scholar
- Jorge A. Pérez, Luís Caires, Frank Pfenning, and Bernardo Toninho. 2012. Linear Logical Relations for Session-Based Concurrency. In Programming Languages and Systems, Helmut Seidl (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 539–558. isbn:978-3-642-28869-2Google Scholar
- Simon L. Peyton Jones and Philip Wadler. 1993. Imperative Functional Programming. In Proceedings of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’93). Association for Computing Machinery, New York, NY, USA. 71–84. isbn:0897915607 https://doi.org/10.1145/158511.158524 Google Scholar
Digital Library
- Frank Pfenning. 1995. Structural Cut Elimination. In Proceedings of the 10th Annual IEEE Symposium on Logic in Computer Science (LICS ’95). IEEE Computer Society, USA. 156. isbn:0818670506Google Scholar
Digital Library
- Frank Pfenning and Dennis Griffith. 2015. Polarized Substructural Session Types. In Foundations of Software Science and Computation Structures, Andrew Pitts (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 3–22. isbn:978-3-662-46678-0Google Scholar
- Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press. isbn:0262162091Google Scholar
- Gordon D. Plotkin. 1976. A Powerdomain Construction. SIAM J. Comput., 5, 3 (1976), 452–487.Google Scholar
Digital Library
- Zesen Qian, G. A. Kavvos, and Lars Birkedal. 2021. Client-Server Sessions in Linear Logic. 5, ICFP (2021), Article 62, Aug., https://doi.org/10.1145/3473567Google Scholar
Digital Library
- Pedro Rocha and Luís Caires. 2021. A Propositions-as-Types System for Shared State. NOVA Laboratory for Computer Science and Informatics. http://ctp.di.fct.unl.pt/~lcaires/papers/PTSStech-report2021.pdfGoogle Scholar
- Pedro Rocha and Luís Caires. 2021. Propositions-as-Types and Shared State (Artifact). May, https://doi.org/10.5281/zenodo.5037493 Google Scholar
Digital Library
- Davide Sangiorgi. 1999. The Name Discipline of Uniform Receptiveness. Theor. Comput. Sci., 221, 1-2 (1999), 457–493.Google Scholar
Digital Library
- Davide Sangiorgi and David Walker. 2001. PI-Calculus: A Theory of Mobile Processes. Cambridge University Press, USA. isbn:0521781779Google Scholar
- Joshua Sunshine, Karl Naden, Sven Stork, Jonathan Aldrich, and Éric Tanter. 2011. First-Class State Change in Plaid. In Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA ’11). Association for Computing Machinery, New York, NY, USA. 713–732. isbn:9781450309400 https://doi.org/10.1145/2048066.2048122 Google Scholar
Digital Library
- Bernardo Toninho, Luís Caires, and Frank Pfenning. 2011. Dependent Session Types via Intuitionistic Linear Type Theory. In Proceedings of the 13th International ACM SIGPLAN Symposium on Principles and Practices of Declarative Programming (PPDP ’11). Association for Computing Machinery, New York, NY, USA. 161–172. isbn:9781450307765 https://doi.org/10.1145/2003476.2003499 Google Scholar
Digital Library
- Bernardo Toninho, Luis Caires, and Frank Pfenning. 2013. Higher-Order Processes, Functions, and Sessions: A Monadic Integration. In Programming Languages and Systems, Matthias Felleisen and Philippa Gardner (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 350–369. isbn:978-3-642-37036-6Google Scholar
- Bernardo Toninho and Nobuko Yoshida. 2021. On Polymorphic Sessions and Functions: A Tale of Two (Fully Abstract) Encodings. ACM Trans. Program. Lang. Syst., 43, 2 (2021), Article 7, June, 55 pages. issn:0164-0925 https://doi.org/10.1145/3457884 Google Scholar
Digital Library
- Philip Wadler. 1990. Linear Types can Change the World!. In Proceedings of the IFIP Working Group 2.2, 2.3 Working Conference on Programming Concepts and Methods, 1990, Manfred Broy (Ed.). North-Holland, 561.Google Scholar
- Philip Wadler. 1990. Recursive types for free.Google Scholar
- Philip Wadler. 2012. Propositions as Sessions. In Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming (ICFP ’12). Association for Computing Machinery, New York, NY, USA. 273–286. isbn:9781450310543 https://doi.org/10.1145/2364527.2364568 Google Scholar
Digital Library
- Philip Wadler. 2015. Propositions as types. Commun. ACM, 58, 12 (2015), 75–84.Google Scholar
Digital Library
Index Terms
Propositions-as-types and shared state
Recommendations
Propositions as [Types]
Image factorizations in regular categories are stable under pullbacks, so they model a natural modal operator in dependent type theory. This unary type constructor [A] has turned up previously in a syntactic form as a way of erasing computational ...
Haskell session types with (almost) no class
HASKELL '08We describe an implementation of session types in Haskell. Session types statically enforce that client-server communication proceeds according to protocols. They have been added to several concurrent calculi, but few implementations of session types ...
Session types revisited
Session types are a formalism used to model structured communication-based programming. A binary session type describes communication by specifying the type and direction of data exchanged between two parties. When session types and session processes ...






Comments