package prolect
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=390fa82ebd26bd25809572bbe44ee6ace7ee845f285a7b6b55ce668be3bde2b2
Description
A pretty basic interpreter for prolog with no support for integers, lists or anything other than pure logic
README
Prolect
An OCaml Derivation of the Warren Abstract Machine.
Language support is limited to pure Prolog i.e. predicate logic with Horn clauses.
This is a very simple & plain Prolog interpreter with no support for negation as failure, integers, lists, operators or built-in predicates.
Implementaion-wise, there is no tabling or memoization nor any type of term indexing. The core part of the interpreter is only ~100 LOC.
Usage
Install using the opam package manager:
opam install prolectThen run it, potentially with a consulting file:
prolect test.plLinux
If you don't want to use opam, download the .exe from GitHub releases, add the executable attribute (chmod +x prolect.exe), and then:
./prolect.exeOther OSes
If you don't want to use opam, download the .bc from GitHub releases, install the OCaml Runtime, and then:
ocamlrun prolect.bcCompile it yourself
If you don't want to use the bytecode interpreter either, you can compile the project yourself (e.g. for getting a performance boost on other OSes).
First, install the dependencies (ocaml, dune, etc.). Then:
dune exec prolect --profile releaseThe exe
To get the executable:
dune build . --profile releaseRun the REPL:
_build/default/bin/prolect.exeExample
Provided that you've given the test consulting file (i.e. running prolect test.pl instead of prolect):
Welcome to Prolect (version 1.1.3)
?- ancestor(terah, jacob).
true .
?- ancestor(terah, X).
X = sarah ;
X = abraham ;
X = isaac ;
X = jacob ;
X = isaac ;
X = ismael ;
X = jacob .
?- loves(sarah, X).
X = isaac ;
X = loves(sarah, isaac) ;
X = loves(sarah, loves(sarah, isaac)) .
?- ^CFuture plans
- Improve error handling
- Add files importing facilities
- Add term indexing
Dependencies (4)
- ppx_optcomp
-
linenoise
os != "win32" -
dune
>= "3.17" -
ocaml
>= "5.1"
Dev Dependencies (1)
-
odoc
with-doc
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building prolect with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 1.1.3 (this version) | n/a | n/a | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure