father(tom,dick). mother(tom,judy). father(dick,harry). mother(dick,mary). father(jane,harry). mother(jane,mary). parent(X,P) :- mother(X,P). parent(X,P) :- father(X,P). granny(X,G) :- parent(X,Y), mother(Y,G). sibling(X,Y) :- mother(X,M), mother(Y,M), father(X,F), father(Y,F).