Sample Prolog Program: grandmother.pl
grandmother(X, Y) :- mother(X, Z), parent(Z, Y).
parent(X, Y) :- mother(X, Y).
parent(X, Y) :- father(X, Y).
mother(mary, stan).
mother(gwen, alice).
mother(valery, gwen).
father(stan, alice).
Previous slide
Next slide
Back to first slide
View graphic version