Interface IContainerStrategy

All Known Implementing Classes:
AbstractListStrategy, ConstantMapStrategy, SmashAllContainerStrategy, TestConstantStrategy

public interface IContainerStrategy
Strategy for resolving keys/indices and reasoning about their relation
Author:
Tim Lange
  • Method Details

    • intersect

      Tristate intersect(ContainerContext apKey, ContainerContext stmtKey)
      Checks whether the two arguments intersect
      Parameters:
      apKey - key from the access path
      stmtKey - key from the statement
      Returns:
      true if args fully intersects, maybe on part match and false on definitely no match
    • append

      ContainerContext[] append(ContainerContext[] ctxt1, ContainerContext[] ctxt2)
      Return the union of the given contexts
      Parameters:
      ctxt1 - key from the access path
      ctxt2 - key from the statement
      Returns:
      new context definition
    • getKeyContext

      ContainerContext getKeyContext(soot.Value key, soot.jimple.Stmt stmt)
      Retrieves a context for a given key
      Parameters:
      key - requested value
      stmt - statement containing key
      Returns:
      new context definition
    • getIndexContext

      ContainerContext getIndexContext(soot.Value index, soot.jimple.Stmt stmt)
      Retrieves a context for a given index
      Parameters:
      index - requested value
      stmt - statement containing index
      Returns:
      new context definition
    • getNextPosition

      ContainerContext getNextPosition(soot.Value lst, soot.jimple.Stmt stmt)
      Retrieves a context given an implicit key after the given statement (i.e. a list where the key is dependent on the number of add calls before)
      Parameters:
      lst - list
      stmt - statement that uses value
      Returns:
      new context definition
    • getFirstPosition

      ContainerContext getFirstPosition(soot.Value lst, soot.jimple.Stmt stmt)
      Retrieves a context given an implicit key before the given statement (i.e. a list where the key is dependent on the number of add calls before)
      Parameters:
      lst - list
      stmt - statement that uses value
      Returns:
      new context definition
    • getLastPosition

      ContainerContext getLastPosition(soot.Value lst, soot.jimple.Stmt stmt)
      Retrieves a context given an implicit key before the given statement (i.e. a list where the key is dependent on the number of add calls before)
      Parameters:
      lst - list
      stmt - statement that uses value
      Returns:
      new context definition
    • lessThanEqual

      Tristate lessThanEqual(ContainerContext ctxt1, ContainerContext ctxt2)
      Returns whether ctxt1 is less than ctxt2
      Parameters:
      ctxt1 - first context
      ctxt2 - second context
      Returns:
      true ctxt1 is less than ctxt2
    • shift

      ContainerContext shift(ContainerContext ctxt, int n, boolean exact)
      Shifts the ctxt to the right
      Parameters:
      ctxt - current context
      n -
      Returns:
      new context definition
    • shouldSmash

      boolean shouldSmash(ContainerContext[] ctxts)
      Returns whether the context is still useful or not
      Parameters:
      ctxts - contexts
      Returns:
      true if context contains no useful information and thus, the collection should be smashed
    • isReadOnly

      boolean isReadOnly(soot.Unit unit)
      Returns whether the given value is used in a read-only fashion
      Parameters:
      unit - current statement
      Returns:
      true if is read-only