An implementation of Prolog written in OCaml
This project depends on the following OCaml libraries:
- OCamlfind for finding dependent libraries
- OCamlbuild for building the project
- OUnit for unit testing
- Menhir for parser generation
- Bisect_ppx for coverage analysis
- Bisect_ppx-ocamlbuild for integration between Bisect_ppx and OCamlbuild
- OCveralls for uploading coverage reports to Coveralls
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:
- Sphinx for building the documentation
- Sphinx_rtd_theme for the HTML theme
- Graphviz for rendering the parser graph
- LaTeX for building a PDF version
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