Deadlock-free Context-free Session Types
Andreia Mordido, Jorge A. Pérez
TL;DR
The paper addresses deadlocks in statically verifiable, message-passing programs governed by context-free session types, extending CFSTs with a priority-based deadlock-freedom mechanism. It integrates polymorphism over priorities and non-regular recursion, enabling cycling networks like Milner's scheduler and tree-structured protocols while preserving type safety. The authors prove type preservation and deadlock-freedom, and demonstrate the approach via Milner's scheduler and tree-exchange examples, aided by an external priority oracle. It advances practical verification by aligning with the FreeST language and outlining paths to automation and compiler integration.
Abstract
We tackle the problem of statically ensuring that message-passing programs never run into deadlocks. We focus on concurrent functional programs governed by context-free session types, which can express rich tree-like structures not expressible in standard session types. We propose a new type system based on context-free session types: it enforces both protocol conformance and deadlock freedom, also for programs implementing cyclic communication topologies with recursion and polymorphism. We show how the priority-based approach to deadlock freedom can be extended to this expressive setting. We prove that well-typed concurrent programs respect their protocols and never deadlock.
