[Soot-list] Soot-list Digest, Vol 96, Issue 59

Matteo Ceccarello matteo.ceccarello at gmail.com
Thu May 2 04:59:07 EDT 2013


Hi Marc-Andrè and Rohan,

thank you for your replies. I need to check for equality because I want to
use Values as elements in the FlowSet of the analysis I'm going to perform.
Basically, starting from a statement, I want to propagate backwards the
values needed by that statement.

I'll try to use the EquivTo interface to check for equivalence, let's see
what happens :)

Thank you
Matteo

Date: Sat, 27 Apr 2013 22:08:15 -0400
> From: Marc-Andr? Laverdi?re-Papineau
>         <marc-andre.laverdiere-papineau at polymtl.ca>
> Subject: Re: [Soot-list] Compare Value instances for equality
> To: soot-list at sable.mcgill.ca
> Message-ID: <517C848F.5030706 at polymtl.ca>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hello,
>
> I think you are right. Some people told the list that reference equality
> was used in Soot for performance reasons, so checking for equals() was
> superfluous. You could dig in the archives for details.
>
> I recall that there is and EquivTo interface that is implemented by a
> whole bunch of stuff (if not all the Value classes). That one has
> methods equivHashCode and equivTo that answers the closely related
> question "is this value equivalent to another" instead of if they are
> equals.
>
> That being said, I have to ask the question: why do you need to check
> for equality in the first place?
>
> Marc-Andr? Laverdi?re-Papineau
> Doctorant - PhD Candidate
>
> On 04/27/2013 08:32 AM, Matteo Ceccarello wrote:
> > Hi all,
> >
> > I just started working with SOOT. I'm trying to perform a data flow
> > analysis using `soot.Value` instances as elements of the flow sets.
> > However it seems that none of the classes that implement that interface
> > override the method `equals`. Am I right?
> >
> > If so, how can I use `soot.Value` instances in my flow analysis?
> >
> > Thank you very much
> >
> > Matteo
> >
> > --
> > Matteo Ceccarello, Computer Engineering student
> > Universita' di Padova, Dipartimento di Ingegneria dell'Informazione,
> > URL: http://www.dei.unipd.it/~ceccarel
> > LinkedIn: http://it.linkedin.com/pub/matteo-ceccarello/60/322/931/
> >
> >
> >
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list at sable.mcgill.ca
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> >
>
>
>
> Message: 4
> Date: Sun, 28 Apr 2013 16:44:57 +0530
> From: Rohan Padhye <rohanpadhye at cse.iitb.ac.in>
> Subject: Re: [Soot-list] Compare Value instances for equality
> To: <soot-list at sable.mcgill.ca>
> Message-ID: <b4c029b70befcc9a56625b0e2c72dd94 at cse.iitb.ac.in>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> Hello Matteo,
>
> For atomic soot.Value subtypes such as soot.Local, you can use them
> directly in flow sets as you will always find unique references - Java's
> default behaviour for equals() is to test reference equality. The same
> can be said for SootClass, SootMethod and SootField as well I think.
>
> For more complex soot.Value types which are made up of multiple atomic
> Values (e.g. FieldRef or Expr), the expressions will be different
> objects when they appear in different statements even if they have the
> same operands/operators. These can be tested for structural equivalence
> using the EquivTo interface that Marc-Andre mentioned if you are doing
> something like common sub-expression elimination. Hence these classes
> may not be suitable for use in standard Java sets if you want to group
> expressions with common operands.
>
> Hope this clarifies your doubt.
>
> Regards,
> Rohan
>
> On 2013-04-27 18:02, Matteo Ceccarello wrote:
> > Hi all,
> >
> > I just started working with SOOT. I'm trying to perform a data flow
> > analysis using `soot.Value` instances as elements of the flow sets.
> > However
> > it seems that none of the classes that implement that interface
> > override
> > the method `equals`. Am I right?
> >
> > If so, how can I use `soot.Value` instances in my flow analysis?
> >
> > Thank you very much
> >
> > Matteo
> >
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list at sable.mcgill.ca
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
> --
> Regards,
> Rohan Padhye
>
>
> ------------------------------
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
> End of Soot-list Digest, Vol 96, Issue 59
> *****************************************
>



-- 
Matteo Ceccarello, Computer Engineering student
Universita' di Padova, Dipartimento di Ingegneria dell'Informazione,
URL: http://www.dei.unipd.it/~ceccarel
LinkedIn: http://it.linkedin.com/pub/matteo-ceccarello/60/322/931/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130502/dd5a15de/attachment.html 


More information about the Soot-list mailing list