sal: Multi-modal Verification of Replicated Data Types

This repository contains a port of various CRDTs and MRDTs from the Neem framework to Lean. It also comes equipped with a custom tactic called sal and a counterexample generation and visualization framework.

Steps to run

Clone this repository, and run lake update followed by lake build. Ensure that the Lean version in lean-toolchain stays at v4.26.0. The various proofs are in the Neem directory. Click on each Lean file in VS code to run all the verification conditions.

Data structures implemented and description

RDTdsimp + grindLean BlasterFallback to ITP
Increment-only counter MRDT2400
PN-counter MRDT2400
OR-set MRDT3210
Enable-Wins Flag MRDT9140
Efficient OR-Set MRDT2220
Grows-only set MRDT2400
Grows-only map MRDT2202
Replicated Growable Array MRDT1590
Multi-valued Register MRDT2400
Increment-only counter CRDT2400
PN-counter CRDT1626
Multi-Valued Register CRDT2400
OR-set CRDT4191

Counterexample generation using Plausible

Our implementation of the en-wins flag was erroneous, and it did not pass the inter_right_1op VC. Earlier, the counterexample needed to be worked out manually, but we can now automatically generate small counter-examples. The Plausible generator was used to generate minimal examples. The section of code can be checked out here. We prove that both the pre and post conditions are decidable under a suitable upper bound, and generate counter examples. Subsequently, we use Logging-style monads to derive the computation tree for the left and right hand sides of the ensures equality. This file shows the computation path logged as a list and the subsequent visualization in HTML.

Proofs generated using Harmonic's Aristotle

Subseqent attempts to verify the VCs which fallback to ITP were successful using the Aristotle framework. Now, all of the data structures mentioned in the table above have complete proofs.