%% note when things are refrigerated hasMealID(meal1,containerFn([mealType(spanishRice),containerID(container1),mealSize(cups(2))])). hasMealID(meal2,containerFn([mealType(potatoeAndSteakSoup),containerID(container2),mealSize(cups(4))])). hasMealID(meal3,containerFn([mealType(stirFry),containerID(container3),mealSize(cups(4))])). hasProperties(container1,[size(cups(2))]). hasProperties(container2,[size(cups(4))]). hasProperties(container3,[size(cups(4))]). atTime([2021-03-02,23:28:39],refridgerated(container1)). atTime([2021-03-02,23:28:39],refridgerated(container2)). atTime([2021-03-02,23:28:39],refridgerated(container3)). hasProperties(meal1,[consumed]). %% food lasts different durations in the fridge: are([spanishRice,potatoeAndSteakSoup,stirFry],mealTypes). %% foods with meat go bad sooner: containsIngredientOfType(stirFry,meat). containsIngredientOfType(potatoeAndSteakSoup,meat). hasDuration(stayInFridge,MealType,Duration) :- ( containsIngredientOfType(MealType,meat) -> Duration = days(2) ; Duration = days(4)). %% later find rules for how long things can stay in the freezer hasDuration(stayInFreezer,MealType,Duration) :- Duration = weeks(10). %% things that are larger take longer to thaw hasDuration(thawing,Container,Duration) :- Container = containerFn(List), argt(List,[mealSize(Size)]), ( Size = cups(N) -> ( N < 2 -> Duration = days(1) ; Duration = days(N)) ; fail). %% figure out what actions I should take on the basis of events? %% when should I move items from the freezer to the fridge? %% when should I move items from the fridge to the freezer? %% which items should I eat? %% which items should I move to the fridge in order to have meals