You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-1Lines changed: 68 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,63 @@ Raven ships with a [library](lib/library/resource_algebra.rav) of standard resou
17
17
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.
18
18
19
19
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
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.
A [Visual Studio Code extension](https://github.com/nyu-acsys/raven-lang) for IDE integration is also available.
32
87
88
+
33
89
## Examples
34
90
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:
35
91
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
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`.
18
18
19
19
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:
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
58
66
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.
59
67
b. update the definition of `module Ext: ExtApi.Ext` to refer to the new instance `SampleExtInstance`.
60
68
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.
62
72
63
73
That's it!
64
74
- With the updated parser, Raven front-end will support the newly defined syntax.
0 commit comments