Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Combinations/Oz/combinations.oz
Normal file
16
Task/Combinations/Oz/combinations.oz
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
declare
|
||||
fun {Comb M N}
|
||||
proc {CombScript Comb}
|
||||
%% Comb is a subset of [0..N-1]
|
||||
Comb = {FS.var.upperBound {List.number 0 N-1 1}}
|
||||
%% Comb has cardinality M
|
||||
{FS.card Comb M}
|
||||
%% enumerate all possibilities
|
||||
{FS.distribute naive [Comb]}
|
||||
end
|
||||
in
|
||||
%% Collect all solutions and convert to lists
|
||||
{Map {SearchAll CombScript} FS.reflect.upperBoundList}
|
||||
end
|
||||
in
|
||||
{Inspect {Comb 3 5}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue