Class PtSensVisitor<VarType extends ContextVar>

  • Direct Known Subclasses:
    Obj_full_extractor

    public abstract class PtSensVisitor<VarType extends ContextVar>
    extends Object
    A container for storing context sensitive querying result of geomPTA. Similar to the class PointsToSetInternal for SPARK. This class maintains two views for the results: 1. Table view: every object has a separate list of its context sensitive versions; 2. List view: all context sensitive objects are put in a single list.
    Author:
    xiao
    • Constructor Detail

      • PtSensVisitor

        public PtSensVisitor()
    • Method Detail

      • prepare

        public void prepare()
        Called before each round of collection.
      • finish

        public void finish()
        Called after each round of collection.
      • getUsageState

        public boolean getUsageState()
        The visitor contains valid information only when this function returns true.
        Returns:
      • numOfDiffObjects

        public int numOfDiffObjects()
        Return the number of different points-to targets.
      • hasNonEmptyIntersection

        public boolean hasNonEmptyIntersection​(PtSensVisitor<VarType> other)
        Tests if two containers have contain same things. Can be used to answer the alias query.
      • getCSList

        public List<VarType> getCSList​(Node var)
        Obtain the list of context sensitive objects pointed to by var.
        Parameters:
        var -
        Returns:
      • toSparkCompatiableResult

        public PointsToSet toSparkCompatiableResult​(VarNode vn)
        Transform the result to SPARK style context insensitive points-to set. The transformed result is stored in the points-to set of the querying pointer.
        Parameters:
        vn - : the querying pointer
        Returns:
      • debugPrint

        public void debugPrint()
        Print the objects.
      • visit

        public abstract boolean visit​(Node var,
                                      long L,
                                      long R,
                                      int sm_int)
        We use visitor pattern to collect contexts. Derived classes decide how to deal with the variable with the contexts [L, R). Returning false means this interval [L, R) is covered by other intervals.
        Parameters:
        var -
        L -
        R -
        sm_int - : the integer ID of the SootMethod