Class AbstractModel

java.lang.Object
pascal.taie.analysis.pta.plugin.util.SolverHolder
pascal.taie.analysis.pta.plugin.util.AbstractModel
All Implemented Interfaces:
Model
Direct Known Subclasses:
LookupModel, MethodTypeModel, OthersModel, ReflectiveActionModel, SolarModel, StringBasedModel

public abstract class AbstractModel extends SolverHolder implements Model
Provides common functionalities for implementing API models.
  • Field Details

  • Constructor Details

    • AbstractModel

      protected AbstractModel(Solver solver)
  • Method Details

    • registerVarAndHandlers

      protected void registerVarAndHandlers()
    • registerRelevantVarIndexes

      protected void registerRelevantVarIndexes(JMethod api, int... indexes)
    • registerAPIHandler

      protected void registerAPIHandler(JMethod api, TriConsumer<CSVar,PointsToSet,Invoke> handler)
    • handleNewInvoke

      public void handleNewInvoke(Invoke invoke)
      Specified by:
      handleNewInvoke in interface Model
    • isRelevantVar

      public boolean isRelevantVar(Var var)
      Specified by:
      isRelevantVar in interface Model
    • handleNewPointsToSet

      public void handleNewPointsToSet(CSVar csVar, PointsToSet pts)
      Specified by:
      handleNewPointsToSet in interface Model
    • getArgs

      protected List<PointsToSet> getArgs(CSVar csVar, PointsToSet pts, Invoke invoke, int... indexes)
      For invocation r = v.foo(a0, a1, ..., an); when points-to set of v or any ai (0 ≤ i ≤ n) changes, this convenient method returns points-to sets relevant arguments. For case v/ai == csVar.getVar(), this method returns pts, otherwise, it just returns current points-to set of v/ai.
      Parameters:
      csVar - may be v or any ai.
      pts - changed part of csVar
      invoke - the call site which contain csVar
      indexes - indexes of the relevant arguments