here is the addition code for two input( like we want the result in Z if X+1 plus Y have Z+1 for a result).
natural_number(0).
natural_number(s(X)) :- natural_number(X).
pl(0,X,X) :- natural_number(X).
pl(s(X),Y,s(Z)) :- pl(X,Y,Z).
But I wonder that can we use the similar code for 3 components like
pl(s(0),s(s(0)),s(s(s(0))),W)
and got a result W = s(s(s(s(s(s(0))))))
Thank you in advance.