diff: detect floundering in solutions/2 etc.

Fergus Henderson fjh at cs.mu.oz.au
Mon Oct 13 00:06:13 AEST 1997


I wrote:

> Detect floundering in solutions/2 and nondet if-then-else.
> 
> compiler/code_gen.m:
> 	Change the code for if-then-elses with nondet conditions
> 	so that it checks for floundering.

Oops, that change was to ite_gen.m, not code_gen.m.

Here's the diff.

Index: ite_gen.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/ite_gen.m,v
retrieving revision 1.49
diff -u -r1.49 ite_gen.m
--- ite_gen.m	1997/09/29 05:28:23	1.49
+++ ite_gen.m	1997/10/12 07:56:47
@@ -241,9 +241,10 @@
 	( { NondetCond = yes } ->
 			% We cannot discard the trail ticket if the 
 			% condition can be backtracked into.
-		% code_info__maybe_pop_stack(MaybeTicketSlot, DiscardTicketCode)
-		{ DiscardTicketCode = empty }
-		% XXX should check for delayed nonlinear constraints
+			% But we do need to call reset_ticket(..., solve)
+			% to check for floundering.
+		code_info__maybe_reset_ticket(MaybeTicketSlot,
+			solve, DiscardTicketCode)
 	;
 			% Discard the trail ticket if the condition succeeded
 			% and we will not backtrack into the condition

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list