[m-rev.] for review: switch arms for more than one cons_id

Ralph Becket rafe at csse.unimelb.edu.au
Tue Jan 8 11:16:40 AEDT 2008


Zoltan Somogyi, Tuesday,  8 January 2008:
> On 02-Jan-2008, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
> > while this is still in your mind, how hard would it be to improve the
> > determinism error message reporting that a switch-like disjunction is
> > in fact nondet because it has multiple matches for the same constructor?
> 
> Switch detection already transforms
> 
> 	(
> 		X = a, <goal1>
> 	;
> 		X = a, <goal2>
> 	;
> 		X = b, <goal3>
> 	)
> 
> into
> 
> 	(
> 		X = a, ( <goal1> ; <goal2> )
> 	;
> 		X = b, <goal3>
> 	)
> 
> and determinism analysis already reports the problem with the inner disjunction
> being nondet or multi. If I understand you correctly, all that would be needed
> would be (a) det_report.m keeping track of which switch arms it is inside
> (a program point can be inside more than one if they are nested), and (b)
> if this list is nonempty, then printing the list, together with the contexts
> of <goal1> and <goal2>, when printing the error message about the disjunction
> possibly succeeding more than once.

That would be ideal.

> I won't get a chance to do this before I get back, but will look at it
> once I have finished with the mountain of things that have gathered in my
> absence :-(

No great rush; this is just a problem that's cropped up often enough
that I wondered if there was a reasonable solution.

Cheers,
-- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list