Re: negotiation by failure- list operations





ne0 wrote:
> the problem with the empty list is just a minor one - its simply
> delete1(_,[],[]).
>
> but thats not what my question was.
>
> The problem is still- how to find out that X isnt in L1 and then to
> throw a YES - can this be solved by a not(member/2) predicate ??

yes - you could use this, although the resulting solution is much less
efficient:

delete1(X,List,List) :-
\+ member(X,List),!.
delete1(X,List,ListWithoutX) :-
delete(X, List, ListWithoutX).

Regards, Brian.

.



Relevant Pages

  • Re: FH PF help
    ... Yeah, thats what I meant:) ... Brian ... Prev by Date: ...
    (rec.games.pinball)
  • Re: Honda Civic 2001 inside Windscreen frosting up
    ... > I normally drive off with a half cleared screen, I know thats bad! ... > Thanks Brian ... Never admit what you've just written - you don't know who reads these ... Prev by Date: ...
    (uk.rec.cars.maintenance)
  • Re: Whats a Quantum pcb worth?
    ... Thank you Ken, Troy, and Brian for this amusing fight! ... Thats all! ... Prev by Date: ...
    (rec.games.video.arcade.collecting)
  • Re: Eeek! County Court summons just been sent to my address!
    ... >> And what law would that be please? ... How does opening a letter make it "become yours" (whatever thats ... Brian ... Prev by Date: ...
    (uk.legal)
  • Re: # porgrams running when doing nothing
    ... Brian wrote: ... Thats seems like a lot. ... Where can I go to get help and knowing what ... Start | Run line, and on the Startup tab, uncheck the programs you don't ...
    (microsoft.public.windowsxp.perform_maintain)