father(terach,abraham). father(terach,nachor). father(terach,haran). father(abraham,isaac). father(haran,lot). father(haran,milcah). father(haran,yiscah). female(sarah). female(milcah). female(yiscah). male(terach). male(abraham). male(nachor). male(haran). male(isaac). male(lot). mother(sarah,isaac). son(X, Y):- father(Y, X), male(X). son(X, Y):-mother(Y, X), male(X). daughter(X, Y):- father(Y, X), female(X). daughter(X, Y):-mother(Y, X), female(X). grandfather(X, Y):- father(X, Z), father(Z, Y). grandfather(X, Y):- father(X, Z), mother(Z, Y). grandmother(X, Y):- mother(X, Z), father(Z, Y). grandmother(X, Y):- mother(X, Z), mother(Z, Y). grandparent(X, Y):- parent(X, Z), parent(Z, Y). parent(X, Y):- father(X, Y). parent(X, Y):- mother(X, Y).