
% Identical to built-in predicate append/3, although it uses "cons"
% as a defined predicate, thus allowing trace-ability.

append(cons(S,X),Y,cons(S,Z)) :- append(X,Y,Z).
append(nil,X,X).

% WARNING: expess your queries with cons. e.g.
% ?- append(X,Y,cons(a,cons(b,cons(c, nil)))).
