Affiliation:
1. Amazon, USA
2. Carnegie Mellon University, USA
Abstract
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 implement and analyze such systems, this article develops the meta theory of probabilistic session types with an application focus on 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 or external randomness from receiving on a probabilistic channel.
The analysis for expected resource bounds is smoothly integrated with the type system and is a variant of automatic amortized resource analysis.
Type inference relies on linear constraint solving to automatically derive symbolic bounds for various cost metrics.
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 complex type annotations.
The type system has been implemented in the language NomosPro with linear-time type checking.
Experiments demonstrate that NomosPro is applicable in different domains such as cost analysis of randomized distributed algorithms, analysis of Markov chains, probabilistic analysis of amortized data structures and digital contracts.
NomosPro is also shown to be scalable by (i) implementing two broadcast and a bounded retransmission protocol where messages are dropped with a fixed probability, and (ii) verifying the limiting distribution of a Markov chain with 64 states and 420 transitions.
Funder
Defense Advanced Research Projects Agency
National Science Foundation
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference70 articles.
1. Probabilities in Session Types
2. Suzana Andova . 1999. Process Algebra with Probabilistic Choice . In Formal Methods for Real-Time and Probabilistic Systems, Joost-Pieter Katoen (Ed.) . Springer Berlin Heidelberg , Berlin, Heidelberg . 111–129. isbn:978-3-540-48778-4 Suzana Andova. 1999. Process Algebra with Probabilistic Choice. In Formal Methods for Real-Time and Probabilistic Systems, Joost-Pieter Katoen (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 111–129. isbn:978-3-540-48778-4
3. Type-Based Complexity Analysis of Probabilistic Functional Programs
4. Manifest sharing with session types
5. Process algebra for synchronous communication
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Synthesis of Sound and Precise Storage Cost Bounds via Unsound Resource Analysis and Max-SMT;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11
2. On the Almost-Sure Termination of Binary Sessions;Proceedings of the 26th International Symposium on Principles and Practice of Declarative Programming;2024-09-09
3. sMALL CaPS: An Infinitary Linear Logic for a Calculus of Pure Sessions;Proceedings of the 26th International Symposium on Principles and Practice of Declarative Programming;2024-09-09
4. Error Credits: Resourceful Reasoning about Error Bounds for Higher-Order Probabilistic Programs;Proceedings of the ACM on Programming Languages;2024-08-15