father(frank, jane). father(james, anne). father(john, frank). father(james, sarah). father(frank, tim). mother(anne, jane). mother(betty, frank). mother(anne, tim). parent(P, C) :- father(P, C). parent(P, C) :- mother(P, C). parents(C, M, F) :- mother(M,C), father(F,C). grandparent(G, C) :- parent(G, P), parent(P, C). sibling(A, B) :- parent(P, A), parent(P, B), A \== B. full_sibling(A, B) :- father(F, A), father(F, B), mother(M, A), mother(M, B), A \== B. orphan(C) :- \+ parent(_, C).