Re: Newbie question...simple rule question...



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
>


.



Relevant Pages

  • Re: Fastcode MMs
    ... and these fail ... Regards ... Dennis ... Prev by Date: ...
    (borland.public.delphi.language.basm)
  • Re: Single label dns name/domain rename
    ... Look for fail, error and warning errors. ... d:\i386\adminpak.msi (Server tools for remote management of servers) ... >> Only if you are at the domain and forest functional level of 2003. ... >>> Best Regards ...
    (microsoft.public.windows.server.active_directory)
  • Re: Fastcode CharPosRev B&V 0.8.0
    ... They fail in D2005 and D7, ... Best regards ... Jeg beskyttes af den gratis SPAMfighter til privatbrugere. ...
    (borland.public.delphi.language.basm)
  • Re: General error -2147217900 (80040E14)
    ... Step Error Help File:sqldts80.hlp ... DTS package tends to fail only on monday mornings 2. ... Best regards, ...
    (microsoft.public.sqlserver.dts)
  • Re: help needed
    ... >> The floppy write would fail but the registry backups still ... >> Regards, ...
    (microsoft.public.win2000.registry)