Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Step 1 : Define the three relations using Relation ( ) Step 2 : Construct all the listed facts for each relation defined in Step

Step 1: Define the three relations using Relation ()
Step 2: Construct all the listed facts for each relation defined in Step 1 using the fact
Step 3: Define a method, food_flavor(x, y)that takes two parameters the first parameter for
flavor and the second for food type, and should return all the foods with the same flavor.
Step 4: Define a method, dish_to_like(person, what)
that takes two parameters a person's name and a parameter for what food the person likes
and returns what other options of food are recommended for that person.
Note: dish_to_like method will calls food_flavor method
You need to define all variables using var() and you need conde, run, and llal
methods.
3 EMAI-611: Programming for AI
Sample output:
When running the code based on the following print statement:
Output Sample 1:
print("Since Noor has liked Sausage, she/he would like:", run(0, what,
dish_to_like("Noor", what)))
Output Sample 2:
print("Since Dmitry has liked cookie, she/he would like:", run(0, what,
dish_to_like("Dmitry", what)))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

AS 1 2 /

Answered: 1 week ago

Question

a. How many different ethnic groups were portrayed in this show?

Answered: 1 week ago