Reference. Modular Verification of State-Based CRDTs in Separation Logic

Conflict-free Replicated Datatypes (CRDTs) are a class of distributed data structures that are highly-available and weakly consistent. The CRDT taxonomy is further divided into two subclasses: state-based and operation-based (op-based). Recent prior work showed how to use separation logic to verify convergence and functional correctness of op-based CRDTs while (a) verifying implementations (as opposed to high-level protocols), (b) giving high level specifications that abstract from low-level implementation details, and (c) providing specifications that are modular (i.e. allow client code to use the CRDT like an abstract data type). We extend this separation logic approach to verification of CRDTs to handle state-based CRDTs, while respecting the desiderata (a)-(c). The key idea is to track the state of a CRDT as a function of the set of operations that produced that state. Using the observation that state-based CRDTs are automatically causally-consistent, we obtain CRDT specifications that are agnostic to whether a CRDT is state- or op-based. When taken together with prior work, our technique thus provides a unified approach to specification and verification of op- and state-based CRDTs. We have tested our approach by verifying StateLib, a library for building state-based CRDTs. Using StateLib, we have further verified convergence and functional correctness of multiple example CRDTs from the literature. Our proofs are written in the Aneris distributed separation logic and are mechanized in Coq.

Cite

Cite as @nieto-2023-modular (helia, typst) · \cite{nieto-2023-modular} (LaTeX)
BibTeX
bibtex · 14 lines
@inproceedings{nieto-2023-modular,
  doi = {10.4230/LIPICS.ECOOP.2023.22},
  url = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ECOOP.2023.22},
  author = {Nieto, Abel and Daby-Seesaram, Arnaud and Gondelman, Léon and Timany, Amin and Birkedal, Lars},
  keywords = {separation logic, distributed systems, CRDT, replicated data type, formal verification, Theory of computation → Program verification, Theory of computation → Distributed algorithms, Theory of computation → Separation logic},
  language = {en},
  title = {Modular Verification of State-Based CRDTs in Separation Logic},
  volume = {263},
  pages = {22:1-22:27},
  publisher = {Schloss Dagstuhl – Leibniz-Zentrum für Informatik},
  year = {2023},
  copyright = {Creative Commons Attribution 4.0 International license},
  booktitle = {37th European Conference on Object-Oriented Programming (ECOOP 2023)}
}
hayagriva YAML (typst)
yaml · 19 lines
nieto-2023-modular:
  type: article
  title: Modular Verification of State-Based CRDTs in Separation Logic
  author:
  - Nieto, Abel
  - Daby-Seesaram, Arnaud
  - Gondelman, Léon
  - Timany, Amin
  - Birkedal, Lars
  date: 2023
  page-range: 22:1-22:27
  url: https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ECOOP.2023.22
  serial-number:
    doi: 10.4230/LIPICS.ECOOP.2023.22
  parent:
    type: proceedings
    title: 37th European Conference on Object-Oriented Programming (ECOOP 2023)
    publisher: Schloss Dagstuhl – Leibniz-Zentrum für Informatik
    volume: 263
Cited by (2)

Verifying Isolation Levels of Database Implementations for Free Using Separation Logic mathiasen-2026-verifying

Modern databases are highly concurrent and provide transactions as a mean of grouping several database operations into atomically applied units. Database vendors and software engineers use isolation levels to describe the consistency guarantees of transactions. The popular isolation levels give weak guarantees, with intricate semantics, to optimize performance of applications. The problem of assuring that database implementations actually implement the isolation level guarantees that application developers build their systems upon has received a great deal of attention from the testing community. But until now, there exists no method for formally verifying that a database implementation actually implements the isolation level that database vendors says it provides. In this paper, we present a method for verifying that a database implements an isolation level: we derive isolation levels directly, as formalized in transactional consistency models by the database community, from the structure of separation logic specifications. By doing so, we consider all program executions that a database and arbitrary clients of the database could produce. The result is a so-called free theorem meaning that any database implementation, whose operations are verified against a specific set of separation logic specifications, actually implements its isolation level. As all proofs in this paper are mechanized in the Rocq proof assistant and build upon a detailed semantic model of program execution, we believe this contribution raises the bar for the achievable robustness of databases.
arXiv

Reasoning about Weak Isolation Levels in Separation Logic alnormathiasen-2025-reasoning

Consistency guarantees among concurrently executing transactions in local- and distributed systems, commonly referred to as isolation levels, have been formalized in a number of models. Thus far, no model can reason about executable implementations of databases or local transaction libraries providing weak isolation levels. Weak isolation levels are characterized by being highly concurrent and, unlike their stronger counter part serializability, they are not equivalent to the consistency guarantees provided by a transaction library implemented using a global lock. Industrial-strength databases almost exclusively implement weak isolation levels as their default level. This calls for formalism as numerous bugs violating isolation have been detected in these databases. In this paper, we formalize three weak isolation levels in separation logic, namely read uncommitted, read committed, and snapshot isolation. We define modular separation logic specifications that are independent of the underlying transaction library implementation. Historically, isolation levels have been specified using examples of executions between concurrent transactions that are not allowed to occur, and we demonstrate that our specifications correctly prohibit such examples. To show that our specifications are realizable, we formally verify that an executable implementation of a key-value database running the multi-version concurrency control algorithm from the original snapshot isolation paper satisfies our specification of snapshot isolation. Moreover, we prove implications between the specifications—snapshot isolation implies read committed and read committed implies read uncommitted—and thus the verification effort of the database serves as proof that all of our specifications are realizable. All results are mechanized in the Rocq proof assistant on top of the Iris separation logic framework.
PDF · DOI · arXiv · pldb
Cites 24 works (2 here)
With notes (2)

Iris from the ground up: A modular foundation for higher-order concurrent separation logic jung_etal_iris_ground_up_2018

Iris is a framework for higher-order concurrent separation logic, which has been implemented in the Coq proof assistant and deployed very effectively in a wide variety of verification projects. Iris was designed with the express goal of simplifying and consolidating the foundations of modern separation logics, but it has evolved over time, and the design and semantic foundations of Iris itself have yet to be fully written down and explained together properly in one place. Here, we attempt to fill this gap, presenting a reasonably complete picture of the latest version of Iris (version 3.1), from first principles and in one coherent narrative.
PDF · DOI · pldb

Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning jung-2015-iris

PDF · DOI · pldb
External (22)
nieto-2023-modular reference entries/refs/nieto-2023-modular/nieto-2023-modular.hel