parent(pam,bob). parent(tom,bob). parent(tom,liz). parent(bob,ann). parent(bob,pat). parent(pat,jim). female(pam). female(liz). female(pat). female(ann). male(tom). male(bob). male(jim). offspring(X,Y):-parent(Y,X). mother(X,Y):-parent(X,Y),female(X). grandfather(X,Z):-parent(X,Y),parent(Y,Z),male(X). sister(X,Y):-parent(Z,X),parent(Z,Y),female(X).