Let us go back to the network we have been studying in the previous few homework assignments. Only, this time, it is a social network involving people who are connected by a friend relation- ship, 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). Write the Prolog predicate friend of a friend(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., friend of a friend(X,X) should be false.

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter3: Designing A Page Layout: Creating A Website For A Chocolatier
Section3.2: Visual Overview: Page Layout Grids
Problem 6QC
icon
Related questions
icon
Concept explainers
Question
Let us go back to the network we have been studying in the previous few homework assignments. Only, this time, it is a social network involving people who are connected by a friend relation- ship, 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). Write the Prolog predicate friend of a friend(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., friend of a friend(X,X) should be false.
abi
cory
bea
dina
eva
gil
fei
Transcribed Image Text:abi cory bea dina eva gil fei
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Heuristic System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
A+ Guide To It Technical Support
A+ Guide To It Technical Support
Computer Science
ISBN:
9780357108291
Author:
ANDREWS, Jean.
Publisher:
Cengage,
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781305082168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Microsoft Windows 10 Comprehensive 2019
Microsoft Windows 10 Comprehensive 2019
Computer Science
ISBN:
9780357392607
Author:
FREUND
Publisher:
Cengage