A Datalog Framework for Conflict-Free Replicated Data Types

arXiv:2605.31569 · cs.DC, cs.DB, cs.LO, cs.PL · Submitted 2026-05-29 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.

Tom: I'm Tom.

Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.

Tom: We're looking at the paper: "A Datalog Framework for Conflict-Free Replicated Data Types".

Paper summary: Tom: Alright, let's talk about this paper, "A Datalog Framework for Conflict-Free Replicated Data Types." The main thesis is using a declarative framework built in Datalog to specify and reason about CRDT semantics and CRDT-based applications. Jane It claims that by modeling these semantics as executable logic programs over operation contexts, they make concurrency explicit and compositional, which makes the system amenable to automated analysis.

Lu: The paper argues that building applications from CRDTs is difficult because conflict-resolution policies don't always compose predictably; subtle concurrency patterns can cause correct CRDTs to converge to states that violate what the application actually intends. Tom So it’s tackling this problem where combining different data structures doesn't guarantee a consistent final state according to the application logic.

Jane: They provide a declarative modeling framework and tool called CRDTLog, which lets developers explore the composability of these semantics through transformation rules that map application events to component updates. Lalam This framework supports basic, nested, and composite CRDT specifications, and it includes tools for generating operation contexts and comparing semantic outcomes.

Meng: What's important here is that the paper presents a case study on collaborative graphs demonstrating how these abstract semantic specifications can expose non-obvious concurrency behaviors in the composition choices. Tom So they aren't just talking about theory; they’ve shown how this abstraction helps reveal weird behavior in real application scenarios.

Jane: And they evaluate this by comparing their implementation-level compositional semantics, ICS, against the specification-level semantics, SLS, using property-based testing to verify semantic equivalence. Lalam The finding is that ICS consistently matches SLS across both the isolate-delete and detach-delete graph variants tested.

Lu: That result is significant because it shows that the composition choices in their framework actually align with the intended application semantics for these structures. Tom It means we can trust our models more when designing complex systems based on CRDTs, as long as we follow the framework's guidance.

Jane: So, it’s a systematic way to prototype and analyze CRDT behavior before you commit to a concrete distributed implementation. This paper is about making concurrency explicit and compositional through Datalog.

Lalam: It positions Datalog not just as a programming language but as a foundation for prototyping and analyzing complex CRDTs and their compositions.

Tom: So, the main point is that they give us an executable way to define what we want the system to do at every step of its operation context.

Conclusion: Tom: So, looking at "A Datalog Framework for Conflict-Free Replicated Data Types" by Yanakieva, Bieniusa, and Dumbrava, the key takeaway is this declarative approach to modeling CRDT semantics using Datalog. Jane In simple terms, it means we can use logic programs to define exactly what our data structures should look like under different concurrent updates without having to write the messy distributed code from scratch.

Lu: It’s about moving from hoping your implementation works correctly to having a formal, analyzable specification that you can test rigorously against. Tom The implication is that for anyone building systems with replicated state, this framework gives them a way to reason about how different data structures combine safely.

Jane: They're showing us that the composition choices we make shouldn't just be arbitrary; they have measurable impacts on the final application state, and this framework helps map those impacts out. Lalam It provides a structured way to explore those non-obvious concurrency behaviors that can sneak up on you in large systems.

Tom: So, the authors are giving us a tool to bridge the gap between abstract requirements and concrete implementations for CRDTs by using Datalog as their foundation.

Jane: It’s about making sure that when we build things collaboratively, the merging process is predictable because we can formally check it against our original intent.

RPTU University Kaiserslautern-Landau · ENSIIE, Inria Paris, IRIF, SAMOVAR (Télecom SudParis)

cs.DC, cs.DB, cs.LO, cs.PL

Submitted: 2026-05-29

Updated: 2026-06-08

Comments: Paper presented at the 42nd International Conference on Logic Programming (ICLP 2026), Lisbon, Portugal, July 20 to July 23, 2026

Code: https://github.com/elly-yanakieva/CRDTLo

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 100/100

The gist: A Datalog Framework for Conflict-Free Replicated Data Types introduces a declarative framework in Datalog for specifying and reasoning about conflict-free replicated data types (CRDTs) and CRDT-based…

