home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / prolog / 2268 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.1 KB

  1. From: jensk@hpbbn.bbn.hp.com (Jens Kilian)
  2. Date: Sat, 19 Dec 1992 00:23:40 GMT
  3. Subject: Re: next_to code question
  4. Message-ID: <JENSK.92Dec18172340@hpbeo82.bbn.hp.com>
  5. Organization: HP
  6. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpcc05!hpbbn!hpbeo20!jensk
  7. Newsgroups: comp.lang.prolog
  8. References: <1992Dec17.204918.6730@mercury.cair.du.edu>
  9. Sender: news@hpbeo20.bbn.hp.com (News System)
  10. In-Reply-To: awinterb@diana.cair.du.edu's message of Thu, 17 Dec 1992 20:49:18 GMT
  11. Lines: 21
  12.  
  13.  
  14. > append([],L,L) :- !.
  15.                     ^
  16.                     This cut is the culprit.
  17.  
  18. It makes append/3 determinate, so it won't be able to deliver multiple
  19. solutions.
  20.  
  21. Just replace the first clause by
  22.  
  23. append([], L, L).
  24.  
  25.  
  26.     Jens.
  27. --
  28. Internet: jensk@hpbeo82.bbn.hp.com    HPDESK : JENS_KILIAN%XU@HP1200
  29. MausNet:  Jens Kilian @ BB                     KILIAN_JENS/HP1200_XU@hpbbi4
  30. Phone: (0|+49)7031-14-4308            TELNET : 778-4308
  31. Fax  : (0|+49)7031-14-2049
  32. -------------------------------------------------------------------------------
  33. As the air to a bird, or the sea to a fish, so is contempt to the contemptible.
  34.