I came across this natural number evaluation of logical numbers in a tutorial and it\'s been giving me some headache:
natural_number(0). natural_number(s(N))
Here is another solution that works "both ways" using library(clpfd) of SWI, YAP, or SICStus
:- use_module(library(clpfd)). natsx_int(0, 0). natsx_int(s(N), I1) :- I1 #> 0, I2 #= I1 - 1, natsx_int(N, I2).