🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #764

Re: Re: Compilation of Disjuncts

#764
From: Serge Le Huitouze
Date: Thu, 03 Sep 1992 17:19
44 lines
1090 bytes
|>    P ;_Q :- P.
|>    _P; Q :- Q.
|> 
|> SICStus Prolog does nothing special, and considers it as an ordinary
|> predicate as you describe.

You certainly do not do so!
Consider the above example:

go1(X) :- foo(X), ( ! ; true).
go2(X) :- foo(X),  or(!, true).

foo(1).
foo(2).

or(P,_) :- P.
or(_,Q) :- Q.

Executing this in SICSTUS gives:

| ?- go1(X).

X = 1 ? ;

no
| ?- go2(X).

X = 1 ? ;

X = 1 ? ;

X = 2 ? ;

X = 2 ? ;

no
| ?- ^D
{ End of SICStus execution, user time 0.060 }


Is it a kind of remake for "go2 considered harmful" ? :-)


More seriously, how do you treat the so-called "transparency" of the cut ?
Technical Details
Message-ID: <1992Sep3.171905.14062@irisa.fr>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!irisa!irisa.fr!serge
References: <1992Sep1.160505.6828@irisa.fr> <MATSC.92Sep2141625@vishnu.sics.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!irisa!irisa.fr!serge
From: serge@irisa.fr (Serge Le Huitouze)
Newsgroups: comp.lang.prolog
Subject: Re: Re: Compilation of Disjuncts
Message-ID: <1992Sep3.171905.14062@irisa.fr>
Date: 3 Sep 92 17:19:05 GMT
References: <1992Sep1.160505.6828@irisa.fr> <MATSC.92Sep2141625@vishnu.sics.se>
Sender: news@irisa.fr
Reply-To: brisset@irisa.fr
Organization: Irisa, Rennes(FR)
Lines: 44