I have prolog predicates male, female, parent, as follows:
parent(bob, rick).
parent(jane, rick).
parent(rick, alice).
parent(betsy, alice).
male(rick).
female(jane).
Now, one way to infer incomplete gender info is to see if one parent is male, then the other has to be a female and vice versa, so I tried to extend female:
female(X) :- parent(X, Y), parent(Z, Y), male(Z).
Thus, my final female predicate is:
female(jane).
female(X) :- parent(X, Y), parent(Z, Y), male(Z).
However, when I try:
?- female(jane).
true ;
false.
?- female(betsy).
true ;
false.
Why's the false coming up there? Further problems are arising when I try to do a similar thing for male, because that's leading to an infinite recursion.