Deadlock-free Context-free Session Types
For developers of concurrent message-passing programs, this work provides a static guarantee of deadlock freedom in a more expressive type system than previously possible.
The paper proposes a type system for context-free session types that ensures both protocol conformance and deadlock freedom in concurrent functional programs, including those with cyclic communication topologies, recursion, and polymorphism. The approach extends priority-based deadlock freedom to this expressive setting and is proven to prevent deadlocks.
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.