father(a,e). father(a,f). father(c,g). father(c,h). father(e,i). father(h,j). father(h,k). father(h,l). mother(b,e). mother(b,f). mother(d,g). mother(d,h). mother(f,j). mother(f,k). mother(f,l). mother(g,i). male(a). male(c). male(e). male(h). male(i). male(l). female(b). female(d). female(f). female(g). female(j). female(k). brother(X,Y):- father(F,X), father(F,Y), X \= Y, male(X). parent(Parent,Child):-father(Parent,Child). parent(Parent,Child):-mother(Parent,Child). uncle(Uncle,Person) :- brother(Uncle,Parent), parent(Parent,Person). grand_parent(X,Y):- parent(X,Z), parent(Z,Y). grand_father(X,Y):- father(X,Z), parent(Z,Y).