Propositions-as-types and shared state

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.

[1]  Nicholas D. Matsakis,et al.  The rust language , 2014, HILT '14.

[2]  Thomas Ehrhard,et al.  Differential Interaction Nets , 2005, WoLLIC.

[3]  Bernardo Toninho,et al.  On Polymorphic Sessions and Functions: A Tale of Two (Fully Abstract) Encodings , 2018, ESOP.

[4]  Chris Okasaki,et al.  Purely functional data structures , 1998 .

[5]  Frank Pfenning Foundations of Software Science and Computation Structures , 2013, Lecture Notes in Computer Science.

[6]  Derek Dreyer,et al.  Superficially substructural types , 2012, ICFP '12.

[7]  J. Roger Hindley,et al.  To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism , 1980 .

[8]  Bernardo Toninho,et al.  Higher-Order Processes, Functions, and Sessions: A Monadic Integration , 2013, ESOP.

[9]  YoshidaNobuko,et al.  On Polymorphic Sessions and Functions: A Tale of Two (Fully Abstract) Encodings , 2021 .

[10]  Frank Pfenning,et al.  Manifest sharing with session types , 2017, Proc. ACM Program. Lang..

[11]  Gordon D. Plotkin,et al.  A Powerdomain Construction , 1976, SIAM J. Comput..

[12]  Philip Wadler,et al.  Towards Races in Linear Logic , 2019, COORDINATION.

[13]  Emmanuel Beffara An Algebraic Process Calculus , 2008, 2008 23rd Annual IEEE Symposium on Logic in Computer Science.

[14]  Thomas Ehrhard,et al.  An introduction to differential linear logic: proof-nets, models and antiderivatives , 2016, Mathematical Structures in Computer Science.

[15]  Nancy A. Lynch,et al.  Fast allocation of nearby resources in a distributed system , 1980, STOC '80.

[16]  Philip Wadler,et al.  Coherence Generalises Duality: A Logical Explanation of Multiparty Session Types , 2016, CONCUR.

[17]  Luís Caires,et al.  Linearity, Control Effects, and Behavioral Types , 2017, ESOP.

[18]  Bernardo Toninho,et al.  Dependent session types via intuitionistic linear type theory , 2011, PPDP.

[19]  Vasco Thudichum Vasconcelos,et al.  Language Primitives and Type Discipline for Structured Communication-Based Programming Revisited: Two Systems for Higher-Order Session Communication , 1998, SecReT@ICALP.

[20]  Kohei Honda,et al.  Types for Dyadic Interaction , 1993, CONCUR.

[21]  Frank Pfenning,et al.  Session Types as Intuitionistic Linear Propositions , 2010, CONCUR.

[22]  Bernardo Toninho,et al.  Behavioral Polymorphism and Parametricity in Session-Based Communication , 2013, ESOP.

[23]  Robert Atkey,et al.  Conflation Confers Concurrency , 2016, A List of Successes That Can Change the World.

[24]  Robin Milner,et al.  Algebraic laws for nondeterminism and concurrency , 1985, JACM.

[25]  Frank Pfenning,et al.  Structural cut elimination , 1995, Proceedings of Tenth Annual IEEE Symposium on Logic in Computer Science.

[26]  Peter W. O'Hearn,et al.  From Algol to polymorphic linear lambda-calculus , 2000, JACM.

[27]  Thomas Ehrhard,et al.  Interpreting a finitary pi-calculus in differential interaction nets , 2007, Inf. Comput..

[28]  Derek Dreyer,et al.  RustBelt: securing the foundations of the rust programming language , 2017, Proc. ACM Program. Lang..

[29]  Luís Caires,et al.  Multiparty Session Types Within a Canonical Binary Theory, and Beyond , 2016, FORTE.

[30]  Philip Wadler,et al.  Propositions as types , 2015, Commun. ACM.

[31]  Bernardo Toninho,et al.  Linear logic propositions as session types , 2016, Math. Struct. Comput. Sci..

[32]  Simon L. Peyton Jones,et al.  Imperative functional programming , 1993, POPL '93.

[33]  Bernardo Toninho,et al.  Linear Logical Relations for Session-Based Concurrency , 2012, ESOP.

[34]  J. Gregory Morrisett,et al.  L3: A Linear Language with Locations , 2007, Fundam. Informaticae.

[35]  Matthias Felleisen,et al.  A Syntactic Theory of Sequential State , 1989, Theor. Comput. Sci..

[36]  J. Girard,et al.  Proofs and types , 1989 .

[37]  Frank Pfenning,et al.  Polarized Substructural Session Types , 2015, FoSSaCS.

[38]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[39]  Mariangiola Dezani-Ciancaglini,et al.  On Progress for Structured Communications , 2007, TGC.

[40]  James Noble,et al.  Ownership types for flexible alias protection , 1998, OOPSLA '98.

[41]  Lars Birkedal,et al.  Iris from the ground up: A modular foundation for higher-order concurrent separation logic , 2018, Journal of Functional Programming.

[42]  Uday S. Reddy,et al.  Imperative functional programming , 1996, CSUR.

[43]  Lars Birkedal,et al.  Hoare type theory, polymorphism and separation1 , 2008, Journal of Functional Programming.

[44]  JEAN-MARC ANDREOLI,et al.  Logic Programming with Focusing Proofs in Linear Logic , 1992, J. Log. Comput..

[45]  Davide Sangiorgi The Name Discipline of Uniform Receptiveness , 1999, Theor. Comput. Sci..

[46]  John C. Mitchell,et al.  Abstract types have existential type , 1988, TOPL.

[47]  Laurent Regnier,et al.  The differential lambda-calculus , 2003, Theor. Comput. Sci..

[48]  William A. Howard,et al.  The formulae-as-types notion of construction , 1969 .

[49]  Michele Pagani,et al.  Parallel Reduction in Resource Lambda-Calculus , 2009, APLAS.

[50]  Philip Wadler Propositions as sessions , 2012, ICFP '12.

[51]  Bernardo Toninho,et al.  Towards concurrent type theory , 2012, TLDI '12.

[52]  Bernardo Toninho,et al.  Manifest Deadlock-Freedom for Shared Session Types , 2019, ESOP.

[53]  João Costa Seco,et al.  The type discipline of behavioral separation , 2013, POPL.

[54]  Dale Miller,et al.  Logic Programming in a Fragment of Intuitionistic Linear Logic , 1994, Inf. Comput..

[55]  Michele Boreale,et al.  On the Expressiveness of Internal Mobility in Name-Passing Calculi , 1996, Theor. Comput. Sci..

[56]  Hongseok Yang,et al.  Views: compositional reasoning for concurrent programs , 2013, POPL.

[57]  Éric Tanter,et al.  First-class state change in plaid , 2011, OOPSLA '11.

[58]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[59]  Jonathan Aldrich,et al.  Composing Interfering Abstract Protocols , 2016, ECOOP.

[60]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.