let choices rf =
let r2ws r = rf;[r] in
let rec zyva rs = match rs with
|| {} -> { 0 }
|| r ++ rs ->
let wrs = r2ws r in
let rels = zyva rs in
let rec mapwrs wrs = match wrs with
|| {} -> {}
|| wr ++ wrs ->
let rec maprels rels = match rels with
|| { } -> {}
|| rel ++ rels ->
(wr ++ rel) ++ maprels rels
end in
maprels rels | mapwrs wrs
end in
mapwrs wrs
end in
zyva (range rf)