Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 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 ----------------------------------------------------------------------------