Article View: comp.lang.prolog
Article #692Re: Compilation of Disjuncts
From: Jens Kilian
Date: Mon, 07 Sep 1992 10:39
Date: Mon, 07 Sep 1992 10:39
36 lines
1581 bytes
1581 bytes
> >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) > > ). > > > > No. The main reason for compiling disjunctions is to avoid to build a structure > and metacall it. The improvement you mention is also significant, but nowhere as important as this. > > --Micha I was thinking about the alternative approach of compiling a disjunction to a call of an auxiliary predicate: P :- Q; R. ==> P :- dummy(...). dummy(...) :- Q. dummy(...) :- R. where in place of ... you have to insert the variables occuring in Q and R, as well as any information needed for handling cuts. Sorry about the confusion, 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.
Technical Details
Message-ID:
<97440012@hpbbrd.bbn.hp.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sdd.hp.com!scd.hp.com!hplextra!hpfcso!hpfcmdd!hpbbrd!jenskReferences:
<1992Sep1.160505.6828@irisa.fr>Show Full Headers
Complete Article Headers
From: jensk@hpbbrd.bbn.hp.com (Jens Kilian) Date: Mon, 7 Sep 1992 10:39:12 GMT Subject: Re: Compilation of Disjuncts Message-ID: <97440012@hpbbrd.bbn.hp.com> Organization: HP Mechanical Design Division Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sdd.hp.com!scd.hp.com!hplextra!hpfcso!hpfcmdd!hpbbrd!jensk Newsgroups: comp.lang.prolog References: <1992Sep1.160505.6828@irisa.fr> Lines: 37