Program to sort using Bubble Sort.
swap([X,Y|List],[Y,X|List]) :- X > Y. swap([Z|List],[Z|List1]) :- swap(List,List1). printlist([]) :- nl. printlist([List|_]) :- write(" ",List), printlist(List)