论文标题
概率资源感知会话类型
Probabilistic Resource-Aware Session Types
论文作者
论文摘要
会话类型可以保证,通过消息流程遵守预定义的通信协议。会话类型的先前工作集中在确定性语言上,但是许多消息通讯系统(例如马尔可夫链和随机分布式算法)都是概率的。为了建模和分析此类系统,本文介绍了概率会话类型,并探讨了其在自动预期资源分析中的应用。概率会话类型描述了有关消息的概率分布,并且是直觉(二进制)会话类型的保守扩展。要发送概率通道,过程必须从概率分支表达式或外部随机性中利用内部随机性,从概率通道上接收。预期资源界限的分析与类型系统集成在一起,并且是自动摊销资源分析的变体。它可以通过将类型推理减少为线性约束求解来自动为不同的成本指标得出符号界限。技术贡献包括基于新颖的嵌套多宇宙语义和类型重建算法的元理论,该算法可以灵活地混合不同的随机性来源,而不会为程序员带来类型注释的负担。类型系统已在语言prast中实现。实验表明,PRAST适用于不同领域,例如对随机分布式算法的资源分析,马尔可夫链中限制分布的验证以及概率数字合同的分析。
Session types guarantee that message-passing processes adhere to predefined communication protocols. Prior work on session types has focused on deterministic languages but many message-passing systems, such as Markov chains and randomized distributed algorithms, are probabilistic. To model and analyze such systems, this article introduces probabilistic session types and explores their application in automatic expected resource analysis. Probabilistic session types describe probability distributions over messages and are a conservative extension of intuitionistic (binary) session types. To send on a probabilistic channel, processes have to utilize internal randomness from a probabilistic branching expression or external randomness from receiving on a probabilistic channel. The analysis for expected resource bounds is integrated with the type system and is a variant of automatic amortized resource analysis. It can automatically derive symbolic bounds for different cost metrics by reducing type inference to linear constraint solving. The technical contributions include the meta theory that is based on a novel nested multiverse semantics and a type-reconstruction algorithm that allows flexible mixing of different sources of randomness without burdening the programmer with type annotations. The type system has been implemented in the language PRast. Experiments demonstrate that PRast is applicable in different domains such as resource analysis of randomized distributed algorithms, verification of limiting distributions in Markov chains, and analysis of probabilistic digital contracts.