/*horsdoeuvre*/ horsdoeuvre(artichauts). horsdoeuvre(crevettes). horsdoeuvre(oeufs). /*viande*/ viande(grilladedeboeuf). viande(poulet). /*poisson*/ poisson(loup). poisson(sole). /*dessert*/ dessert(glace). dessert(tarte). dessert(fraises). /*Liste des Calories*/ calories(artichauts, 150). calories(crevettes, 250). calories(oeufs, 200). calories(grilladedeboeuf, 500). calories(poulet, 430). calories(loup, 250). calories(sole, 200). calories(glace, 300). calories(tarte, 400). calories(fraises, 250). /*Fonctions*/ plat(X) :- viande(X). plat(X) :- poisson(X). repas(X,Y,Z) :- horsdoeuvre(X), plat(Y), dessert(Z). /* NE PAS METTRE TOUS LES ORDRES repas(X,Y,Z) :- horsdoeuvre(X), plat(Z), dessert(Y). repas(X,Y,Z) :- horsdoeuvre(Y), plat(X), dessert(Z). repas(X,Y,Z) :- horsdoeuvre(Y), plat(Z), dessert(X). repas(X,Y,Z) :- horsdoeuvre(Z), plat(X), dessert(Y). repas(X,Y,Z) :- horsdoeuvre(Z), plat(Y), dessert(Z). */ calorierepas(X,Y,Z,D) :- repas(X,Y,Z), calories(X,A), calories(Y,B), calories(Z,C), D is A+B+C. repas_equilibre(X,Y,Z) :- calorierepas(X,Y,Z,D), D @=< 900.