General
Material
Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5

Hint

father_of(X,Y) :- male(X),
                  parent_of(X,Y).
mother_of(X,Y) :- female(X),
                  parent_of(X,Y).

grandfather_of(X,Y) :- father_of(X,Z),
                       parent(Z,Y).
grandmother_of(X,Y) :- mother_of(X,Z),
                       parent(Z,Y).

sister_of(X,Y) :- female(X),
                  parent_of(Z,X),
                  parent_of(Z,Y).
brother_of(X,Y) :- male(X),
                   parent_of(Z,X),
                   parent_of(Z,Y).

aunt_of(X,Y) :- sister_of(X,Z),
                parent_of(Z,Y).
uncle_of(X,Y) :- brother_of(X,Z),
                 parent_of(Z,Y).
    

Back to the exercise.