| 1 |
Small example using the Z3 ML bindings. |
| 2 |
|
| 3 |
To build the example execute |
| 4 |
make examples |
| 5 |
in the build directory. |
| 6 |
|
| 7 |
This will create ml_example and ml_example.byte in the build directory, which |
| 8 |
can be run in the build directory by calling |
| 9 |
LD_LIBRARY_PATH=. ./ml_example |
| 10 |
or |
| 11 |
LD_LIBRARY_PATH=. ./ml_example.byte |
| 12 |
for the byte-code version. |
| 13 |
|
| 14 |
If Z3 was installed into the ocamlfind package repository (see |
| 15 |
src/api/ml/README), then we can also compile this example as follows: |
| 16 |
|
| 17 |
ocamlfind ocamlc -o ml_example.byte -thread -package z3 -linkpkg ml_example.ml |
| 18 |
or |
| 19 |
ocamlfind ocamlopt -o ml_example -thread -package z3 -linkpkg ml_example.ml |
| 20 |
|
| 21 |
Note that the resulting binaries depend on the shared z3 library |
| 22 |
(libz3.dll/.so/.dylb), which needs to be in the PATH (Windows), LD_LIBRARY_PATH |
| 23 |
(Linux), or DYLD_LIBRARY_PATH (macOS). |