[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LocalUses and FlowAnalysis documentation bugs



Hi Chris...

At various times, someone makes a change to some piece of the
documentation because it doesn't fit with their definitions of terms
like in, out, before, after. The result is the current mess that you
see, with these terms being used to mean different things in different
files. So, rather than making yet another of these changes that uses
certain definitions for a couple files, I think it would be better to
standardize on some terms, then get someone to go through all the files
and make sure only those terms are used everywhere.

What terms should we use? Both before/after and in/out, at least to
me, suggest program flow direction. Certainly before/after are used
in the names of methods in Soot, and I think it would be hard to
convince anyone that they could mean dataflow direction. In/out are more
ambiguous, but lots of people, including the Muchnick book, use them for
program flow direction. So, given this ambiguity, I suggest avoiding
in/out altogether, and coming up with some unambigiuous terms for the
data flow direction. Anyone have any suggestions?

Ondrej

On Wed, Jul 07, 2004 at 06:13:11AM -0400, Chris Pickett wrote:
> Hi,
> 
> I think I've found a couple more bugs in the API.  I've attached a 
> patch that fixes both of them, although there might be better ways to do 
> it (as was the case with FlowSet.java).
> 
> First, LocalUses says it returns a List of Units, whereas in reality 
> both implementations of this interface return a List of 
> UnitValueBoxPairs.  Also, SimpleLocalUses says it returns a 
> UnitValueBoxPair, but it returns a List of them.
> 
> Second, at line 139 of BackwardFlowAnalysis.java:
> 
>    flowThrough(afterFlow, s, beforeFlow);
> 
> which says that the afterFlow is the IN set and the beforeFlow is the 
> OUT set.
> 
> And at line 159 of ForwardFlowAnalysis.java:
> 
>    flowThrough(beforeFlow, s, afterFlow);
> 
> which says that the beforeFlow is the IN set and the afterFlow is the 
> OUT set.
> 
> (okay, there are other places to see it, but that seems clearest)
> 
> However, the documentation says that getFlowBefore(s) returns the IN set 
> and getFlowAfter(s) returns the OUT set, and makes no mention of 
> direction.  I had assumed until now that "before" always meant "in" and 
> "after" always mean "out", and only just caught this bug in my analyses. 
>   If I'm wrong, then I've seriously misunderstood something here, and 
> would still appreciate an explanation.
> 
> I'm not sure, but it might be worth checking through all 
> BackwardFlowAnalysis subclasses and their clients to see that they 
> understand before and after correctly.
> 
> Thanks,
> Chris
>