Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!enea!zyx!bd From: bd@zyx.UUCP (Bjorn Danielsson) Newsgroups: comp.lang.prolog Subject: Re: Control Structures Message-ID: <411@zyx.UUCP> Date: Wed, 8-Apr-87 01:01:40 EST Article-I.D.: zyx.411 Posted: Wed Apr 8 01:01:40 1987 Date-Received: Mon, 13-Apr-87 03:45:06 EST References: <276@ecrcvax.UUCP> Reply-To: bd@zyx.UUCP (Bjorn Danielsson) Organization: ZYX Sweden AB, Stockholm Lines: 19 In article <276@ecrcvax.UUCP> mcvax!unido!ecrcvax!micha (Micha Meier) writes: >From the efficiency point of view, a solution with nonstandard cuts >(see Lee's note) is the best one, ... I suggest a somewhat simpler (and less general) syntax for delayed cuts: delayed_cut(Goal) should work just like ordinary cut, except that the actual cutting is delayed until Goal has succeeded. P :- A,!,B. would be the same as P :- A,delayed_cut(true),B. P :- A,soft_cut,B. would be the same as P :- delayed_cut(A),B. The solutions to Francois-Michel Lang's problems would be: xor(A,B) :- delayed_cut(A) ; B. P :- A, delayed_cut(B), C, D. % Assuming P has no more clauses. -- Bjorn Danielsson, ZYX, +46 8 653205, ...mcvax!enea!zyx!bd