Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let us go back to the network we have been studying in the previous class. Only, this time, it is a social network involving people

image text in transcribed

Let us go back to the network we have been studying in the previous class. Only, this time, it is a social network involving people who are connected by a friend relationship, represented below: as Prolog code on the left, and a graphical representation on the right. Note that this friend relationship is symmetric, since, on the left, for each pair X,Y of people, if friend (X,Y), then friend (Y,X), and in the graphical representation on the right, the "edges" do not have direction. friend(abi,bea).friend(abi,cory).friend(bea,cory).friend(bea,dina).friend(cory,dina).friend(dina,eva).friend(dina,fei).friend(eva,fei).friend(fei,gil).friend(bea,abi).friend(cory,abi).friend(cory,bea).friend(dina,bea).friend(dina,cory).friend(eva,dina).friend(fei,dina).friend(fei,eva).friend(gil,fei). a) Write the Prolog predicate friendofafriend (X,Y) which is true when X has a friend who is a friend of Y. Note: that this does not preclude X from also being a friend of Y, but it does preclude X from being a friend of a friend of itself, i.e., friendofafriend (X,X) should be false. b) Use this friendofafriend predicate to list all of the people who are a friend of a friend of cory

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

Probability & Statistics For Engineers & Scientists

Authors: Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying

7th Edition

9789813131279, 130415294, 9813131276, 978-0130415295

Students also viewed these Databases questions

Question

Bachelors degree in Information Systems or Statistics

Answered: 1 week ago