flattening

Stephen Weeks sweeks@intertrust.com
Thu, 13 May 1999 14:09:12 -0700 (PDT)


> AHHH.   Suresh  and I just talked about it, and I realized that you were most
> wise (in your mail) and you DO have to increment the count  for  select.   If
> you don't, then consider the code
> 
>         let val x = (1, y)
>             val y1 = #2 x
>             val y2 = #2 x
>         in (y1, y2)
>         end
> 
> Note,  that  the  counts  on  x,  y,  y1  and  y2 are all 1, but this code is
> equivalent to
>         (y, y)
> Bad.

You are right.  I believe this is a (performance) bug in the Fol
flattener.  I think that with a bit more cleverness the counts could
be propagated back to y, but it's certainly not done and I don't see
offhand how to do it.