daughter(alice,queen_victoria,albert).
daughter(alix,alice,louis).
daughter(beatrice,queen_victoria,albert).
daughter(empress_victoria,queen_victoria,albert).
daughter(irene,alice,louis).
daughter(princess_alice,princess_helen,duke_leopold).
daughter(queen_victoria_of_spain,beatrice,prince_henry_of_battemberg).

ill(alexis).
ill(alfonso).
ill(duke_leopold).
ill(frederick).
ill(gonzalo).
ill(henry).
ill(leopold).
ill(maurice).
ill(rupert).
ill(waldemar).

son(alexis,alix,nicholas).
son(alfonso,queen_victoria_of_spain,king_alfonso).
son(duke_leopold,queen_victoria,albert).
son(frederick,alice,louis).
son(gonzalo,queen_victoria_of_spain,king_alfonso).
son(henry,irene,prince_henry_of_prussia).
son(leopold,beatrice,prince_henry_of_battemberg).
son(maurice,beatrice,prince_henry_of_battemberg).
son(prince_henry_of_prussia,empress_victoria,emperor_frederick).
son(rupert,princess_alice,n_n).
son(waldemar,irene,prince_henry_of_prussia).

well(albert).
well(emperor_frederick).
well(king_alfonso).
well(louis).
well(n_n).
well(nicholas).
well(prince_henry_of_battemberg).
well(prince_henry_of_prussia).

mother(X,Y):-daughter(Y,X,_).
mother(X,Y):-son(Y,X,_).

grandmother(X,Y):-mother(X,Z),mother(Z,Y).

ancestress(X,Y):-mother(X,Y).
ancestress(X,Y):-mother(X,Z),ancestress(Z,Y).
