logru 0.4.1

A small, embeddable and fast interpreter for a subset of Prolog.
Documentation
1
2
3
4
5
6
7
8
9
% Arithmetics test
is_natural(z).
is_natural(s(X)) :- is_natural(X).

add(X, z, X) :- is_natural(X).
add(X, s(Y), s(Z)) :- add(X, Y, Z).

mul(X, z, z) :- is_natural(X).
mul(X, s(Y), Z) :- mul(X,Y,W), add(X,W,Z).