home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!wupost!sdd.hp.com!scd.hp.com!hplextra!hpfcso!hpfcmdd!hpbbrd!jensk
- From: jensk@hpbbrd.bbn.hp.com (Jens Kilian)
- Newsgroups: comp.lang.prolog
- Subject: Compilation of Disjuncts
- Message-ID: <97440011@hpbbrd.bbn.hp.com>
- Date: 3 Sep 92 14:37:04 GMT
- References: <1992Sep1.160505.6828@irisa.fr>
- Organization: HP Mechanical Design Division
- Lines: 21
-
- The main reason for compiling disjunctions is that it can speed up code
- like
-
- p(X) :-
- ( X >= 0 ->
- do_something_for_positive_X(X)
- ; do_something_for_negative_X(X)
- ).
-
- This can be converted to test-and-branch code, since it is completely
- determinate. Obviously, the plain WAM must be extended with special
- instructions to allow such things.
-
- Jens.
- --
- Internet: jensk@hpbeo82.bbn.hp.com HPDESK : JENS_KILIAN%XU@HP1200
- MausNet: Jens Kilian @ BB KILIAN_JENS/HP1200_XU@hpbbi4
- Phone: (0|+49)7031-14-4308 TELNET : 778-4308
- Fax : (0|+49)7031-14-2049
- -------------------------------------------------------------------------------
- As the air to a bird, or the sea to a fish, so is contempt to the contemptible.
-