Suppose you are working with a genealogy database. Some records are missing. You might know that people named "John" were male, and people named "Mary" were female, etc.
male(X) :- first_name(X, "John").
female(X) :- first_name(X, "Mary").
For people with exotic or foreign names, their gender can be unclear, but it must have been one of the two. Marriage (before this century) was between opposite genders.
female(X) :- wed(X, Y), male (Y).
male (X) :- wed(X, Y), female(Y).
Knowing that someone's gender was either male or female (even if you don't know which) is an important tidbit in deciphering identities and relationships.
How would you encode this knowledge in Prolog?
female(X) :- person(X), not(male(X)).
is incorrect, as it makes you conclude that everyone is female unless they can be proven to be male.