
%parents(Child, Father, Mother).

parents(emil, arno, birgit).
parents(frida, chris, doris).
parents(gerd, chris, doris).
parents(ian, emil, frida).
parents(julia, emil, frida).
parents(klaus, gerd, helga).

% couple(X, Y) <=> X and Y are married, X is husband, Y is wife.
couple(arno, birgit).
couple(chris, doris).
couple(emil, frida).
couple(gerd, helga).
couple(klaus, lena).

% man(X) <=> X is a man
man(arno).
man(chris).
man(emil).
man(gerd).
man(ian).
man(klaus).

% woman(X) <=> X is a woman.
woman(birgit).
woman(doris).
woman(frida).
woman(helga).
woman(julia).
woman(lena).

father(X,Y) :-
	parents(X, Y, _).

mother(X,Y) :-
	parents(X, _, Y).

parent(X, Y) :-
	father(X, Y).
parent(X, Y) :-
	mother(X, Y).

grandparent(X, Z) :-
	parent(X, Y),
	parent(Y, Z).

person(X, m) :-
	man(X).
person(X, f) :-
	woman(X).

ancestor(X, Y) :-
	parent(X, Y).
ancestor(X, Z) :-
	parent(X, Y),
	ancestor(Y, Z).

