General
Material
Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5

Tomorrow's lunch

This is tomorrow's ESSLLI lunchmenu:

Starters
green salad
melon
tomato salad
rabbit pate
Main dishes
rock salmon with mayonnaise and capers
roast beef with girolle mushroom sauce
pasta, courgette and cheese bake
Desert
cheese
yoghurt
Paris Brest pastry
You are allowed to take one starter, one main dish, and one desert.

Use the predicates starter/1, main/1, and desert/1 to represent tomorrow's options in Prolog.
Solution

If you are very hungry, you can have one starter, one main dish, and one desert. If you are not so hungry (or have a course right after lunch), you might want to only have a starter and a main dish or a desert and a main dish. If you are currently on a diet, it's probably wisest to only take a starter.

Define a predicate menu/4 which finds menus for you depending on whether you are hungry, not so hungry or on a diet. So, menu(Status,X,Y,Z) should be true if Status is hungry and X, Y, Z are a starter, a main dish, and a desert, respectively. It should also be true if Status is not_so_hungry, and either X is a starter, Y a main dish, and Z is nothing, or X is nothing, Y is a main dish, and Z is a desert. Finally, menu(Status,X,Y,Z) should be true if Status is on_diet, X is a starter and Y and Z are nothing.
Hint

Back to the practical session of day 1.