My bachelor thesis: a compiler from Datalog rules to OCaml type checker (standard or incremental)
The aim of CADL is to simplify the writing of a type checker (standard or incremental). You can input Datalog rules and CADL will output an OCaml type checker.
CADL needs:
- OCaml : 4.08.1
- Dune : 2.7.1
- OUnit2 : 2.2.3
To run this project you need to install:
apt install ocaml-nox # If you don't want X11 support.
apt install ocaml
add-apt-repository ppa:avsm/ppa
apt update
apt install opam
$ opam install dune
$ opam install ounit2
$ make
To clean the project tree:
$ make clean
You can generate a standard type checker with:
$ ./cadl <input-file>
examples for <input-file> are samples/input.pl and samples/spi.pl.
The compiled code will be located in 'generated.ml' file, inside 'generated/' module.
You can run your tests with:
$ ./cadl <input-file> -t <path-to-test-file-ml>
If you want to generate a module for Incremental Type Checking of MinCaml, you need to run:
$ ./cadl <input-file> -i
examples of working CADL generated module are Pierce and Spi calculus.