by Forrest Sheng Bao http://fsbao.net
I can't run sicstus Prolog on my department Solaris workstation. That makes me very unhappy at 3 am. So I decide to use gprolog. And the programming can be easier. In gprolog, FD is built-in.
Factorial in gprolog:
factorial(0,1). factorial(N,F) :- N>0, N1 is N-1, factorial(N1,F1), F is N * F1.
Summation in gprolog
sum(0,0). sum(N,F) :- N>0, N1 is N-1, sum(N1,F1), F is N + F1.
It seems that "is" is also a built-in predicate in swi-prolog.
I just do not understand why there is no pad sign in front of logic operators. This manual http://www.gprolog.org/manual/gprolog.html#htoc321 confuses me.