% num(X) :- X je číslo.
num(0).
num(s(X)) :- num(X).

lt(0, s(Y)) :- num(Y).
lt(s(X), s(Y)) :- lt(X, Y).

leq(0, Y) :- num(Y).
leq(s(X), s(Y)) :- leq(X, Y).

leq2(X, X) :- num(X).
leq2(X, s(Y)) :- leq2(X, Y).

add(0, Y, Y) :- num(Y).
add(s(X), Y, s(Z)) :- add(X, Y, Z).

mul(0, Y, 0) :- num(Y).
mul(s(X), Y, Z) :- mul(X, Y, Z2), add(Y, Z2, Z).
