how to make this fail driven loop succesfull ?
Roelof Wobben <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Hello, I have these facts: male(roelof). male(mans). male(jan). female(chantal). female(tamara). female(marie). female(gerda). parent(roelof,tamara). parent(mans, roelof). parent(jan, chantal). parent(marie, roelof). parent(chantal, tamara). parent(mans, gerda). parent(marie, gerda). is_mother(Child,Mother):- parent(Mother, Child), female(Mother). is_father(Child, Father):- parent(Father, Child), male(Father). siblings(Father,Mother) :- is_father(X, Father), is_mother(X, Mother), write(X), nl, fail. When I do siblings(mans,marie) it produces: roelof gerda no How can I change this to make the output like this: roelof gerda yes. I have tried to add siblings(_) but with no success Roelof