To prevent somebody from being their own sister, the rule for sister_of/2 can be modified to add the constraint that X and Y must be different individuals:
sister_of(X, Y) :-
female(X),
X \= Y,
parents(X, M, F),
parents(Y, M, F).
This adds the check X \= Y to ensure X and Y are not the same person before concluding they are sisters.