Skip to content

adamjstewart/prolog

Repository files navigation

prolog

Build Status Coverage Status Documentation Status

An implementation of Prolog written in OCaml

Dependencies

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

Installation

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

Testing

To run the test-suite, simply run make test:

$ make test

Coverage

To generate and view the coverage reports in your web browser, simply run make coverage:

$ make coverage

Documentation

To build the documentation, simply run make docs:

$ make docs