Key concepts

CRDTs
Conflict-Free Replicated Data Types are data structures designed to be replicated across multiple computers. They allow concurrent updates to the same data without conflicts, ensuring all replicas eventually converge to the same state, which is crucial for distributed systems.
Datalog
Datalog is a declarative logic programming language used here. It allows developers to express complex rules and relationships over data (like events and visibility) in a concise, mathematical way. This makes it ideal for formally defining the semantics of CRDT operations.
SLS vs ICS
Specification-Level Semantics (SLS) is the abstract definition of what the application *should* do. Implementation-Level Compositional Semantics (ICS) is how that definition translates into concrete, executable rules within the Datalog system. The framework proves these two approaches are equivalent for certain structures.
CRDT Composition
This involves defining transformation rules that map high-level application operations onto the necessary updates for individual CRDT components. This mechanism shows that how you decompose a structure (like Map⟨Set⟩) directly affects which component updates conflict and how those conflicts are resolved.

Terminology

Summary

A Datalog Framework for Conflict-Free Replicated Data Types introduces a declarative framework in Datalog for specifying and reasoning about conflict-free replicated data types (CRDTs) and CRDT-based applications, making concurrency explicit and compositional. p. 0

Where the paper says it

We introduce a declarative framework for specifying and reasoning about the semantics of conflict-free replicated data types (CRDTs) and CRDT-based applications in Datalog. The framework models CRDT semantics as executable logic programs over operation contexts, making concurrency explicit and compositional, and thus amenable to automated analysis.

Framework Design

The framework models CRDT semantics as executable logic programs over operation contexts, making concurrency explicit and compositional. It proposes a workflow where developers first write a declarative, executable reference specification of the application semantics and then construct an implementation via CRDT composition Datalog is central to this work because it provides a concise and declarative way to express CRDT semantics as relations over events and visibility. p. 1

Where the paper says it

To avoid unintended behavior, developers need to be able to state the intended semantics of an application independently of a particular CRDT design. We propose a workflow in which developers first write a declarative, executable reference specification of the application semantics and then construct an implementation via CRDT composition.

CRDT Encoding in Datalog

The work implements the framework in CRDTLog, a Datalog-based system built on the Souffl´e engine. The encoding of basic CRDT semantics is done by expressing them as Datalog rules that derive output relations representing the observable state at the end of the operation context. p. 6

Where the paper says it

2 CRDT Encoding in Datalog In Section 2, we introduced declarative semantics for basic CRDTs, such as the add-wins set (Eqn. We express these semantics as Datalog rules that derive output relations representing the observable state at the end of the operation context.

For example, add-wins set semantics is encoded using Datalog rules to compute hasV(X) over the operation context. p. 5
Where the paper says it

2: Example operation context for an add-wins set and its Datalog encoding. Datatype Update operations Query operations Set add(v), del(v) hasV(v) Map⟨Set⟩ upd(k,add(v)), upd(k,del(v)), rmv(k) hasKV(k,v) Graph addN(n), rmvN(n), addE(n,m), rmvE(n,m) hasN(n), hasE(n,m) Table 2: Summary of datatype operations.

Compositional Semantics

The framework supports nested and composite CRDTs by defining transformation rules that map application operations to component operations. For instance, the Map⟨Set⟩ structure is defined by specifying a SLS and an ICS through transformation rules that map each application event to one or more component updates CRDT composition is shown as not being semantics-neutral, as decomposition choices determine which operations conflict and how conflicts are resolved. p. 9

Where the paper says it

, separate nodesEvent and edgesMapSetEvent relations) as it maps directly to the formal definitions in Section 2 and makes the correspondence between the specification-level and implementation-level semantics transparent for verification. CRDT composition is not semantics-neutral: decomposition choices determine which operations conflict and how conflicts are resolved.

Experimental Validation

The framework is evaluated on two directed graph variants, the isolate-delete (ID) graph and the detach-delete (DD) graph Correctness is assessed via property-based testing, where semantic equivalence between abstract specifications and composite realizations is verified. The results show that ICS consistently matches SLS across all test configurations for both graph variants. p. 8

