Re: Newbie question...simple rule question...
- From: "Mauro Di Nuzzo" <picorna@xxxxxxxxx>
- Date: Fri, 12 Aug 2005 10:33:22 GMT
Try this, and let me know if it works please:
everybodyok :- (
people(X),
( ok(X)
-> fail
; !, fail
)
; true
).
Regards,
M
"mans" <mshapshak@xxxxxxxxx> ha scritto nel messaggio
news:1123762484.841598.229320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Dear All,
>
> I am trying to understand the best way to write a rule which checks on
> all the elements.
>
> -------------
> people(a).
> people(c).
> ok(b).
> ok(a).
>
> everybodyok_works :- findall(X,ok(X),List),maplist(people,List).
>
> everybodyok_bad :- people(X),ok(X).
>
> -------------
>
> What am I missing? Is there a better way to write rule which says:
> "Everybody is ok if for all people we know has said they are OK." ?
>
> Thanks in Advance,
> Mans
>
.
- References:
- Newbie question...simple rule question...
- From: mans
- Newbie question...simple rule question...
- Prev by Date: Re: newbie question: how to measure run-time with Sicstus under linux?
- Next by Date: Re: newbie question: how to measure run-time with Sicstus under linux?
- Previous by thread: Re: Newbie question...simple rule question...
- Next by thread: newbie question: how to measure run-time with Sicstus under linux?
- Index(es):
Relevant Pages
|
|