?- abs(-2,Y). ?- abs(Y,5). ?- abs(Y,-5). ?- abs(Y,5), Y<0. ?- abs(Y,Y).If there are multiple solutions have CLP(R) find them all.
sum(0,0). sum(N,S+N) :- N>0, sum(N-1,S).Give the derivation tree and simplified derivation tree for the goal sum(2,A).
What would happen if we changed the program to the following?
sum(0,0). sum(N,S+N) :- sum(N-1,S).