I do not get this...
So what I want as output is:
?- descendent(person3, person4, X).
X = c(c(person4)).
so if person3 is a descendent of person4 I can count all the c()
to know how much generations are between the two persons.
with my code I only know if a person is descendent of
another...
Hi,
I am learning prolog and I am not able to fullfill the following excercise:
1. I have a list of facts:
f(name0).
m(name1).
-> these are persons, f(x) means female, m(x) means male.
child_of(x,y).
-->x is a child of y.
2. I want to now if x is and descendent of y:
descendent(x,y) :-...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.