Add elements dynamically to an initially empty list recursively

Since I don’t know how to construct the particular P and R for your code, here is something that I hope is similar enough to your need that will help.

sum_list([H|T],R) :-
    sum_list(T,R0),
    plus(H,R0,R).
sum_list([],0).

Examples

?- sum_list([],R).
R = 0.

?- sum_list([1],R).
R = 1.

?- sum_list([1,2],R).
R = 3.

?- call(sum_list,[],R).
R = 0.

?- call(sum_list,[1],R).
R = 1.

?- call(sum_list,[1,2],R).
R = 3.

Based on the predicate name doCallProve this looks like you could be trying to do proofs with Prolog. In the that case you might want to switch from the default reasoning of backward chaining in Prolog to forward chaining.

See:
Pfc – a package for forward chaining in Prolog
Pfc pack (forward chaining) – can’t get to work

HTH