Reference. The Compositional Essence of Effectful Cost Analyses: Categorical Foundations and Fibered Logical Relations
Cite
Cites 73 works (8 here)
With notes (8)
Denotational Foundations for Expected Cost Analysis amorim_2025_oopsla
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.
Logical relations for call-by-push-value models, via internal fibrations in a 2-category amorim_kura_saville_2025
We give a denotational account of logical relations for call-by-push-value (CBPV) in the fibrational style of Hermida, Jacobs, Katsumata and others. Fibrations – which axiomatise the usual notion of sets-with-relations – provide a clean framework for constructing new, logical relations-style, models. Such models can then be used to study properties such as effect simulation.
Extending this picture to CBPV is challenging: the models incorporate both adjunctions and enrichment, making the appropriate notion of fibration unclear. We handle this using 2-category theory. We identify an appropriate 2-category, and define CBPV fibrations to be fibrations internal to this 2-category which strictly preserve the CBPV semantics.
Next, we develop the theory so it parallels the classical setting. We give versions of the codomain and subobject fibrations, and show that new models can be constructed from old ones by pullback. The resulting framework enables the construction of new, logical relations-style, models for CBPV.
Finally, we demonstrate the utility of our approach with particular examples. These include a generalisation of Katsumata’s -lifting to CBPV models, an effect simulation result, and a relative full completeness result for CBPV without sum types.
Tachis: Higher-Order Separation Logic with Credits for Expected Costs haselwarter-2024-tachis
Error Credits: Resourceful Reasoning about Error Bounds for Higher-Order Probabilistic Programs aguirre-2024-error
Fully abstract models for effectful λ-calculi via category-theoretic logical relations kammar-2022-fully
A cost-aware logical framework niu-2022-a
Logical Relations as Types: Proof-Relevant Parametricity for Program Modules sterling_harper_2021
The theory of program modules is of interest to language designers not only for its practical importance to programming, but also because it lies at the nexus of three fundamental concerns in language design: the phase distinction, computational effects, and type abstraction. We contribute a fresh “synthetic” take on program modules that treats modules as the fundamental constructs, in which the usual suspects of prior module calculi (kinds, constructors, dynamic programs) are rendered as derived notions in terms of a modal type-theoretic account of the phase distinction. We simplify the account of type abstraction (embodied in the generativity of module functors) through a lax modality that encapsulates computational effects, placing projectibility of module expressions on a type-theoretic basis.
Our main result is a (significant) proof-relevant and phase-sensitive generalization of the Reynolds abstraction theorem for a calculus of program modules, based on a new kind of logical relation called a parametricity structure. Parametricity structures generalize the proof-irrelevant relations of classical parametricity to proof-relevant families, where there may be non-trivial evidence witnessing the relatedness of two programs—simplifying the metatheory of strong sums over the collection of types, for although there can be no “relation classifying relations,” one easily accommodates a “family classifying small families.”
Using the insight that logical relations/parametricity is itself a form of phase distinction between the syntactic and the semantic, we contribute a new synthetic approach to phase separated parametricity based on the slogan logical relations as types, by iterating our modal account of the phase distinction. We axiomatize a dependent type theory of parametricity structures using two pairs of complementary modalities (syntactic, semantic) and (static, dynamic), substantiated using the topos theoretic Artin gluing construction. Then, to construct a simulation between two implementations of an abstract type, one simply programs a third implementation whose type component carries the representation invariant.
A domain theory for statistical probabilistic programming vakar-2019-a
External (65)
- Composing Codensity Bisimulations (2024)
- Effectful semantics in bicategories: strong, commutative, and concurrent pseudomonads (2024)
- A Modal Type Theory of Expected Cost in Higher-Order Probabilistic Programs (2024)
- Concurrent monads for shared state (2024)
- An Order Theory Framework of Recurrence Equations for Static Cost Analysis–Dynamic Inference of Non-Linear Inequality Invariants (2024)
- Automatic Differentiation via Effects and Handlers (2024)
- A calculus for amortized expected runtimes (2023)
- Central submonads and notions of computation: Soundness, completeness and internal languages (2023)
- Decalf: A Directed, Effectful Cost-Aware Logical Framework (2023)
- Automatic Amortized Resource Analysis with Regular Recursive Types (2023)
- ωpap spaces: Reasoning denotationally about higher-order, recursive probabilistic and differentiable programs (2023)
- Higher-Order Weakest Precondition Transformers via a CPS Transformation (2023)
- ADEV: Sound automatic differentiation of expected values of probabilistic programs (2023)
- Automated Tail Bound Analysis for Probabilistic Recurrence Relations (2023)
- Quantum expectation transformers for cost analysis (2022)
- Weighted programming: a programming paradigm for specifying mathematical models (2022)
- Automated expected amortised cost analysis of probabilistic data structures (2022)
- On continuation-passing transformations and expected cost analysis (2021)
- A unifying type-theory for higher-order (amortized) cost analysis (2021)
- A modular cost analysis for probabilistic programs (2020)
- Foundations of probabilistic programming (2020)
- Combining probabilistic and non-deterministic choice via weak distributive laws (2020)
- Exponential automatic amortized resource analysis (2020)
- Raising expectations: automating expected cost analysis with types (2020)
- Type-based complexity analysis of probabilistic functional programs (2019)
- Recurrence extraction for functional programs through call-by-push-value (2019)
- Codensity Games for Bisimilarity (2019)
- Tail probabilities for randomized program runtimes via martingales for higher moments (2019)
- Time credits and time receipts in Iris (2019)
- Relational cost analysis for functional-imperative programs (2019)
- Factorisation systems for logical relations and monadic lifting in type-and-effect system semantics (2018)
- Concurrent Kleene algebra: Free model and completeness (2018)
- Codensity lifting of monads and its dual (2018)
- Bounded expectations: resource analysis for probabilistic programs (2018)
- A semantic account of metric preservation (2017)
- Relational cost analysis (2017)
- Towards automatic resource bound analysis for OCaml (2017)
- A weakest pre-expectation semantics for mixed-sign expectations (2017)
- Arrays and references in resource aware ML (2017)
- Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs (2016)
- Practical Foundations for Programming Languages (2016)
- Weakest precondition reasoning for expected run–times of probabilistic programs (2016)
- Denotational cost semantics for functional languages with inductive types (2015)
- Automatic static cost analysis for parallel programs (2015)
- Fibred 2-categories and bicategories (2014)
- Upper-expectation bisimilarity and Łukasiewicz μ-calculus (2014)
- A static cost analysis for a higher-order language (2013)
- Relating computational effects by ⊤⊤-lifting (2013)
- Weighted Relational Models of Typed Lambda-Calculi (2013)
- Tensors, Monads and Actions (2013)
- Fibrations of bicategories (2011)
- Concurrent Kleene algebra and its foundations (2011)
- Logical relations for monadic types (2008)
- Distributing probability over non-determinism (2006)
- A semantic formulation of ⊤⊤-lifting and logical predicates for computational metalanguage (2005)
- Continuous Lattices and Domains (2003)
- Sketches of an Elephant: A Topos Theory Compendium, Volume 1 (2002)
- Call-by-push-value (2001)
- Lax logical relations (2000)
- Handbook of categorical algebra: volume 2, Categories and Structures (1994)
- Fibrations, Logical Predicates and Indeterminates (1993)
- Notes on sconing and relators (1992)
- Computational lambda-calculus and monads (1989)
- A Hoare-like proof system for analysing the computation time of programs (1987)
- A Note on the Height of Binary Search Trees (1986)