[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Prolog Mystery
From: |
Paulo J. Matos aka PDestroy |
Subject: |
Prolog Mystery |
Date: |
26 Dec 2001 23:21:42 +0000 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
Hi all,
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...
We also have a restriction that we can't use -> for an unknown
reason.
Calling np_collect always fails and doing spy shows that the
predicate will never even test if Y is integer. I can't find
why. Can somebody please help... :)
Oh, and by the way...
Hope you had a great Christmas and a Happy New Year...
Best regards,
--
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!
- Prolog Mystery,
Paulo J. Matos aka PDestroy <=