Verifying replicated data types with typeclass refinements in Liquid Haskell
Yiyun Liu, James Parker, Patrick Redmond, Lindsey Kuper, Michael Hicks, Niki Vazou
Abstract
This paper presents an extension to Liquid Haskell that facilitates stating and semi-automatically proving properties of typeclasses. Liquid Haskell augments Haskell with refinement types-our work allows such types to be attached to typeclass method declarations, and ensures that instance implementations respect these types. The engineering of this extension is a modular interaction between GHC, the Glasgow Haskell Compiler, and Liquid Haskell's core proof infrastructure. The design sheds light on the interplay between modular proofs and typeclass resolution, which in Haskell is coherent by default (meaning that resolution always selects the same implementation for a particular instantiating type), but in other dependently typed languages is not.
We demonstrate the utility of our extension by using Liquid Haskell to modularly verify that 34 instances satisfy the laws of five standard typeclasses.
More substantially, we implement a framework for programming distributed applications based on replicated data types (RDTs). We define a typeclass whose Liquid Haskell type captures the mathematical properties RDTs should satisfy; prove in Liquid Haskell that these properties are sufficient to ensure that replicas' states converge despite out-of-order update delivery; implement (and prove correct) several instances of our RDT typeclass; and use them to build two realistic applications, a multi-user calendar event planner and a collaborative text editor.
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 a568e8ec-0e56-4cf2-b88c-9e00556de8bbCited by top-tier papers8
- Katara: synthesizing CRDTs with verified liftingShadaj Laddad, Conor Power, Mae Milano, Alvin Cheung et al.OOPSLA 2022 · 24 citations
- Type-Checking CRDT ConvergenceGeorge Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2023 · 16 citations
- Modular verification of op-based CRDTs in separation logicAbel Nieto, Léon Gondelman, Alban Reynaud, Amin Timany et al.OOPSLA 2022 · 16 citations
- Certified mergeable replicated data typesVimala Soundarapandian, Adharsh Kamath, Kartik Nagar, K. C. SivaramakrishnanPLDI 2022 · 12 citations
- Automated Verification of Fundamental Algebraic LawsGeorge Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2024 · 6 citations
Builds on1
Related papers
- Liquidate your assets: reasoning about resource usage in liquid HaskellMartin A. T. Handley, Niki Vazou, Graham HuttonPOPL 2020 · 38 citations
- Quotient Haskell: Lightweight Quotient Types for AllBrandon Hewer, Graham HuttonPOPL 2024 · 3 citations
- PLEX: Normalization for Refinement TypesAlessio Ferrarini, Niki Vazou, Wouter SwierstraOOPSLA 2026
- Neurosymbolic Modular Refinement Type InferenceGeorgios Sakkas, Pratyush Sahu, Kyeling Ong, Ranjit JhalaICSE 2025 · 1 citation
- First-Class Refinement Types for ScalaMatt Bovel, Viktor Kunčak, Martin OderskyOOPSLA 2026
