[m-rev.] diff: fix saved_vars.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed May 14 17:14:18 AEST 2003


On 14-May-2003, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> compiler/saved_vars.m:
> 	Fix a bug exposed by my change to table_gen.m: do not duplicate
> 	unifications with features such as call_table_gen.
...
> +		goal_info_get_features(GoalInfo, Features),
> +		% If the goal has a feature such as call_table_gen or impure,
> +		% we don't want to duplicate it.
> +		set__empty(Features)

What about innocuous features such as `constraint'?
Or other innocuous features added in the future?

I think it would be better to write that as

	goal_info_get_features(GoalInfo, Features),
	(all [Feature] (set__member(Feature, Features) =>
		ok_to_duplicate(Feature) = yes))

where ok_to_duplicate is defined as

		% return yes iff it is OK for saved_vars.m to duplicate
		% a goal which has been marked with the specified feature.
	:- func ok_to_duplicate(goal_feature) = bool.
	ok_to_duplicate(constraint) = yes.
	ok_to_duplicate(call_table_gen) = no.
	...

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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