Here is my knowledge base:
a(b,c).
a(X,Y):-a(Y,X).
Here is my query: a(c,b).
I am using SWI-Prolog. I thought that this query would lead to the program printing "true". However, instead it prints "true" and continues to print true if I hit the semicolon... until FOREVER.
Why doesn't it stop?
My thoughts: First, X is bound to b and Y is bound to c. Then, Prolog tests a(b,c) and finds that this is true. Therefore, a(c,b) is true as well and SWI-Prolog should print true once. However, since it prints true forever as long as I keep hitting that semicolon, this leads me to think that something recursive is going on. Where is this happening? Help!
EDIT: More specifically my question is why does the program pause after each "true" and wait for me to press the semicolon or another key instead of just being done? If I have two predicates human(socrates) and mortal(X):-humans(X), the response to the query mortal(socrates) will be a single "true". (Sorry if I failed to make this clear above.)