Intersection types and (positive) almost-sure termination
Ugo Dal Lago, Claudia Faggian, Simona Ronchi Della Rocca
Abstract
Randomized higher-order computation can be seen as being captured by a λ-calculus endowed with a single algebraic operation, namely a construct for binary probabilistic choice. What matters about such computations is the probability of obtaining any given result, rather than the possibility or the necessity of obtaining it, like in (non)deterministic computation. Termination, arguably the simplest kind of reachability problem, can be spelled out in at least two ways, depending on whether it talks about the probability of convergence or about the expected evaluation time, the second one providing a stronger guarantee. In this paper, we show that intersection types are capable of precisely characterizing both notions of termination inside a single system of types: the probability of convergence of any λ-term can be underapproximated by its type , while the underlying derivation’s weight gives a lower bound to the term’s expected number of steps to normal form. Noticeably, both approximations are tight—not only soundness but also completeness holds. The crucial ingredient is non-idempotency, without which it would be impossible to reason on the expected number of reduction steps which are necessary to completely evaluate any term. Besides, the kind of approximation we obtain is proved to be optimal recursion theoretically: no recursively enumerable formal system can do better than that.
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 7606fe93-ef8b-4647-88d4-933ed1d8b0e2Cited by top-tier papers7
- On probabilistic termination of functional programs with continuous distributionsRaven Beutner, Luke OngPLDI 2021 · 12 citations
- On Lexicographic Proof Rules for Probabilistic TerminationKrishnendu Chatterjee, Ehsan Kafshdar Goharshady, Petr Novotný, Jiri Zárevúcky et al.FM 2021 · 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
- The Space of InteractionBeniamino Accattoli, Ugo Dal Lago, Gabriele VanoniLICS 2021 · 4 citations
- Higher Order Bayesian Networks, ExactlyClaudia Faggian, Daniele Pautasso, Gabriele VanoniPOPL 2024 · 4 citations
Builds on1
Related papers
- Step-Indexed Logical Relations for Countable Nondeterminism and Probabilistic ChoiceAlejandro Aguirre, Lars BirkedalPOPL 2023 · 13 citations
- On Higher-Order Probabilistic Verification via the Weighted Relational Model of Linear LogicUgo Dal Lago, Guido Fiorillo, Paolo PistoneLICS 2026
- Curry and Howard Meet BorelMelissa Antonelli, Ugo Dal Lago, Paolo PistoneLICS 2022 · 3 citations
- Quantitative Inhabitation for Different Lambda Calculi in a Unifying FrameworkVictor Arrial, Giulio Guerrieri, Delia KesnerPOPL 2023 · 5 citations
- Interaction EquivalenceBeniamino Accattoli, Adrienne Lancelot, Giulio Manzonetto, Gabriele VanoniPOPL 2025 · 2 citations
