The nrev procedure is tested with a list of fifty elements.
nrev([],[]). nrev([X|Y],Z) :- nrev(Y,Z1), append(Z1,[X],Z). append([],L,L). append([X|Y],L,[X|Z]) :- append(Y,L,Z).