1trace_append(R, S, T) :- tappend(R, S, T). 2trace_append(R, S, T) :- tappend(S, R, T). 3 4tappend([], X, X). 5tappend([A|R], [B|S], T) :- 6 opposite(A, B), 7 !, 8 trace_append(R, S, T). 9tappend([A|R], [B|S], [A|T]) :- 10 trace_append(R, [B|S], T). 11 12opposite(X, -X). 13opposite(-X, X). 14 15 16stripped(-(A), A) :- !. 17stripped(A, A)