Re: where do I think wrong
Roelof Wobben <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
> Date: Thu, 13 Mar 2014 10:19:43 +0100 > From: [email protected] > To: [email protected] > Subject: Re: [SWIPL] where do I think wrong > > > Am 13.03.2014 09:04, schrieb Roelof Wobben: > > It worked fine if a mother and father are known. > > So I want to change it to this : > > > > have_siblings(C) :- > > is_father(X,C), > > is_father(X,S); > > is_mother(Y,S), > > is_mother(Y,C), > > C \= S, > > write(S). > > I did not try your predicates, but there are (obviously?) parantheses > missing. Better: > > have_siblings(C) :- > ( ( is_father(X,C), is_father(X,S) ) > ; ( is_mother(Y,S), is_mother(Y,C) ), > C \= S, > write(S). > I changed it to what you said. have_siblings(C) :- ( ( is_father(X,C), is_father(X,S) ) ;( is_mother(Y,S), is_mother(Y,C) ), C \= S, write(S). but now I see a operand missing errror. Roelof -------------- next part -------------- HTML attachment scrubbed and removed