🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #694

Re: Compilation of Disjuncts

#694
From: Roland Karlsson
Date: Tue, 08 Sep 1992 07:59
24 lines
1307 bytes
SICStus Prolog do it this way:

p :- (x,! ; y).                 q :- a, (b,! ; c).
p :- z.                         q :- d.

                  is converted to

p :- choice(C), x, cut(C).      q :- choice(C), a, q'(C).
p :- y.                         q :- d.
p :- z.
                                q'(C) :- b, cut(C).
                                q'(_) :- c.

Where choice(C) binds C to a reference to the youngest choicepoint alive
when calling q/0 or p/0, and cut(C) clears all choicepoints younger than C.


 o
Ralle
--
Roland Karlsson             SICS, PO Box 1263, S-164 28 KISTA, SWEDEN
Internet: roland@sics.se    Tel: +46 8 752 15 40          Fax: +46 8 751 72 30
Telex: 812 6154 7011 SICS   Ttx: 2401-812 6154 7011=SICS
Technical Details
Message-ID: <ROLAND.92Sep8085939@helicon.sics.se>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!sics.se!roland
References: <1992Sep1.160505.6828@irisa.fr> <MATSC.92Sep2141625@vishnu.sics.se> <14395@goanna.cs.rmit.oz.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!sics.se!roland
From: roland@sics.se (Roland Karlsson)
Newsgroups: comp.lang.prolog
Subject: Re: Compilation of Disjuncts
Message-ID: <ROLAND.92Sep8085939@helicon.sics.se>
Date: 8 Sep 92 07:59:39 GMT
References: <1992Sep1.160505.6828@irisa.fr> <MATSC.92Sep2141625@vishnu.sics.se>
 <14395@goanna.cs.rmit.oz.au>
Sender: news@sics.se
Organization: Swedish Institute of Computer Science, Kista
Lines: 24
In-Reply-To: ok@goanna.cs.rmit.oz.au's message of 8 Sep 92 04:20:34 GMT