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.

Highlights

  • 1 INTRODUCTION In this paper we introduce a propositions-as-types (PaT) approach to mutable state, defined as a conservative extension of the classical linear logic interpretation for session-typed processes [Caires et al 2016; Wadler 2012] with first-class shareable reference cells

  • While the design of type systems for the functional core of programming languages conveniently connects to the PaT correspondence [Cardelli 1991; Howard 1980; Wadler 2015]), which intrinsically ensures strong safety and liveness properties, the notion of mutable state seems to escape from the paradigm, notwithstanding the long identified deep connections between linear logic and stateful computation [Wadler 1990a], and recent advances such as [Balzer and Pfenning 2017]

  • Co-contraction enforces that processes P and Q may linearly interact at the shared reference x, but not on other linear objects - the linear context is handled multiplicatively. This condition is important for deadlock freedom, and related with the relevance of acyclicity for cut-elimination in linear logic proofs

Read more

Summary

INTRODUCTION

In this paper we introduce a propositions-as-types (PaT) approach to mutable state, defined as a conservative extension of the classical linear logic interpretation for session-typed processes [Caires et al 2016; Wadler 2012] with first-class shareable reference cells. Processes may concurrently invoke the same replicated server, the typing discipline induced by the promotion rule for !A ensures that the server behaviour is identical for each invocation (cf uniform receptiveness of shared names [Sangiorgi 1999]) In such a setting, the overall computation remains essentially łfunctional" [Toninho and Yoshida 2021], which is not surprising given the well known interpretations of linear logic as linear lambda calculi. Our typing rules for the imperative fragment are inspired by those for the exponentials and sum connectives of differential linear logic (DiLL) [Ehrhard 2018; Ehrhard and Regnier 2006], allowing us to internalise non-determinism equationally (an idea explored by Beffara in the context of process algebra [Beffara 2008]), allowing us to capture concurrent interactions on shared state equationally, by cut-reduction / proof simplification. 79:3 we illustrate how the inclusion of second-order quantifiers [Caires et al 2013; Wadler 2012] allows us to elegantly express concurrent and shareable stateful ADTs within our basic PaT framework

Overview
Contributions and Structure of the Paper
THE BASIC LANGUAGE πCLL
MUTABLE SHAREABLE ADTS
A Shared Stack
Subject Reduction for πSSL
CONFLUENCE
PROOF NORMALISATION AND CUT-ELIMINATION
TYPE CHECKER AND INTERPRETER
10 RELATED WORK
11 CONCLUDING REMARKS
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call