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

  1. Path: sparky!uunet!olivea!spool.mu.edu!wupost!sdd.hp.com!scd.hp.com!hplextra!hpfcso!hpfcmdd!hpbbrd!jensk
  2. From: jensk@hpbbrd.bbn.hp.com (Jens Kilian)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Compilation of Disjuncts
  5. Message-ID: <97440011@hpbbrd.bbn.hp.com>
  6. Date: 3 Sep 92 14:37:04 GMT
  7. References: <1992Sep1.160505.6828@irisa.fr>
  8. Organization: HP Mechanical Design Division
  9. Lines: 21
  10.  
  11. The main reason for compiling disjunctions is that it can speed up code
  12. like
  13.  
  14.     p(X) :-
  15.       (  X >= 0 ->
  16.          do_something_for_positive_X(X)
  17.       ;  do_something_for_negative_X(X)
  18.       ).
  19.  
  20. This can be converted to test-and-branch code, since it is completely
  21. determinate. Obviously, the plain WAM must be extended with special
  22. instructions to allow such things.
  23.  
  24.     Jens.
  25. --
  26. Internet: jensk@hpbeo82.bbn.hp.com    HPDESK : JENS_KILIAN%XU@HP1200
  27. MausNet:  Jens Kilian @ BB                     KILIAN_JENS/HP1200_XU@hpbbi4
  28. Phone: (0|+49)7031-14-4308            TELNET : 778-4308
  29. Fax  : (0|+49)7031-14-2049
  30. -------------------------------------------------------------------------------
  31. As the air to a bird, or the sea to a fish, so is contempt to the contemptible.
  32.