Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Prolog, suppose we have a predicate supervisor ( x , Y ) that is true just when x is the direct supervisor of Y

In Prolog, suppose we have a predicate supervisor (x,Y) that is true just when x is the direct supervisor of Y.
a) Define a predicate higherup (x,Y) that is true just when x is above or equal to Y in a chain of supervisors. For example if supervisor(a,b), supervisor(b,c) and supervisor(c,d) are true then higherup(a,a), higherup(a,b), higherup(a,c) and higherup(a,d) would all be true.
b) Define a predicate shared_boss (x,Y,Z) that is true just when Z is higherup than both x and Y.
c) Define a predicate closest_shared_boss (x,Y,Z) that's true just when Z is a shared_boss of x and Y and there is no W, distinct from Z, such that W is a shared boss of x, and Y and Z is higher up than W..
d) Draw a tree diagram of a hierarchy in which sup(a,b), sup(b,c), sup(c,d), sup(c,e), sup(e,f) are all true. Then explain how your rules for shared_boss would find all the shared bosses d and f. Also show how your rules would find the nearest shared boss of d and f.
image text in transcribed

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

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago