[m-rev.] for review: goal_path representation

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Sep 26 16:54:47 AEST 2011


On 26-Sep-2011, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> > +reverse_goal_path_to_steps(rgp_nil, []).
> > +reverse_goal_path_to_steps(rgp_cons(EarlierPath, LaterStep),
> > +        [LaterStep | EarlierSteps]) :-
> > +    reverse_goal_path_to_steps(EarlierPath, EarlierSteps).
> > +
> >      % The reverse renaming annotation is in the form: R = R_ite_HowMany.
> >      % The annotation is attached to the program point but actually means
> >      % to be added before the program point.
> 
> Can the conversion between reverse and foward goal paths be moved into
> mdbcomp/goal_path.m?

It is already in mdbcomp/goal_path.m. What this code is doing is different.
I could update its caller to use the new data structures, but there would be
no point, since this code is actually unnecessary; its task should be done
in a totally different way, a way that does NOT need goal paths of any kind.
However, that would be a big change that noone has time for right now.

> > -    ;       alt_switch(maybe(int)).
> > +    ;       alt_switch(maybe_switch_num_functors).
> >              % The number of alternatives in a switch is equal to the number of
> >              % function symbols in the type of the switched-on variable. This
> >              % number is given by the argument integer, if present; if the
> 
> This change is not described in the ChangeLog.
> 
> I know we don't describe everything (like little fixes to spelling for example
> unless they're the only change) but this is a change to a datastructure.

It is not a change to a data structure, since maybe_switch_num_functors
is isomorphic to maybe(int). The purpose of the change (independence from
other types in the standard library) WAS described in the log message.

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