[m-rev.] for review: fix lambda expansion misordered arguments

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Sep 28 14:19:19 AEST 2011


Hi Peter,

On Tue, 27 Sep 2011, Peter Wang wrote:

> [in particular the statement about the rhs_lambda_goal nonlocals list]
>
>
> Branches: main, 11.07
>
> The lambda expansion pass sometimes created predicates with misordered
> arguments, e.g. in a different order to that of the modes, and with type_info
> variables not at the front of the list.  I noticed this problem when compiling
> exception.m.
>
> `expand_lambda' creates a map from corresponding lists of OrigVars and
> OrigArgModes.  OrigVars was taken from a `unify_rhs.rhs_lambda_goal' term,
> whereas OrigArgModes is derived from the uni_modes of a `unification.construct'
> term.
>
> compiler/lambda.m:
> 	Take OrigVars from the list of arguments in the `unification.construct'
> 	term, which must be in the same order as the list of uni_modes right
> 	next to it.
>
> 	Add sanity check.
>
> compiler/hlds_goal.m:
> 	State that the `rhs_lambda_goal' nonlocals list is in no particular
> 	order.

As a workaround fro the problem the diff looks fine.

More generally, I think rhs_nonlocals field shouldn't be a list in the
first place - it's originally constructed from a set_of_var so perhaps
it should simply be left as such?

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