%% checksame(Items) %% Check whether all the Items are the same %% checksame([+,+,+]). %% Yes %% checksame([+,+,-]). %% No checksame([Item|Thread]) :- checksame(Item,Thread). checksame(_,[]). %% checksame(Item,Items) %% Checks whether all the Items are the same as Item checksame(Item,[Item|Items]) :- checksame(Item,Items).