Program calculates combinations without repeated elements.
Source: Guide to Prolog Programming (on-line tutorial)
Program source code: combinations_without_repeated.pl
comb2(_,[]). comb2([X|T],[X|Comb]):-comb2(T,Comb). comb2([_|T],[X|Comb]):-comb2(T,[X|Comb]). % use ?-comb2([1,2,3,4],[X,Y]) to generate combinations with two elements.