Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Propositions-as-types and shared state

Published: 19 August 2021 Publication History

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.

Supplementary Material

Auxiliary Presentation Video (icfp21main-p97-p-video.mp4)
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.
MP4 File (3473584.mp4)
Presentation Videos

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

Cited By

View all
  • (2024)Message-Observing SessionsProceedings of the ACM on Programming Languages10.1145/36498598:OOPSLA1(1351-1379)Online publication date: 29-Apr-2024
  • (2024)Deadlock-Free Separation Logic: Linearity Yields Progress for Dependent Higher-Order Message PassingProceedings of the ACM on Programming Languages10.1145/36328898:POPL(1385-1417)Online publication date: 5-Jan-2024
  • (2024)Non-Linear Communication via Graded Modal Session TypesInformation and Computation10.1016/j.ic.2024.105234(105234)Online publication date: Nov-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 5, Issue ICFP
August 2021
1011 pages
EISSN:2475-1421
DOI:10.1145/3482883
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 August 2021
Published in PACMPL Volume 5, Issue ICFP

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Propositions-as-Types
  2. Session Types
  3. Shared State

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)140
  • Downloads (Last 6 weeks)17
Reflects downloads up to 09 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Message-Observing SessionsProceedings of the ACM on Programming Languages10.1145/36498598:OOPSLA1(1351-1379)Online publication date: 29-Apr-2024
  • (2024)Deadlock-Free Separation Logic: Linearity Yields Progress for Dependent Higher-Order Message PassingProceedings of the ACM on Programming Languages10.1145/36328898:POPL(1385-1417)Online publication date: 5-Jan-2024
  • (2024)Non-Linear Communication via Graded Modal Session TypesInformation and Computation10.1016/j.ic.2024.105234(105234)Online publication date: Nov-2024
  • (2023)Mechanizing Session-Types using a Structural View: Enforcing Linearity without LinearityProceedings of the ACM on Programming Languages10.1145/36228107:OOPSLA2(374-399)Online publication date: 16-Oct-2023
  • (2023)Higher-Order Leak and Deadlock Free LocksProceedings of the ACM on Programming Languages10.1145/35712297:POPL(1027-1057)Online publication date: 11-Jan-2023
  • (2023)Safe Session-Based Concurrency with Shared Linear StateProgramming Languages and Systems10.1007/978-3-031-30044-8_16(421-450)Online publication date: 22-Apr-2023
  • (2022)Connectivity graphs: a method for proving deadlock freedom based on separation logicProceedings of the ACM on Programming Languages10.1145/34986626:POPL(1-33)Online publication date: 12-Jan-2022
  • (2022)Polymorphic lambda calculus with context-free session typesInformation and Computation10.1016/j.ic.2022.104948289(104948)Online publication date: Nov-2022
  • (2021)Client-server sessions in linear logicProceedings of the ACM on Programming Languages10.1145/34735675:ICFP(1-31)Online publication date: 19-Aug-2021

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media