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.
翻译:我们解决了静态确保消息传递程序永不陷入死锁的问题。我们聚焦于受上下文无关会话类型约束的并发函数式程序,这类程序可表达标准会话类型无法描述的丰富树状结构。我们提出一种基于上下文无关会话类型的新类型系统:该系统既强制协议遵循性又保证无死锁属性,同样适用于通过递归与多态实现循环通信拓扑的程序。我们展示了如何将基于优先级的无死锁方法扩展至这一表现力更强的场景。我们证明,类型良好的并发程序既遵循其协议,也永不死锁。