This folder contains the examples code of Tiny-Prolog-in-OCaml
A tiny implementation of a small subset of the Prolog language, in OCaml. With small and fun examples.
WARNING: this project only has an educational purpose, for a real-world use of Prolog, please refer to GNU Prolog (gprolog).
List of examples
Basic examples
- pair.pldefines a predicate- pairon integer, using- oas 0 and- s(X)for- X+1.
- impair.pldefines a predicate- pairon integer, using- oas 0 and- s(X)for- X+1.
- lapin.plis a fun small example on a family of bunnies.
- tomandjerry.plis another fun small example on Tom and Jerry.
Other examples
- famille.pland- genealogie.plare two implementations of a same examples, the first one is as detailed as possible, and the other one is as concise as possible.
- nat.plimplements basic arithmetic operations on integers.
- domino.plis the solution of a harder problem.
How to run them?
- First, build prolog
- Then:
cd exemples
../prolog/prolog ./pair.pl "pair(o)."  # load a theory and ask a question
:scroll: License ? 
This (small) repository is published under the terms of the MIT license (file LICENSE). © Lilian Besson, 2018.