I'm trying to test out recursion in prolog. Based on the KB and conditional statements below, I tried to make a recursive call and wanted to use the one specifically for "eastOf(X,Y) :- westOf(X,Z),eastOf(Z,Y)" The query I am using is "eastOf(ave,yonge)" which should use that recursive call and state that X is ave, Y is yonge and Z is collegePark. However the proglog program i am using current (ECliPSe) iss giving me this error "*** Overflow of the local/control stack! You can use the "-l kBytes" (LOCALSIZE) option to have a larger stack. Peak sizes were: local stack 11024 kbytes, control stack 120048 kbytes"
Find below my .pl file
eastOf(collegePark,yonge).
eastOf(sushi,eaton).
eastOf(X,Y) :- westOf(Y,X).
eastOf(X,Y) :- westOf(X,Z), eastOf(Z,Y).
westOf(ellington,yonge).
westOf(ryerson,sushi).
westOf(ave,collegePark).
westOf(X,Y) :- eastOf(Y,X).
westOf(X,Y) :- eastOf(X,Z), westOf(Z,Y).
eastOf(X,Y) :- westOf(X,Z), eastOf(Z,Y).isn't a good rule. It says thatXis east ofYifXis west ofZandZis east ofY. That's not necessarily true. - lurker