I'm trying to call a rule inside another rule my code is to fined the grandpa just like:
male(jack).
male(john).
male(mark).
parent(jack,john).
parent(john,mark).
father(X,Y):-male(X),parent(X,Y).
grandpa(X,Y):-father(X,father(F,Y)).
and the query in GNU Prolog is
grandpa(X,mark).
it just returns no
and when I tried to trace the call I noticed that it doesn't even call the nested rule.
So is there any way to do this in prolog?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…