[m-rev.] diff: renaming vars

Ralph Becket rafe at csse.unimelb.edu.au
Fri Sep 28 13:36:39 AEST 2007


Zoltan Somogyi, Friday, 28 September 2007:
> In several places, we used to use substitutions in which the substituted terms
> had to be variables. This diff replaces those substitutions with simple
> variable renamings, which can be used without the gymnatics that used to
> be required to convert the resulting terms back into variables.
> 
> library/varset.m:
> 	Supplement predicates that return substitutions in which the
> 	replacement terms are always variables with predicates that return
> 	the same information as variable renamings. Add a comment asking people
> 	to use the new versions. (They aren't marked as obsolete yet).
> 
> compiler/prog_util.m:
> 	Remove the substitute_vars predicate, which applied substitutions
> 	whose range was restricted to variables.
> 
> compiler/prog_data.m:
> 	Move predicates for applying renamings to non-HLDS data structures
> 	here from hlds_goal.m, and add other predicates for performing
> 	renamings to replace the functionality deleted from prog_util.m.
> 
> 	Replace a bool specifying whether every variable needs to be renamed
> 	with a purpose-specific type.
> 
> compiler/hlds_goal.m:
> 	Delete the predicates moved to prog_data.m.
> 
> compiler/*.m:
> 	Conform to the changes above.

That looks fine to me.
--------------------------------------------------------------------------
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