SICStus 2.1 #6: Mon Dec 14 18:09:19 EST 2002 | ?- [user]. | append([],X,X). | append([Head|Tail],X,[Head|Rest]) :- append(Tail,X,Rest). | ^D {user consulted, 0 msec 480 bytes} yes | ?- append([a,b,c],[1,2,3],X). X = [a,b,c,1,2,3] ? yes | ?- trace. {The debugger will first creep -- showing everything (trace) yes {trace} | ?- append([a,b],[c,d],X) . 1 1 Call: append([a,b],[c,d],_97) ? 2 2 Call: append([b],[c,d],_276) ? 3 3 Call: append([],[c,d],_405) ? 3 3 Exit: append([],[c,d],[c,d]) ? 2 2 Exit: append([b],[c,d],[b,c,d]) ? 1 1 Exit: append([a,b],[c,d],[a,b,c,d]) ? X = [a,b,c,d] ? yes