Reference. Verifying Isolation Levels of Database Implementations for Free Using Separation Logic
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.
Cite
Cites 56 works (9 here)
With notes (9)
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.
Trillium: Higher-Order Concurrent and Distributed Separation Logic for Intensional Refinement timany-2024-trillium
Expressive state-of-the-art separation logics rely on step-indexing to model semantically complex features and to support modular reasoning about imperative higher-order concurrent and distributed programs. Stepindexing comes, however, with an inherent cost: it restricts the adequacy theorem of program logics to a fairly simple class of safety properties. In this paper, we explore if and how intensional refinement is a viable methodology for strengthening higher-order concurrent (and distributed) separation logic to prove non-trivial safety and liveness properties. Specifically, we introduce Trillium, a language-agnostic separation logic framework for showing intensional refinement relations between traces of a program and a model. We instantiate Trillium with a concurrent language and develop Fairis, a concurrent separation logic, that we use to show liveness properties of concurrent programs under fair scheduling assumptions through a fair liveness-preserving refinement of a model. We also instantiate Trillium with a distributed language and obtain an extension of Aneris, a distributed separation logic, which we use to show refinement relations between distributed systems and TLA + models.
Grove: A Separation-Logic Library for Verifying Distributed Systems sharmaGroveSeparationLogicLibrary2023
Grove is a concurrent separation logic library for verifying distributed systems. Grove is the first to handle time-based leases, including their interaction with reconfiguration, crash recovery, thread-level concurrency, and unreliable networks. This paper uses Grove to verify several distributed system components written in Go, including vKV, a realistic distributed multi-threaded key-value store. vKV supports reconfiguration, primary/backup replication, and crash recovery, and uses leases to execute read-only requests on any replica. vKV achieves high performance (67–73% of Redis on a single core), scales with more cores and more backup replicas (achieving about 2× the throughput when going from 1 to 3 servers), and can safely execute reads while reconfiguring.
Verifying Reliable Network Components in a Distributed Separation Logic with Dependent Separation Protocols gondelman-2023-verifying
We present a foundationally verified implementation of a reliable communication library for asynchronous client-server communication, and a stack of formally verified components on top thereof. Our library is implemented in an OCaml-like language on top of UDP and features characteristic traits of existing protocols, such as a simple handshaking protocol, bidirectional channels, and retransmission/acknowledgement mechanisms. We verify the library in the Aneris distributed separation logic using a novel proof pattern—dubbed the session escrow pattern—based on the existing escrow proof pattern and the so-called dependent separation protocols, which hitherto have only been used in a non-distributed concurrent setting. We demonstrate how our specification of the reliable communication library simplifies formal reasoning about applications, such as a remote procedure call library, which we in turn use to verify a lazily replicated key-value store with leader-followers and clients thereof. Our development is highly modular—each component is verified relative to specifications of the components it uses (not the implementation). All our results are formalized in the Coq proof assistant.
Modular Verification of State-Based CRDTs in Separation Logic nieto-2023-modular
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.
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.
Higher-order ghost state jung_higher-order_2016
The development of concurrent separation logic (CSL) has sparked a long line of work on modular verification of sophisticated concurrent programs. Two of the most important features supported by several existing extensions to CSL are higher-order quantification and custom ghost state. However, none of the logics that support both of these features reap the full potential of their combination. In particular, none of them provide general support for a feature we dub “higher-order ghost state”: the ability to store arbitrary higher-order separation-logic predicates in ghost variables. In this paper, we propose higher-order ghost state as a interesting and useful extension to CSL, which we formalize in the framework of Jung et al.‘s recently developed Iris logic. To justify its soundness, we develop a novel algebraic structure called CMRAs (“cameras”), which can be thought of as “step-indexed partial commutative monoids”. Finally, we show that Iris proofs utilizing higher-order ghost state can be effectively formalized in Coq, and discuss the challenges we faced in formalizing them.
Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning jung-2015-iris
Separation logic: A logic for shared mutable data structures reynolds_separation_2002
In joint work with Peter O’Hearn and others, based on early ideas of Burstall, we have developed an extension of Hoare logic that permits reasoning about low-level imperative programs that use shared mutable data structure. The simple imperative programming language is extended with commands (not expressions) for accessing and modifying shared structures, and for explicit allocation and deallocation of storage. Assertions are extended by introducing a “separating conjunction” that asserts that its subformulas hold for disjoint parts of the heap, and a closely related “separating implication”. Coupled with the inductive definition of predicates on abstract data structures, this extension permits the concise and flexible description of structures with controlled sharing. In this paper, we survey the current development of this program logic, including extensions that permit unrestricted address arithmetic, dynamically allocated arrays, and recursive procedures. We also discuss promising future directions.
External (47)
- AWDIT: An Optimal Weak Database Isolation Tester (2025)
- Checking Observational Correctness of Database Systems (2025)
- Plume: Efficient and Complete Black-Box Checking of Weak Isolation Levels (2024)
- IsoVista: Black-box Checking Database Isolation Guarantees (2024)
- VeriTxn: Verifiable Transactions for Cloud-Native Databases with Storage Disaggregation (2023)
- Viper: A Fast Snapshot Isolation Checker (2023)
- Efficient black-box checking of snapshot isolation in databases (2023)
- Verifying vMVCC, a high-performance transaction library using multi-version concurrency control (2023)
- Modular verification of op-based CRDTs in separation logic (2022)
- Litmus: Towards a Practical Database Management System with Verifiable ACID Properties and Transaction Correctness (2022)
- Theorems for free from separation logic specifications (2021)
- Distributed causal memory: modular specification and verification in higher-order distributed separation logic (2020)
- Aneris: A Mechanised Logic for Modular Reasoning about Distributed Systems (2020)
- Elle: Inferring Isolation Anomalies from Experimental Observations (2020)
- Automated Validation of State-Based Client-Centric Isolation with TLA+ (2020)
- Parametric Operational Semantics for Consistency Models (2020)
- On the complexity of checking transactional consistency (2019)
- Interaction trees: representing recursive and impure programs in Coq (2019)
- On the Semantics of Snapshot Isolation (2018)
- On Parallel Snapshot Isolation and Release/Acquire Consistency (2018)
- Analysing snapshot isolation (2018)
- Characterizing Transactional Memory Consistency Conditions Using Observational Refinement (2017)
- Alone together: compositional reasoning and inference for weak isolation (2017)
- Seeing is Believing: A Client-Centric Specification of Database Isolation (2017)
- The Essence of Higher-Order Concurrent Separation Logic (2017)
- A Framework for Transactional Consistency Models with Atomic Visibility (2015)
- TaDA: A Logic for Time and Data Abstraction (2014)
- A programming language perspective on transactional memory consistency (2013)
- A Framework for Formally Verifying Software Transactional Memory Algorithms (2012)
- Virtual world consistency: A condition for STM systems (with a versatile protocol with invisible read operations) (2012)
- Eventually Consistent Transactions (2012)
- Transactional storage for geo-replicated systems (2011)
- Transactional Mutex Locks (2010)
- Towards formally specifying and verifying transactional memory (2009)
- On the correctness of transactional memory (2008)
- Paxos made live: an engineering perspective (2007)
- Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services (2002)
- Generalized isolation level definitions (2000)
- Weak Consistency: A Generalized Theory and Optimistic Implementations for Distributed Transactions (1999)
- A critique of ANSI SQL isolation levels (1995)
- Linearizability: a correctness condition for concurrent objects (1990)
- The serializability of concurrent database updates (1979)
- Verifying properties of parallel programs: an axiomatic approach (1976)
- An axiomatic basis for computer programming (1969)
- Verificationofforwardsimulationswiththread-local, step-local proof obligations
- Concurrency control for database theorists
- C4: verified transactional objects