could someone help me on transforming this code with appends into one using difference of list?
leaves(nil,[]). leaves(t(X,nil,nil),[X]) :- !. leaves(t(_,L,R)