I tried some basic example from a book and it makes "Out of local stack" error (I'll tell more after the code). here is the code:
edge(a,b).
edge(a,e).
edge(b,d).
edge(b,c).
edge(c,a).
edge(e,b).
tedge(Node1,Node2) :-
edge(Node1,SomeNode),
edge(SomeNode,Node2).
edge(X,Y) :- tedge(X,Y).
I tried for example to write query edge(a,b) and it returned true and then I entered ';' and it made the error. What's the problem here?
trace, you'll see what's happening. Why did you definededge(X,Y) :- tedge(X,Y).? It's bound to create a loop scenario sinceedge/2also defines facts whichtedge/2refers to. Just leave it attedge/2and querytedge(a,b).. - lurker