RosettaCodeData/Task/Combinations/Prolog/combinations-3.pro

4 lines
136 B
Prolog
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
:- use_module(library(clpfd)).
comb_lstcomp(N, M, V) :-
V <- {L & length(L, N), L ins 1..M & all_distinct(L), chain(L, #<), label(L)}.