Published June 15, 2021 | Version 1
Conference paper Open

π with leftovers: a mechanisation in Agda

  • 1. University of Glasgow

Description

Linear type systems need to keep track of how programs use their resources. The standard approach is to use context splits specifying how resources are (disjointly) split across subterms. In this approach, context splits redundantly echo information which is already present within subterms. An alternative approach is to use leftover typing, where in addition to the usual (input) usage context, typing judgments have also an output usage context: the leftovers. In this approach, the leftovers of one typing derivation are fed as input to the next, threading through linear resources while avoiding context splits. We use leftover typing to de ne a type system for a resource-aware pi-calculus, a process algebra used to model concurrent systems. Our type system is parametrised over a set of usage algebras that are general enough to encompass shared types (free to reuse and discard), graded types (use exactly n number of times) and linear types (use exactly once). Linear types are important in the pi-calculus: they ensure privacy and safety of communication and avoid race conditions, while graded and shared types allow for more flexible programming. We provide a framing theorem for our type system, generalise the weakening and strengthening theorems to include linear types, and prove subject reduction. Our formalisation is fully mechanised in about 1850 lines of Agda.

Files

ZD21.pdf

Files (326.6 kB)

Name Size Download all
md5:646767d9b441aad4242fd6d15e500f59
326.6 kB Preview Download

Additional details

Funding

European Commission
BEHAPI - Behavioural Application Program Interfaces 778233