domains
a=symbol
predicates
parent(a,a)
sex(a,a)
mother(a,a)
father(a,a)
brother(a,a)
son(a,a)
nephew(a,a)
grandma(a,a)
grandfa(a,a)
grandson(a,a)
clauses
sex(vyacheslav1,man).
sex(vladimir,man).
sex(gennady,man).
sex(vadim,man).
sex(kirill,man).
sex(vyacheslav2,man).
sex(natalia,woman).
sex(lyubov,woman).
sex(oksana,woman).
sex(polina,woman).
parent(gennady,vyacheslav1).
parent(gennady,lyubov).
parent(oksana,vladimir).
parent(oksana,natalia).
parent(vadim,gennady).
parent(vadim,oksana).
parent(kirill,gennady).
parent(kirill,oksana).
parent(vyacheslav2,vadim).
parent(vyacheslav2,polina).
mother(X,Y):-parent(X,Y),sex(Y,woman).
father(X,Y):-parent(X,Y),sex(Y,man).
brother(X,Y):-parent(Z,X),parent(Z,Y),sex(Z,man).
son(X,Y):-parent(Y,X),sex(X,man).
nephew(X,Y):-son(X,Z),brother(Z,Y).
grandma(X,Y):-parent(X,Z),parent(Z,Y),sex(X,woman).
grandfa(X,Y):-parent(X,Z),parent(Z,Y),sex(X,man).
grandson(X,Y):-parent(X,Z),parent(Z,Y),sex(Y,man).