Given that I have entered the following facts into the factbase. Each sidedish has two ingredients:
maindish(thanksgiving, turkey).
sidedish(thanksgiving,pie).
ingredient(pie,spice).
ingredient(pie,sugar).
I have written the following rule to return the dishes for a given holiday:
meal(Holiday, [F1,F2]) :- maindish(Holiday,F1), sidedish(Holiday,F2).
?- meal(thanksgiving, Foods).
I am trying to write a rule called ingredientList
that will identify the type of ingredients needed for each holiday. By associating the dishes and ingredients for each given holiday.