separate(TaggedList,Food,Drink) :-
include(isFood,TaggedList,Food), % isFood/1 will be called for each element
include(isDrink,TaggedList,Drink). % same as above
isFood(eat()). % no need to be complex; just succeed if argument matches
isDrink(drink()). % same as above
separate(TaggedList,Food,Drink) :- include(isFood,TaggedList,Food), % isFood/1 will be called for each element include(isDrink,TaggedList,Drink). % same as above
isFood(eat()). % no need to be complex; just succeed if argument matches isDrink(drink()). % same as above