:- module(_, _).

% Prolog execution rules / search tree / debugger

grandparent(C,G) :-
    parent(C,P),
    parent(P,G).

parent(C,P) :- 
    father(C,P).
parent(C,P) :- 
    mother(C,P).

father(charles, philip).
father(ana, george).

mother(charles, ana).

% Try:
% ?- grandparent(charles,X).

% Run it in the debugger (C-c d, or see menu above)
% to follow the execution step by step!
