I am trying to implement a recursive Prolog predicate that when given a all 0 list ResultList with Dim elements and another list with values up to Dim, it runs trough this second list and increments +1 to the nth Element of ResultList and returns ResultList, so far I have:
increment_list([],_).
increment_list([Element|Tail],ResultList):-
    nth1(Element,ResultList,_ is _+1),
    increment_list(Tail,ResultList).
So for example
?-increment_list([1,2,4,3,4],[0,0,0,0]).
Would return:
[1,1,1,2]
What I'm apparently having difficulty and confusion is how to increment the value, is it possible to do it without defining an extra predicate or having a singleton Variable?
_ is _+1inside a call tonth1/3is definitely not going to work. Remember that Prolog is going to unify these values, not compute them;is/2will perform arithmetic, but this expression wouldn't make sense much of anywhere because you are discarding the result of the addition. Also keep in mind Prolog is not going to evaluate expressions in-place. This is a core difference of Prolog. - Daniel Lyons