soot-oss / heros

IFDS/IDE Solver for Soot and other frameworks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run backwards IFDS?

coder-chenzhi opened this issue · comments

I found existing examples of using the Heros' IFDS solver with Soot. Following is the example driver code. However, it performs IFDSReachingDefinitions, which is forward analysis. From my understanding, the IFDSLiveVariable should be backward analysis. What should I do if I want to run the IFDSLiveVariable? For example, should I change the type of ICFG to BackwardsInterproceduralCFG?

// Subclass of SceneTransformer to run Heros IFDS solver in Soot's "wjtp" pack
public class IFDSDataFlowTransformer extends SceneTransformer {
    @Override
    protected void internalTransform(String phaseName, Map<String, String> options) {
        JimpleBasedInterproceduralCFG icfg= new JimpleBasedInterproceduralCFG();
        IFDSTabulationProblem<Unit, Pair<Value, 
                Set<DefinitionStmt>>, SootMethod, 
                InterproceduralCFG<Unit, SootMethod>> problem = new IFDSReachingDefinitions(icfg);

        IFDSSolver<Unit, Pair<Value, Set<DefinitionStmt>>, 
                SootMethod, InterproceduralCFG<Unit, SootMethod>> solver = 
                    new IFDSSolver<Unit, Pair<Value, Set<DefinitionStmt>>, SootMethod, 
                                   InterproceduralCFG<Unit, SootMethod>>(problem);

        System.out.println("Starting solver");
        solver.solve();
        System.out.println("Done");
    }
}

Thanks!

Yes that is correct, you should be using BackwardsInterproceduralCFG. Please reopen if this does not answer your question.