🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2629

Control Structures

#2629
From: lang
Date: Fri, 03 Apr 1987 14:58
29 lines
1672 bytes
I have a few comments to make about the various solutions
to the two control structure problems that were posted
by Jan Chomickia while back.  I am the original source of these problems.

The problem with most (all?) of the solutions that I have seen to
the xor problem is the following:  One easy way to write xor is
something like

xor(Goal1,_) :- call(Goal1).
xor(Goal1,Goal2) :- \+ Goal1, call(Goal2).

The problem with this solution is that if Goal1 does not succeed,
it has to be called twice before trying Goal2, and, in our
application, this is computationally prohibitive.

As for the 
  P :- A, B, C, D.
problem, I didn't make this clear in my original posting,
but I do want to allow multiple solutions of B.

I hope this helps.

----------------------------------------------------------------------------
Francois-Michel Lang			      Daytime phone:  (215) 648-7490

Paoli Research Center, Unisys Corporation        lang@bigburd.PRC.unisys.COM
Dept of Comp. & Info Science, U of PA                     lang@cis.upenn.edu
----------------------------------------------------------------------------
Technical Details
Message-ID: <2285@bigburd.PRC.Unisys.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ucla-cs!sdcrdcf!burdvax!bigburd!lang

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ucla-cs!sdcrdcf!burdvax!bigburd!lang
From: lang@bigburd.UUCP
Newsgroups: comp.lang.prolog
Subject: Control Structures
Message-ID: <2285@bigburd.PRC.Unisys.COM>
Date: Fri, 3-Apr-87 09:58:47 EST
Article-I.D.: bigburd.2285
Posted: Fri Apr  3 09:58:47 1987
Date-Received: Sun, 5-Apr-87 10:17:10 EST
Sender: news@bigburd.PRC.Unisys.COM
Organization: Unisys/Paoli Research Center, Paoli, PA
Lines: 28
Keywords: xor