Probabilistic Refinement Session Types
Qiancheng Fu, Ankush Das, Marco Gaboardi
Abstract
Session types provide a formal type system to define and verify communication protocols between message-passing processes. In order to analyze randomized systems, recent works have extended session types with probabilistic type constructors. Unfortunately, all the proposed extensions only support constant probabilities which limits their applicability to real-world systems. Our work addresses this limitation by introducing probabilistic refinement session types which enable symbolic reasoning for concurrent probabilistic systems in a core calculus we call PReST. The type system is carefully designed to be a conservative extension of refinement session types and supports both probabilistic and regular choice type operators. We also implement PReST in a prototype which we use for validating probabilistic concurrent programs. The added expressive power leads to significant challenges, in both the meta theory and implementation of PReST, particularly with type checking: it requires reconstructing intermediate types for channels when type checking probabilistic branching expressions. The theory handles this by semantically quantifying refinement variables in probabilistic typing rules, a deviation from standard refinement type systems. The implementation relies on a bi-directional type checker that uses an SMT solver to reconstruct the intermediate types minimizing annotation overhead and increasing usability. To guarantee that probabilistic processes are almost-surely terminating, we integrate cost analysis into our type system to obtain expected upper bounds on recursion depth. We evaluate PReST on a wide variety of benchmarks from 4 categories: (i) randomized distributed protocols such as Itai and Rodeh’s leader election, bounded retransmission, etc., (ii) parametric Markov chains such as random walks, (iii) probabilistic analysis of concurrent data structures such as queues, and (iv) distributions obtained by composing uniform distributions using operators like max and sum. Our experiments show that the PReST type checker scales to large programs with sophisticated probabilistic distributions.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 537f1d02-acdf-4934-80c7-bfa87ddf9574Builds on5
- Aiming low is harder: induction for lower bounds in probabilistic program verificationMarcel Hark, Benjamin Lucien Kaminski, Jürgen Giesl, Joost-Pieter KatoenPOPL 2020 · 47 citations
- A modular cost analysis for probabilistic programsMartin Avanzini, Georg Moser, Michael SchaperOOPSLA 2020 · 41 citations
- Automated Expected Amortised Cost Analysis of Probabilistic Data StructuresLorenz Leutgeb, Georg Moser, Florian ZulegerCAV 2022 · 19 citations
- Probabilistic Resource-Aware Session TypesAnkush Das, Di Wang, Jan HoffmannPOPL 2023 · 11 citations
- Tachis: Higher-Order Separation Logic with Credits for Expected CostsPhilipp G. Haselwarter, Kwing Hei Li, Markus de Medeiros, Simon Oddershede Gregersen et al.OOPSLA 2024 · 5 citations
Related papers
- Verified Lock-Free Session Channels with LinkingThomas Somers, Robbert KrebbersOOPSLA 2024 · 2 citations
- Top-Down or Bottom-Up? Complexity Analyses of Synchronous Multiparty Session TypesThien Udomsrirungruang, Nobuko YoshidaPOPL 2025 · 7 citations
- Mixtris: Mechanised Higher-Order Separation Logic for Mixed Choice Multiparty Message PassingJonas Kastberg Hinrichsen, Iwan Quémerais, Lars BirkedalOOPSLA 2026
- Statically verified refinements for multiparty protocolsFangyi Zhou, Francisco Ferreira, Raymond Hu, Rumyana Neykova et al.OOPSLA 2020 · 38 citations
- Mixed Choice in Asynchronous Multiparty Session TypesLaura Bocchi, Raymond Hu, Adriana Laura Voinea, Simon ThompsonOOPSLA 2026
