Multiparty Session Programming with Global Protocol Combinators

Multiparty Session Programming with Global Protocol Combinators
复制标题

DOI:
10.4230/darts.6.2.18
复制
发表时间:
2020-05
期刊:
ArXiv
影响因子:
--
通讯作者:
Keigo Imai;R. Neykova;N. Yoshida;Shoji Yuen
Keigo Imai;R. Neykova;N. Yoshida;Shoji Yuen
中科院分区:
其他
文献类型:
--
作者:
Keigo Imai;R. Neykova;N. Yoshida;Shoji Yuen

文献摘要

被引文献

相似文献

多方会话类型(MPST)是通信协议的类型规则。它确保了良好类型的通信进程不会出现通信错误和死锁。MPST理论的最新实现依赖于(1)运行时线性检查以确保通信信道的正确使用,以及(2)用于指定和验证多方协议的外部域特定语言。为了克服这些限制,我们提出了一个用全局组合子编程的库--一组用于在OCaml中编写和验证多方协议的函数。一个协议中所有进程的局部行为都是从全局组合子中一次推断出来的。我们形式化的全球combinators和证明一个健全的可实现的全球combinators -一个良好类型的全球combinator派生出一组本地类型,类型端点程序可以确保类型和通信安全。我们的方法使全静态验证和整个协议的实现,从协议规范的过程实现,发生在同一种语言。我们将我们的实现与无类型和延续传递风格的实现进行比较,并通过实现大量的协议来展示其表现力。我们展示了我们的库可以与现有的库和服务进行互操作,实现DNS(域名服务)协议和OAuth(开放认证)协议。
Multiparty Session Types (MPST) is a typing discipline for communication protocols. It ensures the absence of communication errors and deadlocks for well-typed communicating processes. The state-of-the-art implementations of the MPST theory rely on (1) runtime linearity checks to ensure correct usage of communication channels and (2) external domain-specific languages for specifying and verifying multiparty protocols. To overcome these limitations, we propose a library for programming with global combinators -- a set of functions for writing and verifying multiparty protocols in OCaml. Local behaviours for all processes in a protocol are inferred at once from a global combinator. We formalise global combinators and prove a sound realisability of global combinators -- a well-typed global combinator derives a set of local types, by which typed endpoint programs can ensure type and communication safety. Our approach enables fully-static verification and implementation of the whole protocol, from the protocol specification to the process implementations, to happen in the same language. We compare our implementation to untyped and continuation-passing style implementations, and demonstrate its expressiveness by implementing a plethora of protocols. We show our library can interoperate with existing libraries and services, implementing DNS (Domain Name Service) protocol and the OAuth (Open Authentication) protocol.