Re: how to make this fail driven loop succesfull ?
Roelof Wobben <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
---------------------------------------- > Date: Sat, 8 Mar 2014 21:43:03 +0000 > From: [email protected] > To: [email protected] > Subject: Re: [SWIPL] how to make this fail driven loop succesfull ? > > Roelof, > > You can make your failure-drive loop finish as 'true' like this: > > siblings(Father,Mother) :- is_father(X, Father), is_mother(X, Mother), write(X), nl, fail ; true. > I found a better way as stated in the tutorial : siblings(Father,Mother) :- is_father(X, Father), is_mother(X, Mother), write(X), nl, fail. siblings(_,_). But thanks for the help. Roelof