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 Summary
Modifier and TypeMethodDescriptionappend(ContainerContext[] ctxt1, ContainerContext[] ctxt2) Return the union of the given contextsgetFirstPosition(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)getIndexContext(soot.Value index, soot.jimple.Stmt stmt) Retrieves a context for a given indexgetKeyContext(soot.Value key, soot.jimple.Stmt stmt) Retrieves a context for a given keygetLastPosition(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)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)intersect(ContainerContext apKey, ContainerContext stmtKey) Checks whether the two arguments intersectbooleanisReadOnly(soot.Unit unit) Returns whether the given value is used in a read-only fashionlessThanEqual(ContainerContext ctxt1, ContainerContext ctxt2) Returns whether ctxt1 is less than ctxt2shift(ContainerContext ctxt, int n, boolean exact) Shifts the ctxt to the rightbooleanshouldSmash(ContainerContext[] ctxts) Returns whether the context is still useful or not
-
Method Details
-
intersect
Checks whether the two arguments intersect- Parameters:
apKey- key from the access pathstmtKey- key from the statement- Returns:
- true if args fully intersects, maybe on part match and false on definitely no match
-
append
Return the union of the given contexts- Parameters:
ctxt1- key from the access pathctxt2- key from the statement- Returns:
- new context definition
-
getKeyContext
Retrieves a context for a given key- Parameters:
key- requested valuestmt- statement containing key- Returns:
- new context definition
-
getIndexContext
Retrieves a context for a given index- Parameters:
index- requested valuestmt- statement containing index- Returns:
- new context definition
-
getNextPosition
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- liststmt- statement that uses value- Returns:
- new context definition
-
getFirstPosition
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- liststmt- statement that uses value- Returns:
- new context definition
-
getLastPosition
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- liststmt- statement that uses value- Returns:
- new context definition
-
lessThanEqual
Returns whether ctxt1 is less than ctxt2- Parameters:
ctxt1- first contextctxt2- second context- Returns:
- true ctxt1 is less than ctxt2
-
shift
Shifts the ctxt to the right- Parameters:
ctxt- current contextn-- Returns:
- new context definition
-
shouldSmash
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
-