Soft Cut

From: Mark Wallace <mgw_at_icparc.ic.ac.uk>
Date: Tue 05 Mar 2002 06:17:54 PM GMT
Message-ID: <3C850BD2.4B144074@icparc.ic.ac.uk>
Hi,
This doesn't seem to work any more:

ECLiPSe Constraint Logic Programming System [kernel]
Copyright Imperial College London and ICL
Certain libraries copyright Parc Technologies Ltd
GMP library copyright Free Software Foundation
Version 5.3 #41, Sat Nov 24 13:49 2001
[eclipse 1]: op(1050, xfx, *->).

Yes (0.00s cpu)
[eclipse 2]: import (*->) / 2 from sepia_kernel.

Yes (0.00s cpu)
[eclipse 3]: true *-> true ; true.
calling an undefined procedure true *-> true in module eclipse
Abort

...or the documentation is wrong:
Soft Cut 

Sometimes it is useful to be able to remove a choice point which is not the last one and to keep
the following ones, for example when defining an if-then-else
construct which backtracks also into the condition. This functionality is usually called soft cut
in the Prolog folklore. 

When you define the operator op(1050, xfx, *->) and import *->/2 from sepia_kernel, then the
expression 

       A *-> B ; C 

is evaluated as a soft cut: if A succeeds, B is executed and on backtracking subsequent solutions
of A are returned, but C is never executed. If A fails, C is
executed. It is similar to ->/2, with the exception that ->/2 cuts both A and the disjunction if A
succeeds, whereas *->/2 cuts only the disjunction. 

-- 
_______________________________________________________________
Dr. Mark Wallace, IC-Parc,		Phone  +44 (0)20 7594 8434 
William Penney Laboratory, 		Fax    +44 (0)20 7594 8432
Imperial College, London SW7 2AZ, UK.	Email: mgw@icparc.ic.ac.uk
Received on Tue Mar 05 18:17:56 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:14 PM GMT GMT