We present TLLC which extends the Two-Level Linear dependent type theory (TLL) with session-based concurrency. Equipped with Martin-L\"{o}f style dependency, the session types of TLLC allow protocols to specify properties of communicated messages. When used in conjunction with the dependent type machinery already present in TLL, dependent session types facilitate a form of relational verification by relating concurrent programs with their idealized sequential counterparts. Correctness properties proven for sequential programs can be easily lifted to their corresponding concurrent implementations. TLLC makes session types a powerful tool for intrinsically verifying the correctness of data structures such as queues and concurrent algorithms such as map-reduce. To extend TLL with session types, we develop a novel formulation of intuitionistic session type which we believe to be widely applicable for integrating session types into other type systems beyond the context of TLLC. We study the meta-theory of our language, proving its soundness as both a term calculus and a process calculus. To demonstrate the practicality of TLLC, we have implemented a prototype compiler that translates TLLC programs into concurrent C code, which has been extensively evaluated.
翻译:本文提出了TLLC,它在双层线性依赖类型理论(TLL)的基础上扩展了基于会话的并发机制。借助Martin-Löf风格的依赖特性,TLLC的会话类型允许协议对通信消息的属性进行规约。当与TLL中已有的依赖类型机制结合使用时,依赖会话类型通过将并发程序与其理想化的顺序对应程序相关联,促进了一种关系验证形式。为顺序程序证明的正确性属性可以轻松地提升到其对应的并发实现中。TLLC使会话类型成为内在地验证队列等数据结构和map-reduce等并发算法正确性的强大工具。为了将会话类型集成到TLL中,我们提出了一种新颖的直觉主义会话类型表述,我们相信该表述可广泛适用于将会话类型集成到TLLC语境之外的其他类型系统中。我们研究了该语言的元理论,证明了其作为项演算和进程演算的可靠性。为了展示TLLC的实用性,我们实现了一个原型编译器,可将TLLC程序翻译为并发C代码,并已进行了广泛评估。