Mercury 勉強メモ

関数論理型言語 Mercury を勉強するブログです.

P-99: 1.26 Generate the combinations of K distinct objects chosen from the N elements of a list

P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます.

["a", "b", "c"]
["a", "b", "d"]
["a", "b", "e"]
["a", "b", "f"]
["a", "c", "d"]
["a", "c", "e"]
["a", "c", "f"]
["a", "d", "e"]
["a", "d", "f"]
["a", "e", "f"]
["b", "c", "d"]
["b", "c", "e"]
["b", "c", "f"]
["b", "d", "e"]
["b", "d", "f"]
["b", "e", "f"]
["c", "d", "e"]
["c", "d", "f"]
["c", "e", "f"]
["d", "e", "f"]