Skip to content

Commit ae7d97e

Browse files
Revamped README, updated docker image
1 parent 5598650 commit ae7d97e

File tree

6 files changed

+94
-5
lines changed

6 files changed

+94
-5
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ WORKDIR /app
3838
COPY --from=build /home/opam/.opam/5.4/bin/z3 /usr/local/bin/z3
3939

4040
# Copy the compiled binary from the 'build' stage
41-
# The path usually looks like _build/default/<path_to_source>/main.exe
42-
COPY --from=build /home/opam/app/_build/default/bin/raven.exe ./raven
41+
COPY --from=build /home/opam/app/_build/default/bin/raven.exe /usr/local/bin/raven
42+
43+
4344

4445
# Copy repository of examples
4546
COPY --from=build /home/opam/app/test ./test
4647

4748
# Set the command to run raven
48-
ENTRYPOINT ["./raven"]
49+
ENTRYPOINT ["raven"]

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,63 @@ Raven ships with a [library](lib/library/resource_algebra.rav) of standard resou
1717
Raven's underlying meta-theory is based on the [Iris](https://iris-project.org/) separation logic framework. We simplify the Iris logic by carefully restricting its features (like higher-order quantification, impredicativity, and step-indexing). At the same time, we add complementary features like the higher-order module system to regain expressivity. The resulting logic is sufficiently expressive to verify complex concurrent algorithms, yet, amenable to robust SMT-based automation. The mechanization of Raven's program logic as an instance of the Iris framework is part of ongoing work.
1818

1919

