Re: where do I think wrong
Roelof Wobben <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Found it.
This is the right one.:
have_siblings(C) :-
( ( is_father(X,C), is_father(X,S) )
;( is_mother(Y,S), is_mother(Y,C) )),
C \= S,
write(S).
But im not complete happy.
When I now do have_siblings(chantal) I see this output.
De broers/zusters van chantal zijn :
dagmar
true ;
true.
Which is good.
But when I do have_siblings(gerda) I see this output:
De broers/zusters van gerda zijn :
roelof
true ;
roelof
true
So when a father and a mother are known then the sibling are displayed twice.
Roelof
> Date: Thu, 13 Mar 2014 12:10:44 +0100
> From: [email protected]
> To: [email protected]
> Subject: Re: [SWIPL] where do I think wrong
>
>
> Am 13.03.2014 12:05, schrieb Roelof Wobben:
> > 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.
>
> Indeed. Was just mail-programming. I missed a closing parenthesis. Do
> the counting. Read the other mail (Kilian Evang) and fix it. I know you
> can do it ;-) Regards, dsp
>
> --
> GPG/PGP KeyID: 0xD15FCEF6
>
> Daniel Speicher University of Bonn
> +49 (0228) 73-4315 Institute of Computer Science III
> [email protected] Roemerstrasse 164
> http://sewiki.iai.uni-bonn.de/dsp D-53117 Bonn
>
>
-------------- next part --------------
HTML attachment scrubbed and removed