このディレクトリの索引
%% TECHINIQUES OF PROLOG PROGRAMMING by T. Van Le, ph D.  %%

insertion_sort([],[]).
insertion_sort([H|T],L1) :-
    insertion_sort(T,L2),
    insert(H,L2,L1).

insert(X,[],[X]).
insert(X,[H|T],[X,H|T]) :- X =< H.
insert(X,[H|T],[H|T1]) :- X >H,insert(X,T,T1).