[m-rev.] for review: improve termination analysis of special preds

Ian MacLarty maclarty at cs.mu.OZ.AU
Wed Jan 19 02:28:47 AEDT 2005


On Tue, Jan 11, 2005 at 03:07:26PM +1100, Julien Fischer wrote:
> +% Currently, the only thing implemented in this module is a check to see
> +% if user-defined special predicates terminate.  A warning is emitted
> +% for all those that do not.
> +%

Should this be "A warning is emitted for all those that cannot be proven to
terminate"?

> +process_special_pred_for_type(ModuleInfo, SpecialPredId, TypeCtor,
> +		PredId, TypeDefn, !IO) :-
> +	(
> +		special_pred_needs_term_check(ModuleInfo, SpecialPredId,
> +			TypeDefn)
> +	->
> +  		% Compiler generated special preds are always mode 0.
> + 		proc_id_to_int(ProcId, 0),
> + 		module_info_pred_proc_info(ModuleInfo,
> + 			PredId, ProcId, _, ProcInfo),
> + 		proc_info_goal(ProcInfo, BodyGoal),
> + 		%
> + 		% We cannot just look up the the termination_info because
> + 		% the termination status of compiler generated wrapper
> + 		% predicates for special preds is always set to terminates.
> + 		% Instead, we check if the body goal of the generated wrapper
> + 		% predicate terminates.
> + 		%
> +		( not goal_cannot_loop(ModuleInfo, BodyGoal) ->
> + 			get_type_defn_context(TypeDefn, Context),
> +			emit_warning(Context, SpecialPredId,

Since emit_warning is a fairly generic name, should you not module qualify the
call here so the compiler doesn't think it's ambiguous when intermodule
optimization is turned on?

Otherwise it looks good to me.

Ian.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list