[m-dev.] for review: a new way of handling failure

Fergus Henderson fjh at cs.mu.oz.au
Fri Oct 31 00:12:41 AEDT 1997


Zoltan Somogyi, you wrote:
> 
> The proposed design extends each nondet stack frame with a fifth fixed field,
> corrfr (it gives the frame corresponding to the label in the redoip slot).

I think it would be better to call this `redofr'.

> One implication of the change is that when execution resumes after a redo(),
> we can no longer assume that curfr = maxfr.

Hmm... this is a worry.  There may be many places where we make that
assumption.

> <h3> Handling commits across nondet goals </h3>
> 
> <ul>
> <il> Best case.
> Before the code generator enters a goal that is being committed across,
> it saves the value of maxfr,
> pushes a new entry on the resume point stack indicating
> the resume point for getting control back if the goal has no solutions
> and sets the redoip slot of the top frame (which is this frame)
> to the stack continuation in that resume point.

I think the remark in parentheses above is wrong.  Why is it guaranteed
that the top frame will be the same as the current frame?

> The code at this resume point will perform a failure in the manner
> appropriate for whatever entry was originally on top of the resume point stack
> (There is no need to reset maxfr, since the resume point can only be reached
> if all other frames above the one hijacked have failed.)
> The code after the goal in the success continuation
> will reset maxfr to the saved value.

I think this might do the wrong thing, if the assumption above is
not correct.

(The later parts also seemed to depend on this assumption, so I stopped
reviewing at this point...)

Also check the HTML formatting.  Various occurrences of <il> should be <li>,
I think.

-- 
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