Just started programming in Prolog. I wrote a couple of clauses.
predicates
parent(symbol,symbol)
male(symbol)
female(symbol)
mother(symbol,symbol)
father(symbol,symbol)
brother(symbol,symbol)
sister(symbol,symbol)
uncle(symbol,symbol)
clauses
parent(arthur,fred).
parent(arthur,george).
parent(arthur,bill).
parent(arthur,percy).
parent(arthur,ginny).
parent(arthur,ron).
parent(arthur,charlie).
parent(molly,fred).
parent(molly,george).
parent(molly,bill).
parent(molly,percy).
parent(molly,ginny).
parent(molly,ron).
parent(molly,charlie).
parent(rowling,arthur).
parent(rowling,james).
parent(james,harry).
parent(lily,harry).
female(molly).
female(ginny).
female(lily).
female(rowling).
male(X) if not(female(X)).
brother(X,Y) if male(Y),X<>Y,brother(Y,X).
brother(X,Y) if X<>Y,parent(Z,X),parent(Z,Y),male(X).
mother(X,Y) if parent(X,Y),female(X).
father(X,Y) if parent(X,Y),male(X).
sister(X,Y) if parent(Z,X),parent(Z,Y),female(X),X<>Y.
uncle(X,Y) if parent(Z,Y),brother(X,Z).
But when i am trying to ask question
brother(X,james)
It is showing Free variable in expression at X<>Y in line
brother(X,Y) if male(Y),X<>Y,brother(Y,X).
I am unable to trace what is the problem with the code