Re: why does this not work
Roelof Wobben <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
> Date: Tue, 25 Mar 2014 15:40:53 +0100 > From: [email protected] > To: [email protected] > Subject: Re: [SWIPL] why does this not work > > On Tue, Mar 25, 2014 at 14:32:03 +0000, Roelof Wobben wrote: > > % Displays the output of siblings(X,Y) and takes care that > > % there are no duplicates. > > display_siblings(Person) :- > > findall(Person-Y, (siblings(Person,Y),Person @< Y), Sibs), > > display_the_siblings(Sibs). > > [...] > > But when I do display_siblings(kimberly) I see a message Er zijn geen zussen/broers bekend > > That's wrong Denise is a sibling of Kimberly. > > ?- Person = kimberly, findall(Person-Y, (siblings(Person,Y),Person @< Y), Sibs). > Person = kimberly, > Sibs = []. > If I change it to what you said : % Displays the output of siblings(X,Y) and takes care that % there are no duplicates. display_siblings(Person) :- findall(Person-Y, (siblings(Person,Y)), Sibs), display_the_siblings(Sibs). Then I see these error messages: ERROR: /home/roelof/prolog/gene:28:0: Syntax error: Operator expected ERROR: /home/roelof/prolog/gene:34:0: Syntax error: Operator expected Roelof -------------- next part -------------- HTML attachment scrubbed and removed