| 1 | # Datalog
|
| 2 |
|
| 3 | The files in this directory are [Souffle](https://souffle-lang.github.io/)
|
| 4 | programs. We use them for to peform dataflow analyses on the Python -> C++
|
| 5 | translation.
|
| 6 |
|
| 7 | See the [Souffle Language Reference](https://souffle-lang.github.io/program) for
|
| 8 | details on how to write datalog.
|
| 9 |
|
| 10 | ## Installing Souffle
|
| 11 |
|
| 12 | ```
|
| 13 | deps/from_tar.sh download-souffle
|
| 14 | deps/from_tar.sh extract-souffle
|
| 15 | deps/from_tar.sh build-souffle
|
| 16 | ```
|
| 17 |
|
| 18 | ## Compiling a Souffle Binary
|
| 19 |
|
| 20 | You can compile a souffle program to fast native code with the `souffle_binary`,
|
| 21 | and `souffle_cpp` ninja rules. For example,
|
| 22 | `souffle_cpp('mycpp/datalog/call-graph.dl')` will produce C++ source at
|
| 23 | `prebuilt/datalog/call-graph.cc` and
|
| 24 | `souffle_binary('prebuilt/datalog/call-graph.cc')` will produce an executable
|
| 25 | called `_bin/datalog/call-graph`.
|
| 26 |
|
| 27 | See this [page from the Souffle docs](https://souffle-lang.github.io/execute)
|
| 28 | for details about how to run your program.
|
| 29 |
|
| 30 | ## Our Analyses
|
| 31 |
|
| 32 | TBD
|