[m-rev.] For Review: Bug fixes in constraints based mode analysis.

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Feb 17 19:33:36 AEDT 2006


On 17-Feb-2006, Richard Fothergill <fothergill at gmail.com> wrote:
> Bugfixes for constraints based mode analysis (propagation solver).

Thanks, Richard.

> +        % Preprocess to accomdate implied modes.

s/accomdate/accommodate/

> -    % The keys of RepvarMap are the program variables nonlocal
> -    % to Goals. Each is mapped to the mc_rep_var representation
> -    % of the proposition that it is produced at a Goal for every
> -    % Goal it is nonlocal to in Goals.
> +    % The keys of RepvarMap are the program variables nonlocal to Goals that
> +    % appear in goals. Each is mapped to the mc_rep_var representation of the
> +    % proposition that it is produced at a Goal for every Goal it is nonlocal
> +    % to in Goals.

I don't understand "to in Goals".

>  make_conjunct_nonlocal_repvars(PredId, Goal, !RepvarMap) :-
>      GoalInfo = snd(Goal),
> -    goal_info_get_nonlocals(GoalInfo, NonLocals),
> +    goal_info_get_nonlocals(GoalInfo, Nonlocals),
>      goal_info_get_goal_path(GoalInfo, GoalPath),
> +    goal_util.goal_vars(Goal, VarsInGoal),
> +    set.intersect(Nonlocals, VarsInGoal, NonlocalsInGoal),

If Goal includes other goals, those will be traversed twice; if the goal
structure is deep, that can lead to lots of wasted work.

The right solution to the problem of the nonlocal set being too conservative
is to run the quantification pass just before this pass; that will set the
nonlocals to the exactly right sets (no approximations).

Otherwise, the diff is fine.

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