So this is my 2nd week learning prolog.
I wrote a function to calculate the sum of a list of numbers.
sum([], 0).
sum([Head |Tail], TotalSum) :-
sum(Tail, Sum1),
TotalSum is Head + Sum1.
So:
input: ?- (sum([4,3,-5],X))
output: X=2
However, the goal is get the absolute value of the sum of the...