Re: negotiation by failure- list operations
- From: "ne0" <neoeon@xxxxxxx>
- Date: 13 Jun 2005 09:15:24 -0700
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 ??
any suggestions highly appreciated
greetings
ne0
Brian Hulley schrieb:
> ne0 wrote:
> > hi, what im trying to do is the following:
> >
> >
> > delete1(X,L1,L2) that uses delete(X,L1,L2) but if X isnt in L1 it
> > should not throw NO - it should only throw YES
> >
> > i think its donesimilar to that predicate:
> > different(X,Y) :- X=Y, !, true.
> > different(X,Y).
> >
> > but how do i change my delete1 predicate that it throws YES if X isnt
> > in L1 ?
> >
> >
> > Can someone help me ?
>
> You need to catch the case where you are trying to delete X from an
> empty list so that this case succeeds instead of failing. Hint: there
> should be 3 clauses for delete1...
>
> Hope this helps - best regards Brian.
.
- Follow-Ups:
- Re: negotiation by failure- list operations
- From: Brian Hulley
- Re: negotiation by failure- list operations
- References:
- negotiation by failure- list operations
- From: ne0
- Re: negotiation by failure- list operations
- From: Brian Hulley
- negotiation by failure- list operations
- Prev by Date: Re: negotiation by failure- list operations
- Next by Date: Re: trail stack, global stack
- Previous by thread: Re: negotiation by failure- list operations
- Next by thread: Re: negotiation by failure- list operations
- Index(es):