users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prolog Mystery


From: Paulo J. Matos aka PDestroy
Subject: Re: Prolog Mystery
Date: 27 Dec 2001 00:10:16 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

> > I'm trying to do a predicate that given a list collects all
> > elements into another list that are not integer.
> > I've done the following:
> > 
> > np_collect([],X,X).
> > np_collect([Y|L], T, P) :- 
> >     \+ integer(Y),
> >     np_add(Y, T, R),
> >     np_collect(L, R, P).
> > 
> > 
> > For some strange reason it is not working...
> 
> you'd need a third recursive clause, starting with integer(Y)...
>

Ok, great... It worked... We're (me and my friend...) still
amazed since we're trying to solve the mystery for some hours now...
 
> btw, is this for some course assignment?
> 

:-~ 
Yes... It's for our Logic Programming Project at college...
Not a good thing... I can assure you that! 

> >         Hope you had a great Christmas and a Happy New Year...
> 
> yes and not yet :-)
> ../s

Good... :)
By the way, what's ../s ?

Best regards and thx again,

-- 
Paulo J. Matos aka PDestroy : pocm(_at_)rnl.ist.utl.pt
Instituto Superior Tecnico - Lisbon    
Software & Computer Engineering - A.I.
 - > http://www.rnl.ist.utl.pt/~pocm 
 ---    
        Yes, God had a deadline...
                So, He wrote it all in Lisp!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]