<div class="notebook"> <div class="nb-cell program" data-background="true" name="p1"> parent(harriet, george). parent(george, richard). parent(george, amelia). parent(george, susan). parent(matilda, richard). parent(matilda, amelia). parent(victoria, susan). parent(richard, sophie). parent(richard, joseph). parent(ellen, sophie). parent(ellen, joseph). parent(susan, charles). parent(walter, charles). male(arthur). male(george). male(richard). male(joseph). male(walter). male(charles). female(harriet). female(matilda). female(victoria). female(amelia). female(susan). female(ellen). female(sophie). grandparent(X, Z) :- parent(X, Y), parent(Y, Z). ancestor(X, Y) :- parent(X, Y). ancestor(X, Y) :- parent(X, Z), ancestor(Z, Y). father(X, Y) :- parent(X, Y), male(X). mother(X, Y) :- parent(X, Y), female(X). sibling(X, Y) :- parent(P, X), parent(P, Y), X \= Y. </div> </div>