Question: QUESTION 5 (25 Marks) Given the following relationships in Prolog clauses: father(X,Y) mother(X,Y) male(X) female(X) parent(X,Y) diff(X,Y) /* X is the father of Y */

QUESTION 5 (25 Marks) Given the following relationships in Prolog clauses: father(X,Y) mother(X,Y) male(X) female(X) parent(X,Y) diff(X,Y) /* X is the father of Y */ /* X is the mother of Y*/ /* X is male */ /* X is female */ /* X is a parent of Y */ /* X and Y are different */ Write Prolog clauses to define rules for the following relationships: is_mother(X) is father(X) is_son(X) sister_of(X,Y) grandpa_of(X,Y) sibling(X,Y) /* X is a mother */ /* X is a father */ /* X is a son */ /* X is a sister of Y */ /* X is a grandfather of Y */ /* X is a sibling of Y */ For example, given the rules for female, sibling, and parent, we could write a rule for aunt. aunt(X,Y) :- female(X), sibling(X,Z), parent(Z,Y). or aunt(X,Y) :- sister_of(X,Z), parent(Z,Y). /* if we had sister_of rule. */ Test your rules by entering some facts of family relationships
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
