PREDICATES
 
father(string,string).
 
ancestor(string,string,string).
 
CLAUSES
 
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.