Superficially substructural types

  • Authors:
  • Neelakantan R. Krishnaswami;Aaron Turon;Derek Dreyer;Deepak Garg

  • Affiliations:
  • MPI-SWS, Saarbruecken, Germany;Northeastern University, Boston, USA;MPI-SWS, Saarbruecken, Germany;MPI-SWS, Saarbruecken, Germany

  • Venue:
  • Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many substructural type systems have been proposed for controlling access to shared state in higher-order languages. Central to these systems is the notion of a *resource*, which may be split into disjoint pieces that different parts of a program can manipulate independently without worrying about interfering with one another. Some systems support a *logical* notion of resource (such as permissions), under which two resources may be considered disjoint even if they govern the *same* piece of state. However, in nearly all existing systems, the notions of resource and disjointness are fixed at the outset, baked into the model of the language, and fairly coarse-grained in the kinds of sharing they enable. In this paper, inspired by recent work on "fictional disjointness" in separation logic, we propose a simple and flexible way of enabling any module in a program to create its own custom type of splittable resource (represented as a commutative monoid), thus providing fine-grained control over how the module's private state is shared with its clients. This functionality can be incorporated into an otherwise standard substructural type system by means of a new typing rule we call *the sharing rule*, whose soundness we prove semantically via a novel resource-oriented Kripke logical relation.