Lune

POPL2022Top-tier venue

A cost-aware logical framework

Yue Niu, Jonathan Sterling, Harrison Grodin, Robert Harper

Abstract

We present calf , a c ost- a ware l ogical f ramework for studying quantitative aspects of functional programs. Taking inspiration from recent work that reconstructs traditional aspects of programming languages in terms of a modal account of phase distinctions , we argue that the cost structure of programs motivates a phase distinction between intension and extension . Armed with this technology, we contribute a synthetic account of cost structure as a computational effect in which cost-aware programs enjoy an internal noninterference property: input/output behavior cannot depend on cost. As a full-spectrum dependent type theory, calf presents a unified language for programming and specification of both cost and behavior that can be integrated smoothly with existing mathematical libraries available in type theoretic proof assistants. We evaluate calf as a general framework for cost analysis by implementing two fundamental techniques for algorithm analysis: the method of recurrence relations and physicist’s method for amortized analysis . We deploy these techniques on a variety of case studies: we prove a tight, closed bound for Euclid’s algorithm, verify the amortized complexity of batched queues, and derive tight, closed bounds for the sequential and parallel complexity of merge sort, all fully mechanized in the Agda proof assistant. Lastly we substantiate the soundness of quantitative reasoning in calf by means of a model construction.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

11 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Automatic Amortized Resource Analysis with Regular Recursive Types cites A unifying type-theory for higher-order (amortized) cost analysis
  • A unifying type-theory for higher-order (amortized) cost analysis cites Liquidate your assets: reasoning about resource usage in liquid Haskell
  • Robust Resource Bounds with Static Analysis and Bayesian Inference cites Automatic Amortized Resource Analysis with Regular Recursive Types
  • Robust Resource Bounds with Static Analysis and Bayesian Inference cites Liquidate your assets: reasoning about resource usage in liquid Haskell
  • Decalf: A Directed, Effectful Cost-Aware Logical Framework cites The fire triangle: how to mix substitution, dependent elimination, and effects
  • Decalf: A Directed, Effectful Cost-Aware Logical Framework cites A unifying type-theory for higher-order (amortized) cost analysis
  • A Metalanguage for Cost-Aware Denotational Semantics cites The fire triangle: how to mix substitution, dependent elimination, and effects
  • Polynomial Time and Dependent Types cites A unifying type-theory for higher-order (amortized) cost analysis
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers11

  1. Decalf: A Directed, Effectful Cost-Aware Logical FrameworkHarrison Grodin, Yue Niu, Jonathan Sterling, Robert HarperPOPL 2024 · 11 citations
  2. Robust Resource Bounds with Static Analysis and Bayesian InferenceLong Pham, Feras A. Saad, Jan HoffmannPLDI 2024 · 6 citations
  3. Automatic Amortized Resource Analysis with Regular Recursive TypesJessie Grosen, David M. Kahn, Jan HoffmannLICS 2023 · 5 citations
  4. A Metalanguage for Cost-Aware Denotational SemanticsYue Niu, Robert HarperLICS 2023 · 5 citations
  5. Polynomial Time and Dependent TypesRobert AtkeyPOPL 2024 · 5 citations

Builds on6

  1. The fire triangle: how to mix substitution, dependent elimination, and effectsPierre-Marie Pédrot, Nicolas TabareauPOPL 2020 · 42 citations
  2. Liquidate your assets: reasoning about resource usage in liquid HaskellMartin A. T. Handley, Niki Vazou, Graham HuttonPOPL 2020 · 38 citations
  3. Normalization for Cubical Type TheoryJonathan Sterling, Carlo AngiuliLICS 2021 · 28 citations
  4. A unifying type-theory for higher-order (amortized) cost analysisVineet Rajani, Marco Gaboardi, Deepak Garg, Jan HoffmannPOPL 2021 · 26 citations
  5. The taming of the rew: a type theory with computational assumptionsJesper Cockx, Nicolas Tabareau, Théo WinterhalterPOPL 2021 · 24 citations

Related papers

  1. Static prediction of parallel computation graphsStefan K. MullerPOPL 2022 · 4 citations
  2. Abstraction Functions as Types: Modular Verification of Cost and Behavior in Dependent Type TheoryHarrison Grodin, Runming Li, Robert HarperPOPL 2026 · 2 citations
  3. Proof Repair across Quotient Type EquivalencesCosmo Viola, Max Fan, Talia RingerOOPSLA 2025 · 1 citation
  4. Internal and Observational Parametricity for Cubical AgdaAntoine Van Muylder, Andreas Nuyts, Dominique DevriesePOPL 2024 · 2 citations
  5. Algebraic Effects Meet Hoare Logic in Cubical AgdaDonnacha Oisín Kidney, Zhixuan Yang, Nicolas WuPOPL 2024 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines