skip to main content

Propositions-as-types and shared state

Published:19 August 2021Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

3473584.mp4

Presentation Videos

Auxiliary Presentation Video

This is a presentation video of the talk at ICFP 2021 on our paper accepted in the research track. 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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. J-M. Andreoli. 1992. Logic Programming with Focusing Proofs in Linear Logic. J. Logic Comput., 2, 3 (1992), 197–347.Google ScholarGoogle ScholarCross RefCross Ref
  3. 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 ScholarGoogle ScholarCross RefCross Ref
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle Scholar
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarCross RefCross Ref
  8. 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 ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarCross RefCross Ref
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle Scholar
  16. Luca Cardelli. 1991. Typeful Programming. IFIP State-of-the-Art Reports: Formal Description of Programming Concepts, 431–507.Google ScholarGoogle Scholar
  17. Luca Cardelli and Peter Wegner. 1985. On understanding types, data abstraction, and polymorphism. ACM Computing Surveys (CSUR), 17, 4 (1985), 471–523.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle Scholar
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarCross RefCross Ref
  23. Thomas Ehrhard and Olivier Laurent. 2010. Interpreting a finitary pi-calculus in differential interaction nets. Inf. Comput., 208, 6 (2010), 606–633.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Thomas Ehrhard and Laurent Regnier. 2003. The differential lambda-calculus. Theoretical Computer Science, 309, 1-3 (2003), 1–41.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Thomas Ehrhard and Laurent Regnier. 2006. Differential Interaction Nets. Theor. Comput. Sci., 364, 2 (2006), 166–195.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Matthias Felleisen and Daniel P. Friedman. 1989. A Syntactic Theory of Sequential State. Theor. Comput. Sci., 69, 3 (1989), 243–287.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Jean-Yves Girard, Paul Taylor, and Yves Lafont. 1989. Proofs and Types. Cambridge University Press, USA. isbn:0521371813Google ScholarGoogle Scholar
  28. Matthew Hennessy and Robin Milner. 1985. Algebraic Laws for Nondeterminism and Concurrency. J. ACM, 32, 1 (1985), 137–161.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle Scholar
  30. 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 ScholarGoogle Scholar
  31. 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 ScholarGoogle Scholar
  32. 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 ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarCross RefCross Ref
  35. 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 ScholarGoogle Scholar
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarCross RefCross Ref
  40. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. Peter W. O’Hearn and John C. Reynolds. 2000. From Algol to polymorphic linear lambda-calculus. J. ACM, 47, 1 (2000), 167–223.Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Chris Okasaki. 1998. Purely Functional Data Structures. Cambridge University Press. https://doi.org/10.1017/CBO9780511530104 Google ScholarGoogle ScholarCross RefCross Ref
  44. 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 ScholarGoogle Scholar
  45. 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 ScholarGoogle Scholar
  46. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  47. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  48. 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 ScholarGoogle Scholar
  49. Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press. isbn:0262162091Google ScholarGoogle Scholar
  50. Gordon D. Plotkin. 1976. A Powerdomain Construction. SIAM J. Comput., 5, 3 (1976), 452–487.Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  52. 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 ScholarGoogle Scholar
  53. Pedro Rocha and Luís Caires. 2021. Propositions-as-Types and Shared State (Artifact). May, https://doi.org/10.5281/zenodo.5037493 Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Davide Sangiorgi. 1999. The Name Discipline of Uniform Receptiveness. Theor. Comput. Sci., 221, 1-2 (1999), 457–493.Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Davide Sangiorgi and David Walker. 2001. PI-Calculus: A Theory of Mobile Processes. Cambridge University Press, USA. isbn:0521781779Google ScholarGoogle Scholar
  56. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  57. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  58. 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 ScholarGoogle Scholar
  59. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  60. 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 ScholarGoogle Scholar
  61. Philip Wadler. 1990. Recursive types for free.Google ScholarGoogle Scholar
  62. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  63. Philip Wadler. 2015. Propositions as types. Commun. ACM, 58, 12 (2015), 75–84.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Propositions-as-types and shared state

          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
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!