An implementation of Prolog written in OCaml
This project depends on the following OCaml libraries:
The recommended way to install these dependencies is with OPAM:
$ opam install ocamlfind
$ opam install ocamlbuild
$ opam install oUnit
$ opam install menhir
$ opam install bisect_ppx
$ opam install bisect_ppx-ocamlbuild
$ opam install ocveralls
Additionally, in order to build the documentation, the following dependencies are required:
The recommended way to install these dependencies is with pip:
$ pip install sphinx
$ pip install sphinx_rtd_theme
To build this project, simply clone the repository and run make
:
$ git clone https://github.com/adamjstewart/prolog.git
$ cd prolog
$ make
Afterwards, the interpreter can be run like so:
$ ./main.byte
Welcome to the Prolog Interpreter
> cat(tom).
> animal(X) :- cat(X).
> ?- animal(X).
====================
X = tom
====================
true
To run the test-suite, simply run make test
:
$ make test
To generate and view the coverage reports in your web browser, simply run make coverage
:
$ make coverage
To build the documentation, simply run make docs
:
$ make docs