https://github.com/adamjstewart/prolog
An implementation of Prolog written in OCaml
https://github.com/adamjstewart/prolog
ocaml prolog prolog-interpreter
Last synced: 9 months ago
JSON representation
An implementation of Prolog written in OCaml
- Host: GitHub
- URL: https://github.com/adamjstewart/prolog
- Owner: adamjstewart
- License: mit
- Created: 2017-11-29T17:25:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-30T17:14:03.000Z (about 3 years ago)
- Last Synced: 2024-12-29T18:42:16.544Z (over 1 year ago)
- Topics: ocaml, prolog, prolog-interpreter
- Language: OCaml
- Size: 277 KB
- Stars: 3
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# prolog
[](https://travis-ci.org/adamjstewart/prolog)
[](https://coveralls.io/github/adamjstewart/prolog?branch=master)
[](http://prolog.readthedocs.io/en/latest/?badge=latest)
An implementation of Prolog written in OCaml
## Dependencies
This project depends on the following OCaml libraries:
* [OCamlfind](https://opam.ocaml.org/packages/ocamlfind/) for finding dependent libraries
* [OCamlbuild](https://opam.ocaml.org/packages/ocamlbuild/) for building the project
* [OUnit](https://opam.ocaml.org/packages/ounit/) for unit testing
* [Menhir](https://opam.ocaml.org/packages/menhir/) for parser generation
* [Bisect_ppx](https://opam.ocaml.org/packages/bisect_ppx/) for coverage analysis
* [Bisect_ppx-ocamlbuild](https://opam.ocaml.org/packages/bisect_ppx-ocamlbuild/) for integration between Bisect_ppx and OCamlbuild
* [OCveralls](https://opam.ocaml.org/packages/ocveralls/) for uploading coverage reports to [Coveralls](https://coveralls.io/)
The recommended way to install these dependencies is with [OPAM](https://opam.ocaml.org/):
```
$ 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](https://pypi.python.org/pypi/Sphinx) for building the documentation
* [Sphinx_rtd_theme](https://pypi.python.org/pypi/sphinx_rtd_theme) for the HTML theme
* [Graphviz](http://www.graphviz.org/) for rendering the parser graph
* [LaTeX](https://www.latex-project.org/) for building a PDF version
The recommended way to install these dependencies is with [pip](https://pip.pypa.io/en/stable/):
```
$ 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
```