[m-rev.] for review: speedup up tree_bitset.difference

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Sep 2 17:15:02 AEST 2011


On 08-Aug-2011, Peter Wang <novalazy at gmail.com> wrote:
> Maybe name ParentLevelA = LevelA + 1 explicitly.

Done.

> > +                interiornode_difference(LevelA, InteriorHeadA, InteriorTailA,
> > +                    LevelA, SelectedHeadB, SelectedTailB,
> > +                    Level, InteriorNodes),
> 
> Does LevelA go with SelectedNodesB here?  If so, please add a comment
> explaining why.

Done.

> I found that comment hard to parse.  How about:
> 
>     The leaf nodes in ListA cover at most one level 1 interior node's
>     span of bits. Call that the hypothetical level 1 interior node.
>     HeadB ^ init_offset should be a multiple of (a power of) that span,
>     so if it is greater than the initial offset of that hypothetical
>     node, then it should be greater than the final offset of that
>     hypothetical node as well. The limit offset is one bigger than the
>     final offset.
> 
> Otherwise, there were a couple of errors:
> 
>     interior's node -> interior node's
> 
>     greater the -> greater than the

Done, in several places.

> > +%           NodesB = [HeadB]
> 
> Stray line.

Deleted.

> > +                    ListSub = [ListSubHead | ListSubTail],
> > +                    raise_interiors_to_level(LevelA, LevelSub,
> > +                        ListSubHead, ListSubTail, RaisedHead, RaisedTail),
> > +                    trace [compile_time(flag("tree-bitset-checks"))] (
> > +                        expect(unify(RaisedTail, []),
> > +                            $module, $pred, "RaisedTail != []")
> > +                    ),
> > +                    Level = LevelA,
> > +                    List = [RaisedHead | TailA]
> > +                )
> 
> Maybe add a version of raise_interiors_to_level, so the reader does not
> wonder about the assertion on RaisedTail.

Added a comment instead, since the assertion holds for some but not all
calls to raise_interiors_to_level, and I cannot think of a version
that would be useful here.

Thanks for the review, Peter.

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