Unification problem in Prolog

Gite
Gite used Ask the Experts™
on
When I type
foo(a,X)=foo(Y,b).
 in the listener, I get X=b and Y=a.
However, if I create a clause
foo(a,X).
and type
foo(Y,b). in the listener, Unification doen't occur, and I get no as an answer.
I am using Amzi Prolog with the Eclipse interface.
What is wrong?
Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
John TsioumprisSoftware & Systems Engineer

Commented:
Prolog is hard and dead ... probably you will get better support if you post the whole  program...

Author

Commented:
Following your answer, I wrote a test program with only 1 clause
foo(a,X).
and it worked.
However I have another problem of the same nature with another predicate.
If I type
matchsPotJoueur(J1,[],[])=matchsPotJoueur(1,[],X).
in the listener, I get
J1 = 1
X = '[]'

as an answer.
On the other hand, if my test program contains only 1 clause
matchsPotJoueur(J1,[],[]).
and I type
matchsPotJoueur(1,[],X).
in the listener, I get
no
as an answer.
Why is that?
Here is the test program attached
Thanks
test.pro

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial