Lune

OOPSLA2020Top-tier venue

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 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.

8 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

  • Automated Verification of Fundamental Algebraic Laws cites Type-Checking CRDT Convergence
  • Katara: synthesizing CRDTs with verified lifting cites Certified mergeable replicated data types
  • Type-Checking CRDT Convergence cites Katara: synthesizing CRDTs with verified lifting
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Katara: synthesizing CRDTs with verified liftingShadaj Laddad, Conor Power, Mae Milano, Alvin Cheung et al.OOPSLA 2022 · 24 citations
  2. Type-Checking CRDT ConvergenceGeorge Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2023 · 16 citations
  3. Modular verification of op-based CRDTs in separation logicAbel Nieto, Léon Gondelman, Alban Reynaud, Amin Timany et al.OOPSLA 2022 · 16 citations
  4. Certified mergeable replicated data typesVimala Soundarapandian, Adharsh Kamath, Kartik Nagar, K. C. SivaramakrishnanPLDI 2022 · 12 citations
  5. Automated Verification of Fundamental Algebraic LawsGeorge Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2024 · 6 citations

Builds on1

  1. Kind inference for datatypesNingning Xie, Richard A. Eisenberg, Bruno C. d. S. OliveiraPOPL 2020 · 2 citations

Related papers

  1. Liquidate your assets: reasoning about resource usage in liquid HaskellMartin A. T. Handley, Niki Vazou, Graham HuttonPOPL 2020 · 38 citations
  2. Quotient Haskell: Lightweight Quotient Types for AllBrandon Hewer, Graham HuttonPOPL 2024 · 3 citations
  3. PLEX: Normalization for Refinement TypesAlessio Ferrarini, Niki Vazou, Wouter SwierstraOOPSLA 2026
  4. Neurosymbolic Modular Refinement Type InferenceGeorgios Sakkas, Pratyush Sahu, Kyeling Ong, Ranjit JhalaICSE 2025 · 1 citation
  5. Usability Barriers for Liquid TypesCatarina Gamboa, Abigail Reese, Alcides Fonseca, Jonathan AldrichPLDI 2025 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines