Question: I need help in my project it is about a restaurant system the code should be written in prolog language (fact , rules , query)
I need help in my project it is about a restaurant system the code should be written in prolog language (fact , rules , query)
what we want to do is a small expert system that suggests a meal to the user based on his options.
Description:
The idea of the program depends on providing a varied list of good fast food meals. for example. burger meals and pizza meals for the user, in addition, providing a feature for making suggestions which recommends food menu based on user preferences. such as the system will ask the user some questions and based on the user answers the system will suggest to the user a meal
for example:
what kind of meal do you want?
-healthy
-regular
what type do you want?
-burger meal
-pizza meal
if the user choose burger the following question will be
do you want beef or chicken?
-beef
-chicken
if the user choose a heathy meal in the beginning and choose beef burger the system will suggest to the user
Juicy Grilled Cheeseburgers
kindly modify the following code or write a new code to match the above requirements. Also please provide more then 4 queries with comments.
% Facts
% Meals
meal(burger, beef).
meal(burger, chicken).
meal(pizza, pepperoni).
meal(pizza, veggie).
meal(side, fries).
meal(side, onion_rings).
meal(drink, soda).
meal(drink, water).
% Preferences
preference(beef, meat_lover).
preference(chicken, healthy_eater).
preference(pepperoni, pizza_lover).
preference(veggie, healthy_eater).
preference(fries, side_lover).
preference(onion_rings, side_lover).
preference(soda, drink_lover).
preference(water, healthy_eater).
% Rules
% Suggestions based on meal preference
suggestion(X, Y) :- preference(X, Y), meal(main_dish, X).
suggestion(X, Y) :- preference(X, Y), meal(side_dish, X).
suggestion(X, Y) :- preference(X, Y), meal(drink, X).
% Queries
% List all meals
?- meal(Type, Name).
% List all preferences
?- preference(Meal, Preference).
% Make a suggestion based on a preference
?- suggestion(Meal, Preference).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
