arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.01278cs.PL
收藏

带回调的内部类型会话

Intrinsically Typed Sessions With Callbacks

Peter Thiemann

摘要:

会话类型的所有形式化都依赖于线性类型的可靠性,因为会话类型的通信通道必须在每次操作时更改其类型。会话类型的嵌入式语言实现也是如此。它们要么依赖于巧妙的类型构造来静态地保证线性,要么依赖于近似线性的运行时检查。我们提出了一种新的语言嵌入式实现的会话类型,这是控制反转的设计原则的启发。使用我们的方法,所有应用程序本质上都是会话类型的,并且无法通过构造来打破线性。线性仍然是一个微小的封装库的证明义务,可以在库构建时一次性释放。我们证明,我们提出的设计扩展到广泛的会话类型系统的功能:分支,递归,多通道和高阶会话,以及上下文无关的会话。多通道扩展提供了会话类型的嵌入式实现,通过构造保证了无死锁。本文中报告的开发完全由经过类型检查的Agda代码支持。

英文摘要:

All formalizations of session types rely on linear types for soundness as session-typed communication channels must change their type at every operation. Embedded language implementations of session types follow suit. They either rely on clever typing constructions to guarantee linearity statically, or on run-time checks that approximate linearity. We present a new language embedded implementation of session types, which is inspired by the inversion of control design principle. With our approach, all application programs are intrinsically session typed and unable to break linearity by construction. Linearity remains a proof obligation for a tiny encapsulated library that can be discharged once and for all when the library is built. We demonstrate that our proposed design extends to a wide range of features of session type systems: branching, recursion, multichannel and higher-order session, as well as context-free sessions. The multichannel extension provides an embedded implementation of session types which guarantees deadlock freedom by construction. The development reported in this paper is fully backed by type-checked Agda code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