Class DefaultSolver

java.lang.Object
pascal.taie.analysis.pta.core.solver.DefaultSolver
All Implemented Interfaces:
Solver

public class DefaultSolver extends Object implements Solver
  • Constructor Details

  • Method Details

    • getOptions

      public AnalysisOptions getOptions()
      Specified by:
      getOptions in interface Solver
    • getHeapModel

      public HeapModel getHeapModel()
      Specified by:
      getHeapModel in interface Solver
    • getContextSelector

      public ContextSelector getContextSelector()
      Specified by:
      getContextSelector in interface Solver
    • getCSManager

      public CSManager getCSManager()
      Specified by:
      getCSManager in interface Solver
    • getHierarchy

      public ClassHierarchy getHierarchy()
      Specified by:
      getHierarchy in interface Solver
    • getTypeSystem

      public TypeSystem getTypeSystem()
      Specified by:
      getTypeSystem in interface Solver
    • getCallGraph

      public CSCallGraph getCallGraph()
      Specified by:
      getCallGraph in interface Solver
    • getPointsToSetOf

      public PointsToSet getPointsToSetOf(Pointer pointer)
      Description copied from interface: Solver
      Returns the points-to set of given pointer. If the pointer has not been associated with a points-to set, this method will create a new set and associate it with the pointer.
      Specified by:
      getPointsToSetOf in interface Solver
    • makePointsToSet

      public PointsToSet makePointsToSet()
      Description copied from interface: Solver
      Creates a new empty points-to set.
      Specified by:
      makePointsToSet in interface Solver
    • setPlugin

      public void setPlugin(Plugin plugin)
      Description copied from interface: Solver
      Sets plugin to this solver.
      Specified by:
      setPlugin in interface Solver
    • solve

      public void solve()
      Runs pointer analysis algorithm.
      Specified by:
      solve in interface Solver
    • addPointsTo

      public void addPointsTo(Pointer pointer, PointsToSet pts)
      Specified by:
      addPointsTo in interface Solver
    • addPointsTo

      public void addPointsTo(Pointer pointer, CSObj csObj)
      Specified by:
      addPointsTo in interface Solver
    • addPointsTo

      public void addPointsTo(Pointer pointer, Context heapContext, Obj obj)
      Specified by:
      addPointsTo in interface Solver
    • addVarPointsTo

      public void addVarPointsTo(Context context, Var var, PointsToSet pts)
      Specified by:
      addVarPointsTo in interface Solver
    • addVarPointsTo

      public void addVarPointsTo(Context context, Var var, CSObj csObj)
      Specified by:
      addVarPointsTo in interface Solver
    • addVarPointsTo

      public void addVarPointsTo(Context context, Var var, Context heapContext, Obj obj)
      Specified by:
      addVarPointsTo in interface Solver
    • addPointerFilter

      public void addPointerFilter(Pointer pointer, Predicate<CSObj> filter)
      Description copied from interface: Solver
      Adds an object filter to given pointer. Note that the filter works only after it is added to the pointer, and it cannot filter out the objects pointed to by the pointer before it is added.
      Specified by:
      addPointerFilter in interface Solver
    • addPFGEdge

      public void addPFGEdge(PointerFlowEdge edge, Transfer transfer)
      Description copied from interface: Solver
      Adds a pointer flow edge (with edge transfer) to the PFG.
      Specified by:
      addPFGEdge in interface Solver
    • addEntryPoint

      public void addEntryPoint(EntryPoint entryPoint)
      Description copied from interface: Solver
      Adds an entry point. Notes that the method in entry point will be set as an entry in CallGraph
      Specified by:
      addEntryPoint in interface Solver
    • addCallEdge

      public void addCallEdge(Edge<CSCallSite,CSMethod> edge)
      Description copied from interface: Solver
      Adds a call edge.
      Specified by:
      addCallEdge in interface Solver
      Parameters:
      edge - the added edge.
    • addCSMethod

      public void addCSMethod(CSMethod csMethod)
      Description copied from interface: Solver
      Adds a context-sensitive method.
      Specified by:
      addCSMethod in interface Solver
      Parameters:
      csMethod - the added context-sensitive method.
    • addStmts

      public void addStmts(CSMethod csMethod, Collection<Stmt> stmts)
      Description copied from interface: Solver
      Adds stmts to the analyzed program. Solver will process given stmts.
      Specified by:
      addStmts in interface Solver
      Parameters:
      csMethod - the container method of the stmts
      stmts - the added stmts
    • addIgnoredMethod

      public void addIgnoredMethod(JMethod method)
      Description copied from interface: Solver
      If a plugin takes over the analysis of a method, and wants this solver to ignore the method (for precision and/or efficiency reasons), then it could call this API with the method. After that, this solver will not process the method body.

      Typically, this API should be called at the initial stage of pointer analysis, i.e., in Plugin.onStart().

      Specified by:
      addIgnoredMethod in interface Solver
      Parameters:
      method - the method to be ignored.
    • initializeClass

      public void initializeClass(JClass cls)
      Description copied from interface: Solver
      Analyzes the static initializer (i.e., <clinit>) of given class.
      Specified by:
      initializeClass in interface Solver
      Parameters:
      cls - the class to be initialized.
    • getResult

      public PointerAnalysisResult getResult()
      Specified by:
      getResult in interface Solver
      Returns:
      pointer analysis result.