Where the paper says it

Listing 4: SLS semantics of isolate-delete graph. The next step is to derive the implementation-level compositional semantics (ICS) by choosing a CRDT decomposition and defining transformation rules (Definition 2).

Scalability Analysis

The scalability experiments analyze how semantic evaluation cost scales with operation context size, concurrency, and application graph size. The results indicate that ICS becomes consistently faster than SLS for larger graphs because decomposition yields smaller relations with localized joins rather than complex guard predicates over the entire event Concurrency and event scalability are driven primarily by the number of events in the operation context. p. 0

Where the paper says it

To the best of our knowledge, this is the first work to systematically use Datalog as a foundation for prototyping and analyzing complex CRDTs and their compositions. We evaluate our methodology using a collaborative graph data editing case study and report experimentation results assessing correctness validation and scalability with an increasing number of operations and replicas.

Conclusions and Future Work

CRDTlog is introduced as a declarative framework for specifying and reasoning about CRDT semantics over operation contexts, cleanly separating specification-level semantics (SLS) from implementation-level compositional semantics (ICS) via CRDT composition and transformation rules Future work includes formalizing CRDTlog in a theorem prover to enable machine-checked proofs of additional semantic properties. The paper concludes that ICS consistently outperforms SLS for both graphs, making it well suited for large-scale testing and semantic prototyping. p. 2

Where the paper says it

CRDTLog provides a library of declarative specifications for basic, nested, and composite CRDTs, as well as tools to generate operation contexts and compare semantic outcomes. To the best of our knowledge, this is the first work to systematically use Datalog as a foundation for prototyping and analyzing complex CRDTs and their compositions.

Appendix Details

The appendix provides detailed quantitative results of the semantic equivalence tests between specification-level semantics (SLS) and implementation-level compositional semantics (ICS) for both graph variants Appendix B presents formal proofs that both the SLS and ICS of the detach-delete graph preserve the no-dangling-edges invariant under all valid operation contexts Lemma 3 states that for the SLS of the DD graph, the invariant of no dangling edges holds for any valid operation context.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Declarative Semantic Specification Framework: The system can be improved by using a declarative framework to specify application semantics independently of a particular CRDT design, allowing developers to state the intended semantics of an application independently of a particular CRDT design and then construct implementations via CRDT composition.

  2. Systematic Testing for Compositional Correctness: The improved system can perform systematic testing by checking whether a composite realization converges to the same state as the reference specification using property-based testing, enabling designers to explore alternative CRDT decompositions, and verify that the chosen design matches the intended behavior.

  3. Automated Conflict Analysis: By modeling CRDT semantics as executable logic programs over operation contexts, the system can make concurrency explicit and compositional, and thus amenable to automated analysis, which allows for systematic exploration of corner cases and property-based equivalence checks.

  4. Semantic Equivalence Validation: The system can rigorously validate correctness by comparing the specification-level semantics (SLS) against the implementation-level compositional semantics (ICS) across generated executions to confirm SLS ≡ ICS, providing empirical evidence that CRDT compositions faithfully realize the intended semantics.

  5. Compositional Choice Guidance: The framework can guide designers in choosing CRDT decompositions by exposing where decomposition choices determine which operations conflict and how conflicts are resolved, helping users navigate the trade-offs between different component structures.

Abstract

Distributed applications increasingly support local-first collaboration over shared data, allowing multiple users to perform updates concurrently without global coordination. Such collaboration requires careful design to capture the intended semantics of the concurrent interactions. We introduce a declarative framework for specifying and reasoning about the semantics of conflict-free replicated data types (CRDTs) and CRDT-based applications in Datalog. The framework models CRDT semantics as executable logic programs over operation contexts, making concurrency explicit and compositional, and thus amenable to automated analysis. As one application, we use property-based testing to compare implementations. To the best of our knowledge, this is the first work to systematically use Datalog as a foundation for prototyping and analyzing complex CRDTs and their compositions. We evaluate our methodology using a collaborative graph data editing case study and report experimentation results assessing correctness validation and scalability with an increasing number of operations and replicas.

Related papers