20+
## Portable Usage (via Docker):
21+
We have made available a Docker image of Raven on DockerHub that can be directly executed without any installation, as follows:
22+
23+
```bash
24+
$ docker run --rm ekanshdeepgupta/raven
25+
Raven version 1.x.y
26+
Verification successful.
27+
```
28+
29+
This image comes pre-loaded with Raven's existing suite of examples. For example, we can run some existing examples:
30+
```bash
31+
$ docker run --rm ekanshdeepgupta/raven test/concurrent/lock/ticket-lock.rav
32+
Raven version 1.x.y
33+
Verification successful.
34+
35+
$ docker run --rm ekanshdeepgupta/raven --extension prophecy test/ext_prophecy/lazy_coin.rav
36+
Raven version 1.x.y
37+
Verification successful.
38+
39+
$ docker run --rm ekanshdeepgupta/raven test/ci/front-end/fail/tuple.rav
40+
Raven version 1.x.y
41+
[Error] File "test/ci/front-end/fail/tuple.rav", line 7, columns 20-22:
42+
7 | var zz: Int := x#2;
43+
^^
44+
Type Error: Index out of bounds.
45+
```
46+
47+
To examine these examples, we can run `cat` for example as follows:
48+
```bash
49+
$ docker run --rm --entrypoint cat ekanshdeepgupta/raven test/ci/front-end/bool_perm_ite.rav
50+
field f: Int
51+
52+
proc p(x: Ref) {
53+
inhale !true ? true : own(x.f, 1, 1.0);
54+
exhale true ? own(x.f, 1, 1.0) : true;
55+
}
56+
```
57+
The complete suite of Raven's examples can be browsed at [test](./test) in this repository.
58+
59+
To run Raven on your own example files, say ./my/local/prog.rav, you can run:
60+
```bash
61+
$ docker run --rm -it -v $(pwd):/app/data -- ekanshdeepgupta/raven "/app/data/my/local/prog.rav"
62+
```
63+
64+
To get our hands dirty, we can even access a shell inside the Docker image by executing:
65+
```bash
66+
$ docker run --rm -it --entrypoint /bin/bash ekanshdeepgupta/raven
67+
/app# raven --shh test/ci/back-end/inhale_exhale.rav
68+
Verification successful.
69+
70+
/app# cd /usr/local/bin
71+
z3 raven
72+
```
73+
74+
2075
## Installation
21-
Raven requires [`opam`](https://opam.ocaml.org/) (>= 2.1.0) as well as OCaml (>= 4.12.0) and various OCaml libraries. See [`dune-project`](dune-project) for the full list of dependencies. Raven and all its depdencies other than `opam` can be installed by running the following sequence of commmands.
76+
To install Raven locally, it requires [`opam`](https://opam.ocaml.org/) (>= 2.1.0) as well as OCaml (>= 4.12.0) and various OCaml libraries. See [`dune-project`](dune-project) for the full list of dependencies. Raven and all its depdencies other than `opam` can be installed by running the following sequence of commmands.
2277
```
2378
$ git clone https://github.com/nyu-acsys/raven.git
2479
$ cd ./raven
@@ -30,6 +85,7 @@ $ dune build; dune install; dune runtest
3085

3186
A [Visual Studio Code extension](https://github.com/nyu-acsys/raven-lang) for IDE integration is also available.
3287

88+
3389
## Examples
3490
Several examples of Raven programs can be found in the [test](test) folder. The [ci](test/ci) folder contains many small examples that can be used to learn Raven's syntax for specific features. Complete verified implementations of concurrent data structures can be found in the [concurrent](test/concurrent) folder. Here are a few notable ones to get started, in roughly increasing order of complexity:
3591
1. [spin_lock](test/concurrent/lock/spin-lock.rav)
@@ -39,6 +95,7 @@ Several examples of Raven programs can be found in the [test](test) folder. The
3995
1. [give-up template](test/concurrent/templates/give-up.rav)
4096
1. [bplustree](test/concurrent/templates/bplustree.rav)
4197

98+
4299
## Usage
43100
The Raven verifier can be executed on a file `test/concurrent/treiber_stack/treiber_stack_atomics.rav` as follows:
44101
```
@@ -56,6 +113,7 @@ Raven version 1.0.1
56113
Verification Error: This update may not be frame-preserving.
57114
```
58115

116+
59117
### Raven Verifier Manual
60118
```
61119
RAVEN(1) Raven Manual RAVEN(1)
@@ -123,3 +181,12 @@ COMMON OPTIONS
123181
--version
124182
Show version information.
125183
```
184+
185+
## Scientific Background
186+
187+
For a detailed discussion of the motivation and theory behind Raven, including empirical evaluation, please refer to our paper:
188+
189+
> **Raven: An SMT-Based Concurrency Verifier**
190+
> Ekanshdeep Gupta, Nisarg Patel, and Thomas Wies.
191+
> *In Computer Aided Verification (CAV), 2025.*
192+
> **DOI:** [10.1007/978-3-031-98668-0_4](https://doi.org/10.1007/978-3-031-98668-0_4)

bin/raven.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ let main () input_files no_greeting no_library typecheck_only lsp_mode base_dir
318318
}
319319
in
320320
let _ =
321+
(* [EXT] Overwriting which extensions are activated. *)
321322
Ext.overwrite_ext(Ext.module_map extension_mode);
322323
in
323324
try `Ok (parse_and_check_all config input_files) with

lib/ext/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ module SampleExt (Cont: ExtApi.Ext) : ExtApi.Ext
1717
These are higher-order modules that accept, as a parameter, another extension module implementing the `ExtApi.Ext` interface. This allows us to "stack" these extensions on top of each other, and conveniently adjust the exact set of features we want to support when we compile Raven. This happens in `lib/ext/ext.ml`.
1818

1919

20+
## Using Current Extensions
21+
22+
We have added two new optional extensions, Prophecy extension and ErrorCredits extension. These can be selected by using the new `--extension` command-line flag which takes one of three values: `default | prophecy | eris`. For example:
23+
24+
`raven --extension prophecy test/ext_prophecy/clairvoyant_coin.rav`
25+
`raven --extension eris test/ext_error-credits/ec_examples.rav`
26+
27+
2028
## Creating a New Extension
2129

2230
An extension typically consists of 3 files, and may contain a 4th file. For a new extension say `SampleExt`, these files are:
@@ -58,7 +66,9 @@ Once the programmer has created the extension such that it successfully compiles
5866
a. add a new module `SampleExtInstance` that instantiates `SampleExt` with an existing extension and introduce it into the chain of extensions. Typically, newer extensions should be added towards the end as the "outermost" instantiations.
5967
b. update the definition of `module Ext: ExtApi.Ext` to refer to the new instance `SampleExtInstance`.
6068

61-
5. Run `dune build; dune install` to compile Raven with the new extension.
69+
5. There is a function `Ext.overwrite_ext` that can be used to set which extensions are active. At present it is called from the `main` function in [raven.ml](../../bin/raven.ml). This can be modified to change which stack of extensions is active.
70+
71+
6. Run `dune build; dune install` to compile Raven with the new extension.
6272

6373
That's it!
6474
- With the updated parser, Raven front-end will support the newly defined syntax.

raven_docker.tar

0 Bytes
Binary file not shown.

test/ext_prophecy/rdcss.t

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
$ dune exec -- raven --shh --extension prophecy ./rdcss.rav
2+
[Warning] File "./rdcss.rav", line 617, column 8 to line 623, column 5:
3+
617 | ) : (
4+
^
5+
No witnesses could be computed for: token^6
6+
[Warning] File "./rdcss.rav", line 617, column 8 to line 623, column 5:
7+
617 | ) : (
8+
^
9+
No witnesses could be computed for: tid_ghost_winner^6
10+
Verification successful.

0 commit comments

Comments
 (0)