Re: negotiation by failure- list operations
- From: "Brian Hulley" <brianh@xxxxxxxxxxxx>
- Date: 13 Jun 2005 12:39:11 -0700
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.
.
- Follow-Ups:
- Re: negotiation by failure- list operations
- From: matthiasse
- Re: negotiation by failure- list operations
- References:
- negotiation by failure- list operations
- From: ne0
- Re: negotiation by failure- list operations
- From: Brian Hulley
- Re: negotiation by failure- list operations
- From: ne0
- negotiation by failure- list operations
- Prev by Date: Re: trail stack, global stack
- Next by Date: Re: negotiation by failure- list operations
- Previous by thread: Re: negotiation by failure- list operations
- Next by thread: Re: negotiation by failure- list operations
- Index(es):
Relevant Pages
|
|