View on GitHub

Rgref

Gradual Verification Through Rely-Guarantee References

Download this project as a .zip file Download this project as a tar.gz file

What are Rely-Guarantee References?

Rely-Guarantee references are a marriage of ideas from rely-guarantee reasoning to ideas from reference immutability.

The core ideas of the approach are to associate a rely relation and a guarantee relation with each reference. The guarantee limits the actions (side effects) that may be performed using that reference, and thus generalizes a family of type systems called reference immutability, where a mutability restriction is associated with each reference. The rely summarizes the guarantees of all possible aliases (an invariant preserved on the creation of any new alias).

These relations grant us two useful things:

  1. The guarantee provides fine-grained control over what mutation a function may perform on its arguments.
  2. The rely permits us to add to a reference a refinement predicate (logical formula) that must hold of a reference's referent. If a predicate is preserved by the rely relation (i.e. if it is true in one state, and there is another state related to the first by the rely relation, then it is true in the second state as well), then it is safe to assume that predicate holds in general because the actions possible through any other alias are subsumed by the rely. For more technical details, see Publications below.

There are three implementations of rely-guarantee references:

The Coq DSLs are implemented for Coq 8.4. The Liquid Haskell embedding requires a specific version of Liquid Haskell (see that page for details).

There's also an incomplete Agda implementation I can dig up by request.

Virtual Machine

For a virtual machine image (VirtualBox / .ova) containing the concurrent RGRef Coq DSL, the concurrent RGRef Liquid Haskell embedding, and all dependencies, click here (note: 2.7GB).

Notably, the VM includes:

All relevant commands (proofgeneral, coqtop, liquid, etc.) are on the default PATH when you open a terminal.

Publications

For (academic) descriptions of how RGRefs can be used, see:

The implementations contain examples not described in the above publications.

Support or Contact

If you have further questions or encounter technical difficulties, email @csgordon (csgordon@cs.drexel.edu).