If an integers is defined like this in Prolog:
nat(0).
nat(s(X)) :- nat(X).
How do I convert such a number to a decimal number?
The input is for example:
s(s(s(0)))
I probably should add that I am very new to Prolog.
EDIT: I tried it this way:
nat(0).
nat(s(X)) :- nat(X).
convert(N, C) :-
C is C + 1,
nat(N),
convert(N, C).