append([],L,L).
append([H|T],A,[H|L]) :- append(T,A,L).

reverse([],[]).
reverse([H|T],A) :- reverse(T,R),
	            append(R,[H],A).

reverse2(L1,L2) :- reverse3(L1,[],L2).

reverse3([],R,R).
reverse3([H|T],R,I) :- reverse3(T,[H|R],I).
