I'm trying to solve:
Given facts such as
- Bob is taller than Mike.
- Mike is taller than Jim
- Jim is taller than George
Write a recursive program that will determine that Bob's height is greater than George's.
My solution so far is:
taller_than(bob, mike).
taller_than(mike, jim).
taller_than(jim, george).
taller_than(X,Y):-
taller_than(X, Z),
taller_than(Z, Y).
It returns True as expected, but then I reach the stack limit. I'm guessing I need a base case, but I'm not sure what it would be? Is my solution otherwise correct?