I have a family tree program in Prolog that contain next facts:
male(alex).
male(david).
male(peter).
etc
...
female(sofia).
etc
....
parent(alex, peter).
parent(sofia, peter).
etc
....
and some rules such as:
father(X, Y) :- parent(X, Y), male(X).
mother(X, Y) :- parent(X, Y), female(X).
etc
....
I need to find all fathers who has two or more children.
I think that I need to go through all fathers im my program, put their children to list and count it's length, then if >=2 I add this father to another list or just print him and go further.