 
soma(N1,N2,N):-
	soma1(N1,N2,N,0,0,[0,1,2,3,4,5,6,7,8,9],_).

soma1([],[],[],0,0,D,D).
soma1([D1|N1],[D2|N2],[D|N],C1,C,Dig1,Dig2):-
	soma1(N1,N2,N,C1,C2,Dig1,Dig0),
	soma_dig(D1,D2,C2,D,C,Dig0,Dig2).

soma_dig(D1,D2,C1,D,C,Dig1,Dig0):-
	del(D1,Dig1,Dig2),
	del(D2,Dig2,Dig3),
	del(D,Dig3,Dig0),		
	S is D1+D2+C1,
	D is S mod 10,
	C is S//10.

del(A,L,L):- nonvar(A), !.
del(A,[A|L],L).
del(A,[B|L],[B|L1]):-del(A,L,L1).

t(X,Y,Z):- X=[D,O,N,A,L,D], Y=[G,E,R,A,L,D], Z=[R,O,B,E,R,T], soma(X,Y,Z).
