Denotational Foundations for Expected Cost Analysis
Pedro H. Azevedo de Amorim
Abstract
Reasoning about the cost of executing programs is one of the fundamental questions in computer science. In the context of programming with probabilities, however, the notion of cost stops being deterministic, since it depends on the probabilistic samples made throughout the execution of the program. This interaction is further complicated by the non-trivial interaction between cost, recursion and evaluation strategy.
In this work we introduce cert: a Call-By-Push-Value (CBPV) metalanguage for reasoning about probabilistic cost. We equip cert with an operational cost semantics and define two denotational semantics -a cost semantics and an expected-cost semantics. We prove operational soundness and adequacy for the denotational cost semantics and a cost adequacy theorem for the expected-cost semantics.
We formally relate both denotational semantics by stating and proving a novel effect simulation property for CBPV. We also prove a canonicity property of the expected-cost semantics as the minimal semantics for expected cost and probability by building on recent advances on monadic probabilistic semantics.
Finally, we illustrate the expressivity of cert and the expected-cost semantics by presenting case-studies ranging from randomized algorithms to stochastic processes and show how our semantics capture their intended expected cost.
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 c860a0fe-d9b3-4101-8dcb-ac991c853628Cited by top-tier papers2
- Central Submonads and Notions of Computation: Soundness, Completeness and Internal LanguagesTitouan Carette, Louis Lemonnier, Vladimir ZamdzhievLICS 2023 · 3 citations
- Logical relations for call-by-push-value models, via internal fibrations in a 2-categoryPedro H. Azevedo de Amorim, Satoshi Kura, Philip SavilleLICS 2025 · 1 citation
Builds on11
- A modular cost analysis for probabilistic programsMartin Avanzini, Georg Moser, Michael SchaperOOPSLA 2020 · 41 citations
- A unifying type-theory for higher-order (amortized) cost analysisVineet Rajani, Marco Gaboardi, Deepak Garg, Jan HoffmannPOPL 2021 · 26 citations
- A cost-aware logical frameworkYue Niu, Jonathan Sterling, Harrison Grodin, Robert HarperPOPL 2022 · 23 citations
- A Calculus for Amortized Expected RuntimesKevin Batz, Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja et al.POPL 2023 · 22 citations
- Recurrence extraction for functional programs through call-by-push-valueG. A. Kavvos, Edward Morehouse, Daniel R. Licata, Norman DannerPOPL 2020 · 20 citations
Related papers
- Decalf: A Directed, Effectful Cost-Aware Logical FrameworkHarrison Grodin, Yue Niu, Jonathan Sterling, Robert HarperPOPL 2024 · 11 citations
- Commutative Monads for Probabilistic Programming LanguagesXiaodong Jia, Bert Lindenhovius, Michael W. Mislove, Vladimir ZamdzhievLICS 2021 · 19 citations
- Quantum Expectation Transformers for Cost AnalysisMartin Avanzini, Georg Moser, Romain Péchoux, Simon Perdrix et al.LICS 2022 · 10 citations
- Highly Incremental: A Simple Programmatic Approach for Many ObjectivesPhilipp Schröer, Joost-Pieter KatoenFM 2026 · 1 citation
- Smart Choices and the Selection MonadMartín Abadi, Gordon D. PlotkinLICS 2021 · 2 citations
