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.
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
Related questions
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.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
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.Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning