Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/CertiGraph/CertiGraph

A library for verifying graph-manipulating programs. Powered by Coq and VST. Compatible with CompCert.
https://github.com/CertiGraph/CertiGraph

compcert coq graph-algorithms vst

Last synced: 7 days ago
JSON representation

A library for verifying graph-manipulating programs. Powered by Coq and VST. Compatible with CompCert.

Awesome Lists containing this project

README

        

# CertiGraph

A library for verifying graph-manipulating programs.

Powered by [Coq](https://coq.inria.fr) and [VST](https://vst.cs.princeton.edu/). Compatible with [CompCert](https://compcert.org/).

The [OVERVIEW](OVERVIEW.md) describes what it's for, and the [demo](demo) gives a brief tutorial introduction.

This version of CertiGraph is compatible with Coq 8.13 (and probably 8.14), CompCert 3.9, and VST 2.8.

## Contributors

* Aquinas Hobor
* Shengyi Wang
* Anshuman Mohan

## Papers

* [Functional Correctness of C Implementations of Dijkstra's, Kruskal's, and Prim's Algorithms](https://doi.org/10.1007/978-3-030-81688-9_37) (CAV 2021). Aquinas Hobor, Anshuman Mohan, Wei Xiang Leow.
* [Mechanized verification of graph-manipulating programs](https://www.comp.nus.edu.sg/~hobor/Teaching/SW-PhD.pdf) (Thesis). Shengyi Wang.
* [A Machine-Checked C Implementation of Dijkstra's Shortest Path Algorithm](https://www.comp.nus.edu.sg/~hobor/Publications/2020/CertifiedDijkstra.pdf). Aquinas Hobor, Anshuman Mohan, Shengyi Wang.
* [Certifying Graph-Manipulating C Programs via Localizations within Data Structures](https://doi.org/10.1145/3360597) (OOPSLA 2019). Aquinas Hobor, Shengyi Wang, Qinxiang Cao, Anshuman Mohan.

## Installing

The library can be installed using [opam](https://opam.ocaml.org/). Different packages are offered for different target architectures. You can install multiple targets side-by-side.

### `x86_64-linux`

```console
$ opam install ./coq-certigraph.opam
```

### `x86_32-linux`

```console
$ opam install ./coq-certigraph-32.opam
```

## Building without installing

It is possible to build CertiGraph without installing it as a library. This is useful if you simply want to check out the examples or if you want to hack on CertiGraph itself.

### `x86_64-linux`

First, make sure you have all of the dependencies.

1. This can be done via opam:
```console
$ opam install --deps-only ./coq-certigraph.opam
```

2. Alternatively, you can fetch and compile the dependencies by hand. In that case, be sure to edit the `CONFIGURE` file to specify the path to CompCert and/or VST.

3. Or, if your [Coq Platform](https://github.com/coq/platform) install includes CompCert and VST, then you may already have all the needed libraries.

Once the dependencies are in place you can perform the build:

```console
$ make clean
$ make depend
$ make -j4
```

### `x86_32-linux`

First, make sure you have all of the dependencies.

1. This can be done via opam:
```console
$ opam install --deps-only ./coq-certigraph-32.opam
```

2. Alternatively, you can fetch and compile the dependencies by hand. In that case, be sure to edit the `CONFIGURE` file to specify the path to CompCert and/or VST.

3. Or, if your [Coq Platform](https://github.com/coq/platform) install includes CompCert and VST, then you may already have all the needed libraries.

Once the dependencies are in place you can perform the build:

```console
$ make BITSIZE=32 clean
$ make BITSIZE=32 depend
$ make BITSIZE=32 -j4
```

## Developing within CertiGraph

1. Add your C source and clightgen output to the CertiGraph directory:
1. Write your `newfile.c` inside CertiGraph.
1. `path_to_clightgen/clightgen -DCOMPCERT -normalize -isystem . newfile.c`
1. Add `newfile.v` to the list of sources in `Makefile`
1. `make depend` (this is for every time you edit the makefile)
1. `make path_to_newfile/newfile.vo` (note the .vo)
1. Create the file `verif_newfile.v`. Now something like `Require Import CertiGraph.path.to.newfile.` will go through inside `verif_newfile.v`.