Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run backwards IFDS? #39

Closed
coder-chenzhi opened this issue Dec 29, 2019 · 1 comment
Closed

How to run backwards IFDS? #39

coder-chenzhi opened this issue Dec 29, 2019 · 1 comment

Comments

@coder-chenzhi
Copy link

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!

@ericbodden
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants