• Write a complete prolog with your own facts using the relation: – Like(Person,Food). • Define the...

70.2K

Verified Solution

Question

Programming

• Write a complete prolog with your own facts using therelation: – Like(Person,Food).

• Define the following rule: –

Two persons are friends if they like the same food.

• Now find:

– All people who like more than one food.

– All food liked by two people – All friends

• likes(sarah, pizza).

• likes(sarah, saleeg)

. • likes(sarah, bread)

. • likes(farah, rice).

• likes(rana, burger)

. • likes(rana, saleeg).

Answer & Explanation Solved by verified expert
4.1 Ratings (565 Votes)
Given relation is likesPerson Food it can be read as Person likes Food For example If the given fact for given relation is likessarah pizza then it means that sarah likes pizza Rule for Two persons are    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students