parent_of(bill, [jim, albert]).
parent_of(jane, '.'(jim, '.'(albert, []))).
parent_of(jim, [alice, fred, john]).

male(bill).
male(jim).
male(albert).
male(fred).
male(john).

female(jane).
female(alice).

father_of(F, Ch):-
	parent_of(F, List), member(Ch, List), male(F).

grandfather_of(Gf, Gc):-
	parent_of(Gf, List1), member(Ch, List1),
	parent_of(Ch, List2), member(Gc, List2),
	male(Gf).

member(X, [X|_]).
member(X, [_|T]):-member(X, T).

