next up previous index
Next: Obsolete Suspension Facilities Up: Advanced Control Features Previous: The Top-Level Loop   Index


The Cut and the Suspended Goals

It is very important to mention here the influence of non-logical predicates, especially the cut, on the execution of delayed goals. The cut relies on a fixed order of goal execution in that it discards some choice points if all goals preceding it in the clause body have succeeded. If some of these goals are delayed, or if the head unification of the clause with the cut wakes some nondeterministic delayed goals, the completeness of the resulting program is lost and there is no clean way to save it as long as the cut is used.

The user is strongly discouraged to use non-local cuts together with coroutining, or to be precisely aware of their scope. The danger of a cut is twofold:

In order to detect these situations, the ECLiPSe debugger has an option to print a warning whenever a cut in one of the above two conditions is executed. These warnings can be toggled using the P command.


next up previous index
Next: Obsolete Suspension Facilities Up: Advanced Control Features Previous: The Top-Level Loop   Index
Warwick Harvey
2004-08-07