# Prolog Confusion

This is a discussion on Prolog Confusion within the Tech Board forums, part of the Community Boards category; I have the following Prolog program. Code: male(jim). male(pat). male(bob). female(alice). female(diane). single(jim). single(pat). single(alice). married(bob). married(diane). parent(bob,jim). parent(bob,pat). parent(bob,alice). ...

1. ## Prolog Confusion

I have the following Prolog program.

Code:
```male(jim).
male(pat).
male(bob).
female(alice).
female(diane).

single(jim).
single(pat).
single(alice).

married(bob).
married(diane).

parent(bob,jim).
parent(bob,pat).
parent(bob,alice).
parent(diane,jim).
parent(diane,pat).
parent(diane,alice).

mother(X,Y) :- female(X), parent(X,Y).
father(X,Y) :- male(X),   parent(X,Y).

siblings(X,Y) :- mother(M,X), mother(M,Y), father(F,X), father(F,Y).
brother(X,Y)  :- siblings(X,Y), male(X), X \= Y.
sister(X,Y)   :- siblings(X,Y), female(X), X \= Y.```
When I run the query
Code:
`sister(alice,jim)`
it prints true and waits for input from user. I expected to print true and exit.

Code:
```sister(alice,jim).
true ;
false.```
Any solution to this problem please.

2. This doesn't solve your problem, but shouldn't X \= Y be part of siblings/2, instead of being repeated in brother/2 and sister/2?

Anyway, whether the program exits or waits for input sounds like it would depend more on your Prolog environment than on the specific program.