Dear Everyone:
I am a new starter,and make a programme: here are the code:
matchsort([H|T],YList,XList,[N|M]) :-
nth1(Index,YList,H),
write('******'),nl,write(H),nl,
nth1(Index,XList,N),
write(N),nl,write('------'),nl,
matchsort(T,YList,XList,M).
matchsort([],[],[],[]).
run with...