Program from the book (Queen Victoria's family): male(albert). male(edward). female(alice). female(victoria). parents(edward,victoria,albert). parents(alice,victoria,albert). sister_of(X,Y):- female(X), parents(X,M,F), parents(Y,M,F). ========================================================= HOMEWORK: Exercises 1.2, 1.3 and 1.4 from the book: Exercise 1.2 When the sister_of rule is applied to the database of part of Queen Victoria's family discussed previously, more that one answer can be obtained. Explain how all the answers can be obtained, and what they are. ========================================================= Exercise 1.3 This exercise has been inspired by one in Robert Kowalski's book Logic for Problem Solving, published by North Holland in 1979. Suppose someone has already written Prolog clauses that define the following relationships: father(X,Y) /* X is a father of Y */ mother(X,Y) /* X is the mother of Y */ male(X) /* X is male */ female(X) /* X is female */ parent(X,Y) /* X is a parent */ diff(X,Y) /* X and Y are different */ The problem is to write Prolog clauses to define the following relationships: is_mother(X) /* X is a mother */ is_father(X) /* X is a father */ is_son(X) /* X is a son */ sister_of(X,Y) /* X is a sister of Y */ granpa_of(X,Y) /* X is a grandfather of Y */ sibling(X,Y) /* X is a sibling of Y */ For example, we could write a rule for aunt, provided we were supplied with (or wrote) rules for female, sibling, and parent. aunt(X,Y):-female(X),sibling(X,Z),parent(Z,Y). This could also be written: aunt(X,Y):-sister_of(X,Z),parent(Z,Y). provided that we wrote the sister_of rule. ========================================================== Exercise 1.4 Using the sister_of rule defined in the text, explain why it is possible for some object to be her own sister. How would you change the rule if you did not want this property? Hint: assume that the predicate diff of Exercise 1.3 is already defined.