%%%%%% 
%http://www.learnprolognow.org/lpnpage.php?pagetype=html&pageid=lpn-htmlse25
%

naiverev([],[]).
naiverev([H|T],R):-  naiverev(T,RevT),  append(RevT,[H],R).

rev(L,R):-  accRev(L,[],R).

accRev([H|T],A,R):-  accRev(T,[H|A],R). 
accRev([],A,A).