本文整理汇总了Java中heros.solver.IFDSSolver.solve方法的典型用法代码示例。如果您正苦于以下问题:Java IFDSSolver.solve方法的具体用法?Java IFDSSolver.solve怎么用?Java IFDSSolver.solve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类heros.solver.IFDSSolver
的用法示例。
在下文中一共展示了IFDSSolver.solve方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runSolver
import heros.solver.IFDSSolver; //导入方法依赖的package包/类
public void runSolver(final boolean followReturnsPastSeeds, final String...initialSeeds) {
IFDSSolver<Statement, JoinableFact, TestMethod, InterproceduralCFG<Statement, TestMethod>> solver =
new IFDSSolver<Statement, JoinableFact, TestMethod, InterproceduralCFG<Statement, TestMethod>>(
createTabulationProblem(followReturnsPastSeeds, initialSeeds));
solver.solve();
assertAllFlowFunctionsUsed();
}
示例2: analyze
import heros.solver.IFDSSolver; //导入方法依赖的package包/类
public void analyze() {
icfg.initForMethod(task.getStartMethod());
InterproceduralAnalysisProblem problem = new InterproceduralAnalysisProblem(icfg);
IFDSSolver<Unit, FlowAbstraction, SootMethod, JitIcfg> solver = new IFDSSolver<Unit, FlowAbstraction, SootMethod, JitIcfg>(
problem, jumpFunctions, endSum, inc) {
// FlowTwist -> PropagateAndMerge
@Override
protected void propagate(FlowAbstraction sourceVal, Unit target, FlowAbstraction targetVal,
EdgeFunction<IFDSSolver.BinaryDomain> f, Unit relatedCallSite, boolean isUnbalancedReturn,
boolean force) {
// Report leaks from summaries
Map<FlowAbstraction, Set<List<FlowAbstraction>>> summaryLeaks = jumpFn.summaryPathsLookup(sourceVal,
target);
if (!summaryLeaks.isEmpty()) {
if (DEBUG_REPORT)
LOGGER.debug("Report (sum) " + sourceVal + " --- " + target.getJavaSourceStartLineNumber() + ":"
+ target + " --- " + summaryLeaks);
reporter.report(sourceVal, summaryLeaks);
}
// Set neighbours
FlowAbstraction neighbour = null;
Set<FlowAbstraction> similarTargets = jumpFn.forwardLookup(sourceVal, target).keySet();
for (FlowAbstraction fa : similarTargets) {
// If the values are similar, but not exact
if (!targetVal.equals(FlowAbstraction.zeroAbstraction()) && targetVal.getUnit() != target
&& !fa.exactEquals(targetVal) && fa.getShortName().equals(targetVal.getShortName())) {
fa.addNeighbour(targetVal);
neighbour = fa;
if (DEBUG_NEIGHBOURS)
LOGGER.debug("Initiate Neighbour " + targetVal + ":" + targetVal.getUnit() + " TO " + fa
+ ":" + fa.getUnit() + " AT " + target + " METHOD " + icfg.getMethodOf(target));
break;
}
}
if (neighbour == null)
propagateAfterMerge(sourceVal, target, targetVal, f, relatedCallSite, isUnbalancedReturn, force);
else
propagateAfterMerge(sourceVal, target, neighbour, f, relatedCallSite, isUnbalancedReturn, force);
}
};
solver.solve();
}
示例3: _runOneDirectionSolver
import heros.solver.IFDSSolver; //导入方法依赖的package包/类
protected static void _runOneDirectionSolver(final TabulationProblem tabulationProblem, IFDSSolver<Unit, Trackable, SootMethod, BiDiInterproceduralCFG<Unit, SootMethod>> solver) {
AnalysisReporting.ifdsStarting(tabulationProblem.getContext(), solver);
solver.solve();
AnalysisReporting.ifdsFinished(tabulationProblem.getContext(), solver, FlowFunctionFactory.propCounter.get());
FlowFunctionFactory.propCounter.set(0);
}