Text: THIS IS A PROLOG QUESTION:
The following KB includes some facts about the hierarchy of an
organization.
reports(X,Y) means X reports to Y.
% Facts:
reports(john, mary).
reports(mary, ann).
reports(ann, michelle).
Write a rule boss(X,Y) which means X is
Y's boss as follows:
X is Y's boss if Y reports to X. For instance, mary is john's
boss according to the facts.
X is Y's boss if X is Z's boss and Y reports to Z. For
instance, ann is john's boss and michelle is everybody else's boss
according to the facts.
Write the Prolog rule boss(X,Y) in
the provided field. Hint: You may need
to use recursion to write this rule.