Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// ProLog Programming 7. Write a Prolog program to save the facts of that Alice and Bob know each other; Bob and Chris know each

// ProLog Programmingimage text in transcribed

7. Write a Prolog program to save the facts of that Alice and Bob know each other; Bob and Chris know each other; Chris and Dan know each other; Dan and Elaine know each other; Elaine and Frank know each other; Dan and Gang know each other; Gang and Henry know each other; Henry and Alice know each other. Add three logics 1st-degree connection People directly connected. For example, in the picture below, Alice and Bob are 1st-degree connection. 2nd-degree connection - People connected to their 1st-degree connections. For example, in the picture below, Bob and Dan are 2nd-degree connection. 3rd-degree connection - People connected to their 2nd-degree connections. For example, in the picture below, Alice and Dan are 3rd-degree connection. Then query (1) whether Alice and Elaine are 1st-degree connection or 2nd-degree connection. (2) whether Alice and Dan are 1st-degree connection or 2nd-degree connection or 3rd-degree connection. 7. Write a Prolog program to save the facts of that Alice and Bob know each other; Bob and Chris know each other; Chris and Dan know each other; Dan and Elaine know each other; Elaine and Frank know each other; Dan and Gang know each other; Gang and Henry know each other; Henry and Alice know each other. Add three logics 1st-degree connection People directly connected. For example, in the picture below, Alice and Bob are 1st-degree connection. 2nd-degree connection - People connected to their 1st-degree connections. For example, in the picture below, Bob and Dan are 2nd-degree connection. 3rd-degree connection - People connected to their 2nd-degree connections. For example, in the picture below, Alice and Dan are 3rd-degree connection. Then query (1) whether Alice and Elaine are 1st-degree connection or 2nd-degree connection. (2) whether Alice and Dan are 1st-degree connection or 2nd-degree connection or 3rd-degree connection

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions