# Index of /besson/publis/Tiny-Prolog-in-OCaml.git/examples

Parent Directory  - Root of the website (in English or in French)
bunny.pl2018-03-23 10:13 228
dominos.pl2018-03-29 19:03 708
even.pl2018-03-23 10:11 36
family.pl2018-03-23 11:35 392
family_solution.pl2017-08-28 16:34 358
lists.pl2018-03-29 19:03 366
natural_integer_arithmetics.pl2018-03-23 10:19 691
natural_integer_arithmetics_nocomment.pl2018-03-23 10:37 349
odd.pl2018-03-23 11:29 36
tomandjerry.pl2018-03-19 16:51 109
```# This folder contains the examples code of [Tiny-Prolog-in-OCaml](https://github.com/Naereen/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)](XXX).

## List of examples
### Basic examples
- [`pair.pl`](pair.pl) defines a predicate `pair` on integer, using `o` as 0 and `s(X)` for `X+1`.
- [`impair.pl`](impair.pl) defines a predicate `pair` on integer, using `o` as 0 and `s(X)` for `X+1`.
- [`lapin.pl`](lapin.pl) is a fun small example on a family of bunnies.
- [`tomandjerry.pl`](tomandjerry.pl) is another fun small example on Tom and Jerry.

### Other examples
- [`famille.pl`](famille.pl) and [`genealogie.pl`](genealogie.pl) are two implementations of a same examples, the first one is as detailed as possible, and the other one is as concise as possible.
- [`nat.pl`](nat.pl) implements basic arithmetic operations on integers.
- [`domino.pl`](domino.pl) is the solution of a harder problem.

## How to run them?
- First, [build `prolog`](../prolog/)
- Then:

```bash
cd exemples
```

---