一句话:提出标签依赖会话类型,将通信与数据引入/消去解耦,并支持类型级原始递归。
现有会话类型演算通常将通信与传输值的引入/消去紧密耦合,导致多种原语和归约规则,并对代码施加较多限制。本文提出一个基础会话类型演算,其轻量操作语义把通信与数据引入/消去完全解耦,仅用一次会合式通信归约。核心是带子类型的标签依赖会话类型:一种极简的值依赖类型系统,可模拟已有函数式会话类型系统,同时减少限制。本文还引入类型级自然数原始递归,使协议行为可依赖消息中传递的数值;并给出算法化类型检查系统,证明其与声明式系统等价。该演算展示了依赖类型与线性类型的一种新颖轻量集成。
Session types have emerged as a typing discipline for communication protocols. Existing calculi with session types come equipped with many different primitives that combine communication with the introduction or elimination of the transmitted value. We present a foundational session type calculus with a lightweight operational semantics. It fully decouples communication from the introduction and elimination of data and thus features a single communication reduction, which acts as a rendezvous between senders and receivers. We achieve this decoupling by introducing label-dependent session types, a minimalist value-dependent session type system with subtyping. The system is sufficiently powerful to simulate existing functional session type systems. Compared to such systems, label-dependent session types place fewer restrictions on the code. We further introduce primitive recursion over natural numbers at the type level, thus allowing to describe protocols whose behaviour depends on numbers exchanged in messages. An algorithmic type checking system is introduced and proved equivalent to its declarative counterpart. The new calculus showcases a novel lightweight integration of dependent types and linear typing, with has uses beyond session type systems.