home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / prolog / 1599 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  1.3 KB

  1. Path: sparky!uunet!mcsun!corton!geocub!billaud
  2. From: billaud@greco-prog.fr (Michel BILLAUD)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: Help on problem needed!
  5. Keywords: help
  6. Message-ID: <1992Aug25.074623.25450@greco-prog.fr>
  7. Date: 25 Aug 92 07:46:23 GMT
  8. References: <meskes.713709771@ulysses>
  9. Reply-To: billaud@geocub.UUCP (Michel BILLAUD)
  10. Organization: LaBRI - Universite Bordeaux I - France
  11. Lines: 26
  12.  
  13. In article <meskes.713709771@ulysses> meskes@ulysses.informatik.rwth-aachen.de (Michael Meskes) writes:
  14.  
  15. >Can you program a IF...THEN...ELSE in Prolog without using the cut?
  16.  
  17. No. a proof by contradiction:
  18.  
  19. Suppose you can program IF..THEN ...ELSE, then you could also
  20. program NOT ... (negation as failure) because
  21.     NOT(X) <==> IF X THEN FAIL ELSE TRUE
  22.  
  23. Obviously NOT(TRUE) <=> FAIL     and NOT(FAIL) <=> TRUE
  24.  
  25. But every program P built from AND/OR/TRUE/FAIL only has the following property
  26.   P(TRUE) "produces more solutions than" P(FAIL)
  27.                     (not very hard to prove)
  28. Which is not the case for NOT.
  29. ----
  30. Also, it is not possible to replace CUT by IF...THEN..ELSE
  31. for a similar reason
  32.  
  33. Michel
  34. -- 
  35. Michel BILLAUD                 :  billaud@geocub.greco-prog.fr
  36. Departement d'Informatique     :  phone W: 56.84.57.92  // 56.84.69.22
  37. IUT "A", Universite Bordeaux I :  "Je veux jouer de l'helicon
  38. 33405 Talence  (FRANCE)        :        pon pon pon pon !    "
  39.