[m-dev.] diff: bug fixes for the existential_types_2 branch

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jul 1 17:53:29 AEST 1999


On 01-Jul-1999, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> On 12-Jun-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > -polymorphism__process_clause(PredInfo, HeadVars, UnconstrainedTVars,
> > +polymorphism__process_clause(PredInfo0, HeadVars0, HeadVars, UnconstrainedTVars,
> >  			ExtraTypeInfoHeadVars, ExistTypeClassInfoHeadVars,
> >  			Clause0, Clause) -->
> 
> I'm a little confused by this. Why do you pass in both HeadVars0 and HeadVars?

They're both needed.  HeadVars0 is the head vars before type_infos were
added and HeadVars is the head vars after they have been added.
The former is needed for the call to `produce_existq_tvars', because
it needs to compute the types of the original headvars (in order to
compute the bindings of the existentially quantified type variables).
The latter is needed for the call to `fixup_quantification', because
quantification needs to properly quantify the type_info variables.

> Seeing that they are both input args, I think better names could be chosen.

Good point.  I'll rename them OldHeadVars and NewHeadVars.

> > +++ simplify.m	1999/06/12 00:42:27
> > @@ -310,7 +310,6 @@
> >  		%
> >  		% if --no-fully-strict,
> >  		% replace goals with determinism failure with `fail'.
> > -		% XXX we should warn about this (if the goal wasn't `fail')
> >  		%
> >  		Detism = failure,
> >  		% ensure goal is pure or semipure
> > @@ -319,16 +318,27 @@
> >  		; code_aux__goal_cannot_loop(ModuleInfo, Goal0)
> >  		)
> >  	->
> > +		% warn about this (if the goal wasn't `fail')
> > +		goal_info_get_context(GoalInfo0, Context),
> > +		(
> > +			simplify_do_warn(Info0),
> > +			Goal0 \= disj([], _) - _
> > +		->
> > +			simplify_info_add_msg(Info0,
> > +				goal_cannot_succeed(Context), Info1)
> > +		;
> > +			Info1 = Info0
> > +		),
> > +		
> 
> This doesn't seem to be mentioned in the log message.

The log message for my second change on the existential_types_2 branch
included the following:

 | compiler/simplify.m:
 | compiler/det_report.m:
 |         Fix a couple of old XXXs: issue warnings when optimizing away
 |         goals with determinism failure or det goals that have no outputs.
 |         This is needed to ensure that we still issue a warning for several
 |         of the goals in tests/warnings/simple_code.m.  The previous
 |         warnings were no longer being issued because this optimization was
 |         optimization away the relevant code before it could be warned about.
 | 
 | tests/warnings/simple_code.exp:
 |         Update to reflect the new warnings.

> >  unique_modes__check_goal_2(call(PredId, ProcId0, Args, Builtin, CallContext,
> >  		PredName), _GoalInfo0, Goal) -->
> > -	mode_checkpoint(enter, "call"),
> > +	/*** CallString = "call" ***/
> > +	{ prog_out__sym_name_to_string(PredName, PredNameString) },
> > +	{ string__append("call ", PredNameString, CallString) },
> > +	mode_checkpoint(enter, CallString),
> 
> That comment looks strange too.

Yes, Simon Taylor pointed those out too.  I deleted the comments.

-- 
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.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list