Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.sprintlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uwm.edu!chi-news.cic.net!simtel!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!cs.mu.OZ.AU!lee
From: lee@cs.mu.OZ.AU (Lee Naish)
Subject: Re: HELP: Emulating soft cut
Message-ID: <9531712.17412@mulga.cs.mu.OZ.AU>
Originator: lee@munta.cs.mu.OZ.AU
Sender: news@cs.mu.OZ.AU (CS-Usenet)
Reply-To: lee@cs.mu.OZ.AU (Lee Naish)
Organization: Computer Science, University Of Melbourne, Australia
References:  <47q8s9INN2a5@bhars12c.bnr.co.uk>
Date: Mon, 13 Nov 1995 01:53:54 GMT
Lines: 14


In article <47q8s9INN2a5@bhars12c.bnr.co.uk>, John Fletcher <J.S.Fletcher@bnr.co.uk> writes:

> I would really like a 'soft cut' (prune alternative clauses only)

> Any idea how I can emulate this?

The method you tried is often the simplest and best.  You could also try using findall (then testing if the list is empty and using member) - quite likely to be worse than what you tried.  Another possibility is to use hard side effects (eg assert) and test if something has been asserted in the "else" clause.  This is an awful way to do it but might be the most efficient in your context.

Or you could try to contact the implementors of the Prolog system to see if soft cut exists internally and can be got at in some undocumented/unsupported way.

I think its a great pity that "once" and "soft cut" were packaged to gether into a single operator all those years ago.

	lee
