home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / prolog / 2046 < prev    next >
Encoding:
Text File  |  1992-11-09  |  822 b   |  30 lines

  1. Newsgroups: comp.lang.prolog
  2. Path: sparky!uunet!utcsri!newsflash.concordia.ca!ccu.umanitoba.ca!mizar.cc.umanitoba.ca!zyang
  3. From: zyang@ccu.umanitoba.ca (Z. Yang)
  4. Subject: pointers needed on list processing
  5. Message-ID: <BxGLnG.CD4@ccu.umanitoba.ca>
  6. Keywords: sub sum, nested list
  7. Sender: news@ccu.umanitoba.ca
  8. Nntp-Posting-Host: antares.cc.umanitoba.ca
  9. Organization: University of Manitoba, Winnipeg, Canada
  10. Date: Mon, 9 Nov 1992 17:23:39 GMT
  11. Lines: 17
  12.  
  13. Hi, netters,
  14.  
  15. I am new in prolog and have some difficulty in list processing. What I want to
  16. do is write a predicate, ie. called 'subsum', which does following,
  17.  
  18. ?- subsum([L1,L2,...],NewList).
  19. NewList = [Sum_of_L1,Sum_of_L2,...]
  20.  
  21. where L1, L2 etc. are lists themselves(could be nested).
  22.  
  23. Any pointers will be appreciated.
  24. Thanks in advance to all kind souls.
  25.  
  26. -zgy
  27.  
  28.  
  29.  
  30.