|
| 1 | +# The Steel and Pulse separation logic system for F* |
| 2 | + |
| 3 | +## Contents of this package |
| 4 | + |
| 5 | +This binary package contains z3 4.8.5, F*, Karamel, Steel, Pulse, and |
| 6 | +(except on Windows) Pulse2Rust: |
| 7 | + |
| 8 | +* in `bin`: the executables for z3, F* and Karamel |
| 9 | + |
| 10 | +* in `lib/steel`: |
| 11 | + * the Steel F* modules of the `Steel` and `Steel.ST` namespaces |
| 12 | + * the Steel F* plugin, `steel.cmxs`, containing the Steel and Pulse |
| 13 | + tactics, and the Steel and SteelC extraction to krml, is installed |
| 14 | + here |
| 15 | + * the LibSteel C library, `libsteel.a`, containing an implementation of |
| 16 | + what used to be the Steel part of krmllib (currently binding the |
| 17 | + pthreads spinlock), is installed here |
| 18 | + |
| 19 | +* in `lib/steel/runtime`: the Steel OCaml runtime, |
| 20 | + `steel_runtime.cmxa`, necessary to compile and run Steel code |
| 21 | + extracted to OCaml, is installed here |
| 22 | + |
| 23 | +* in `lib/steel/pulse`: the Pulse F* modules of the `Pulse` namespace |
| 24 | + (except `Pulse.Lib`) |
| 25 | + |
| 26 | +* in `lib/steel/c`: the SteelC F* modules of the `Steel.C` and |
| 27 | + `Steel.ST.C` namespaces |
| 28 | + |
| 29 | +* in `include/steel`: the C include files necessary to compile Steel |
| 30 | + code extracted to C |
| 31 | + |
| 32 | +* in `share/steel`: `Makefile.include`, the GNU Make rules to verify |
| 33 | + Steel and Pulse code |
| 34 | + |
| 35 | +* in `share/steel/examples/pulse`: |
| 36 | + * in `lib`: the Pulse user library files (namespace `Pulse.Lib`) |
| 37 | + * in `_output/cache`: the corresponding `.checked` files |
| 38 | + |
| 39 | +* in `pulse2rust`: the executable for Pulse2Rust. (Absent from the |
| 40 | + Windows binary package) |
| 41 | + |
| 42 | +## Using Steel and Pulse |
| 43 | + |
| 44 | +### Writing a Makefile to verify Steel or Pulse code |
| 45 | + |
| 46 | +Steel and Pulse come with `share/steel/Makefile.include`, which contains the |
| 47 | +GNU Make rules to call F* with the Steel include path and the Steel/Pulse |
| 48 | +plugin loaded. |
| 49 | + |
| 50 | +1. Make sure the `bin` subdirectory is in your `PATH`. |
| 51 | + |
| 52 | +2. Define the `STEEL_HOME` environment variable to the root directory |
| 53 | + of this package. |
| 54 | + |
| 55 | +3. (Optional) In your Makefile, define the following variables with `+=` or `:=` : |
| 56 | + * `FSTAR_FILES`: some more F* files to verify, in addition to the |
| 57 | + `*.fst` and `.fsti` files of your project |
| 58 | + * `EXCLUDE_FILES`: some F* to skip for verification |
| 59 | + * `FSTAR_OPTIONS`: additional options to pass to F*. While |
| 60 | + `Makefile.include` is already configured to use Steel, you need |
| 61 | + to add more options if you need Pulse and/or SteelC: |
| 62 | + * if you want to use Pulse, add `--include $STEEL_HOME/lib/steel/pulse` |
| 63 | + * if you want to use SteelC, add `--include $STEEL_HOME/lib/steel/c` |
| 64 | + * `FSTAR_DEP_OPTIONS`: additional options to pass to F* to compute |
| 65 | + dependencies (in addition to `FSTAR_OPTIONS`), such as `--extract` |
| 66 | + * `FSTAR_ML_CODEGEN`: useful only if you want to extract OCaml |
| 67 | + code. If you want to extract a F* plugin, set this option to |
| 68 | + `Plugin`. Otherwise, it is set by default to `OCaml`. |
| 69 | + |
| 70 | +4. After those variable definitions, insert `include |
| 71 | + $STEEL_HOME/share/steel/Makefile.include` to your Makefile. |
| 72 | + |
| 73 | +5. In your project directory, run `make -j verify` |
| 74 | + |
| 75 | +### Calling F* directly |
| 76 | + |
| 77 | +If you already have an existing `Makefile` for your Steel- or |
| 78 | +Pulse-based project, you now need to pass new options to your Makefile |
| 79 | +to use Steel from this repository, as described in this section. |
| 80 | + |
| 81 | +To call F* with Steel or Pulse, pass the following options to F*: |
| 82 | +* in all cases, `--include $STEEL_HOME/lib/steel --load_cmxs steel` |
| 83 | +* if you want to use Pulse, add `--include $STEEL_HOME/lib/steel/pulse` |
| 84 | +* if you want to use SteelC, add `--include $STEEL_HOME/lib/steel/c` |
0 commit comments