Here are the facts that I have in my knowledge base (http://www.doc.gold.ac.uk/~mas02gw/prolog_tutorial/prologpages/recursion.html (Recursion Exercise 2)):
taller(bob,mike). % bob is taller than mike
taller(mike,jim). % mike is taller than jim
taller(jim,george). % jim is taller than george
Now I want to use recursion to deduce something that is obvious "bob" is taller than "george".
I tried to add this rule to solve this:
taller(X,Y) :- taller(X,Z),taller(Z,Y).
I need your help to make a stop condition to this recursion because now I have a stack overflow error:
| ?- taller(bob,george).
Fatal Error: local stack overflow (size: 8192 Kb, environment variable used: LOCALSZ)
Thanks