%% ?- matches([[white, white], [blue, blue], [red, red]]). %% Yes matches([]). matches([Pair | Pairs]) :- Pair = [Item, Item], matches(Pairs).