CLAUSES
 
father(zeb, john_boy_sr).
father(john_boy_sr, john_boy_jr).
father(a, b).
father(b, c).
 
ancestor(X, Y, Z):- father(X,Y), father(Y, Z).
 
GOAL
 
ancestor(X, Y, Z), write(X,”-”,Y,”-”,Z),nl.