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

  1. Path: sparky!uunet!mcsun!corton!irisa!irisa.fr!serge
  2. From: serge@irisa.fr (Serge Le Huitouze)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: Re: Compilation of Disjuncts
  5. Message-ID: <1992Sep3.171905.14062@irisa.fr>
  6. Date: 3 Sep 92 17:19:05 GMT
  7. References: <1992Sep1.160505.6828@irisa.fr> <MATSC.92Sep2141625@vishnu.sics.se>
  8. Sender: news@irisa.fr
  9. Reply-To: brisset@irisa.fr
  10. Organization: Irisa, Rennes(FR)
  11. Lines: 44
  12.  
  13. |>    P ;_Q :- P.
  14. |>    _P; Q :- Q.
  15. |> 
  16. |> SICStus Prolog does nothing special, and considers it as an ordinary
  17. |> predicate as you describe.
  18.  
  19. You certainly do not do so!
  20. Consider the above example:
  21.  
  22. go1(X) :- foo(X), ( ! ; true).
  23. go2(X) :- foo(X),  or(!, true).
  24.  
  25. foo(1).
  26. foo(2).
  27.  
  28. or(P,_) :- P.
  29. or(_,Q) :- Q.
  30.  
  31. Executing this in SICSTUS gives:
  32.  
  33. | ?- go1(X).
  34.  
  35. X = 1 ? ;
  36.  
  37. no
  38. | ?- go2(X).
  39.  
  40. X = 1 ? ;
  41.  
  42. X = 1 ? ;
  43.  
  44. X = 2 ? ;
  45.  
  46. X = 2 ? ;
  47.  
  48. no
  49. | ?- ^D
  50. { End of SICStus execution, user time 0.060 }
  51.  
  52.  
  53. Is it a kind of remake for "go2 considered harmful" ? :-)
  54.  
  55.  
  56. More seriously, how do you treat the so-called "transparency" of the cut ?
  57.