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

Zoltan Somogyi zs at csse.unimelb.edu.au
Tue Jan 8 11:03:09 AEDT 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.

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

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