count(List, X, Count) :- count_sub(List, X, 0, Count). count_sub([], _, N, N). count_sub([Head | Xs], X, N, Count) :- (Head == X -> N1 is N + 1; N1 is N), count_sub(Xs, X, N1, Count). % トランプの数は1〜13まで。 card(X) :- between(1, 13, X). % さやかのヒントにあてはまる(かつ、CardAはCardBより小さい)。 is_satisfy_sayaka_said(CardA, CardB) :- card(CardA), card(CardB), CardA =\= 1, CardB =\= 1, CardA =\= CardB, CardB mod CardA =:= 0.