Session types statically describe communication protocols between concurrent message-passing processes. Unfortunately, parametric polymorphism even in its restricted prenex form is not fully understood in the context of session types. In this paper, we present the metatheory of session types extended with prenex polymorphism and, as a result, nested recursive datatypes. Remarkably, we prove that type equality is decidable by exhibiting a reduction to trace equivalence of deterministic first-order grammars. Recognizing the high theoretical complexity of the latter, we also propose a novel type equality algorithm and prove its soundness. We observe that the algorithm is surprisingly efficient and, despite its incompleteness, sufficient for all our examples. We have implemented our ideas by extending the Rast programming language with nested session types. We conclude with several examples illustrating the expressivity of our enhanced type system.
翻译:届会类型 静态描述同时传递信息的过程之间的通信协议。 不幸的是, 即使是其限制的先质形式的参数多态性在会话类型中也没有被完全理解。 在本文件中,我们介绍了会话类型的元神话,这些代谢类型以先质多态形式扩展,结果又以嵌入的递归数据类型扩展。 值得注意的是, 我们通过展示减少以追踪确定性第一阶语法的等同性来证明类型平等是可变的。 认识到后者的高度理论复杂性, 我们还提出了一种新的平等算法,并证明了其合理性。 我们观察到,算法是出乎意料的,尽管不完善,但足以成为我们所有例子。 我们实施了我们的想法,用嵌入的会话类型扩展了Rast编程语言。 我们最后举出了几个例子,说明我们增强型语法的表达性。