Liquid Amortization: Proving Amortized Complexity with LiquidHaskell (Functional Pearl)
Jan van Br\"ugge

TL;DR
This paper demonstrates how to verify amortized complexity of data structures directly in Haskell using LiquidHaskell, avoiding translation errors and providing an accessible approach for learners and practitioners.
Contribution
It introduces a method to prove amortized complexity within LiquidHaskell, enabling direct verification in Haskell without external theorem provers.
Findings
Verified amortized complexity of a simple stack with multipop
Proved bounds for binomial heaps used as priority queues
Established complexity bounds for Claessen's finger tree implementation
Abstract
Formal reasoning about the time complexity of algorithms and data structures is usually done in interactive theorem provers like Isabelle/HOL. This includes reasoning about amortized time complexity which looks at the worst case performance over a series of operations. However, most programs are not written within a theorem prover and thus use the data structures of the production language. To verify the correctness it is necessary to translate the data structures from the production language into the language of the prover. Such a translation step could introduce errors, for example due to a mismatch in features between the two languages. We show how to prove amortized complexity of data structures directly in Haskell using LiquidHaskell. Besides skipping the translation step, our approach can also provide a didactic advantage. Learners do not have to learn an additional language for…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
