Baby Steps in ProLog

http://www.learnprolognow.org/

The family tree program:

%fathers
father(alfred,eileen).
father(alfred,jim).
father(alfred,steve).
father(alien,alfred).
father(becks,evelyn).
father(charlie,harvey).
father(charlie,janine).
father(charlie,karen).
father(charlie,robert).
father(han,charlie).
father(homer,jean).
father(steve,james).
father(steve,michael).
father(steve,stephanie).
father(jim,ollie).

%females
female(becks).
female(eileen).
female(evelyn).
female(janine).
female(jean).
female(karen).
female(leia).
female(marge).
female(ripley).
female(stephanie).
female(sue).

%males
male(alfred).
male(alien).
male(charlie).
male(han).
male(harvey).
male(homer).
male(james).
male(jim).
male(michael).
male(posh).
male(robert).
male(steve).
male(ollie).

%mothers
mother(evelyn,eileen).
mother(evelyn,jim).
mother(evelyn,steve).
mother(jean,harvey).
mother(jean,janine).
mother(jean,karen).
mother(jean,robert).
mother(karen,james).
mother(karen,michael).
mother(karen,stephanie).
mother(leia,charlie).
mother(marge,jean).
mother(posh,evelyn).
mother(ripley,alfred).

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

grandparent(X,Y):-father(X,Z),parent(Z,Y).
grandfather(X,Y):-father(X,Z),parent(Z,Y).
grandmother(X,Y):-mother(X,Z),parent(Z,Y).
grandchild(X,Y):- grandparent(Y,X).
granddaughter(X,Y):- grandparent(Y,X),female(X).
grandson(X,Y):- grandparent(Y,X),male(X).

uncle(X,Y):- grandfather(Z,Y),male(X),parent(Z,X),not(parent(X,Y)).
aunt(X,Y):- grandfather(Z,Y),female(X),parent(Z,X).

son(X,Y):- parent(Y,X), male(X).
daughter(X,Y):- parent(Y,X), female(X).
sibling(X,Y):- parent(Z,Y),parent(Z,X),not((X=Y)). % same parents, not the same person
cousin(X,Y):- grandfather(Z,X), grandfather(Z,Y), not(sibling(X,Y)),not((X=Y)). % same grandfather, not a sibling, not the same person

The language thingy:

s_det(the).
p_det(the).
s_det(a).
p_det(those).

s_noun(man).
s_noun(woman).
s_noun(ball).

p_noun(men).
p_noun(women).
p_noun(balls).

verb(run).
verb(swim).
verb(throw).

adjective(strong).
adjective(green).
adjective(lovely).

nounPhrase(X,Y):- det(X), noun(Y).
sentence(X,Y,Z):- nounPhrase(X,Y),verb(Z).