Class ReachingDefinitions
- java.lang.Object
-
- it.unive.lisa.analysis.impl.dataflow.ReachingDefinitions
-
- All Implemented Interfaces:
DataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>,SemanticEvaluator
public class ReachingDefinitions extends java.lang.Object implements DataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>
An implementation of the reaching definition dataflow analysis.
-
-
Constructor Summary
Constructors Constructor Description ReachingDefinitions()Builds an empty reaching definition object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanProcess(SymbolicExpression expression)Yieldstrueif the domain can processexpression,falseotherwise.booleanequals(java.lang.Object obj)java.util.Collection<ReachingDefinitions>gen(Identifier id, ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)The dataflow gen operation, yielding the dataflow elements that are generated by the assignment of the givenexpressionto the givenid.java.util.Collection<ReachingDefinitions>gen(ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)The dataflow gen operation, yielding the dataflow elements that are generated by evaluating the given non-assigningexpression.java.util.Collection<Identifier>getInvolvedIdentifiers()Yields all theIdentifiers that are involved in the definition of this element.inthashCode()java.util.Collection<ReachingDefinitions>kill(Identifier id, ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)The dataflow kill operation, yielding the dataflow elements that are killed by the assignment of the givenexpressionto the givenid.java.util.Collection<ReachingDefinitions>kill(ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)The dataflow kill operation, yielding the dataflow elements that are killed by evaluating the given non-assigningexpression.ReachingDefinitionspopScope(ScopeToken scope)Pop a scope to the dataflow element.ReachingDefinitionspushScope(ScopeToken scope)Push a scope to the dataflow element.DomainRepresentationrepresentation()Yields aDomainRepresentationof the information contained in this domain's instance.java.lang.StringtoString()booleantracksIdentifiers(Identifier id)Yieldstrueif the domain tracks information on the identifierid,falseotherwise.
-
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getInvolvedIdentifiers
public java.util.Collection<Identifier> getInvolvedIdentifiers()
Description copied from interface:DataflowElementYields all theIdentifiers that are involved in the definition of this element.- Specified by:
getInvolvedIdentifiersin interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Returns:
- the identifiers
-
gen
public java.util.Collection<ReachingDefinitions> gen(Identifier id, ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)
Description copied from interface:DataflowElementThe dataflow gen operation, yielding the dataflow elements that are generated by the assignment of the givenexpressionto the givenid.- Specified by:
genin interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Parameters:
id- theIdentifierbeing assignedexpression- the expressions that is being assigned toidpp- the program point where this operation happensdomain- theDataflowDomainthat is being used to track instances of this element- Returns:
- the collection of dataflow elements that are generated by the assignment
-
gen
public java.util.Collection<ReachingDefinitions> gen(ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)
Description copied from interface:DataflowElementThe dataflow gen operation, yielding the dataflow elements that are generated by evaluating the given non-assigningexpression.- Specified by:
genin interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Parameters:
expression- the expressions that is being evaluatedpp- the program point where this operation happensdomain- theDataflowDomainthat is being used to track instances of this element- Returns:
- the collection of dataflow elements that are generated by the expression
-
kill
public java.util.Collection<ReachingDefinitions> kill(Identifier id, ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)
Description copied from interface:DataflowElementThe dataflow kill operation, yielding the dataflow elements that are killed by the assignment of the givenexpressionto the givenid.- Specified by:
killin interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Parameters:
id- theIdentifierbeing assignedexpression- the expressions that is being assigned toidpp- the program point where this operation happensdomain- theDataflowDomainthat is being used to track instances of this element- Returns:
- the collection of dataflow elements that are killed by the assignment
-
kill
public java.util.Collection<ReachingDefinitions> kill(ValueExpression expression, ProgramPoint pp, PossibleForwardDataflowDomain<ReachingDefinitions> domain)
Description copied from interface:DataflowElementThe dataflow kill operation, yielding the dataflow elements that are killed by evaluating the given non-assigningexpression.- Specified by:
killin interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Parameters:
expression- the expressions that is being evaluatedpp- the program point where this operation happensdomain- theDataflowDomainthat is being used to track instances of this element- Returns:
- the collection of dataflow elements that are killed by the expression
-
tracksIdentifiers
public boolean tracksIdentifiers(Identifier id)
Description copied from interface:SemanticEvaluatorYieldstrueif the domain tracks information on the identifierid,falseotherwise.- Specified by:
tracksIdentifiersin interfaceSemanticEvaluator- Parameters:
id- the identifier- Returns:
trueif the domain tracks information on the identifierid,falseotherwise
-
canProcess
public boolean canProcess(SymbolicExpression expression)
Description copied from interface:SemanticEvaluatorYieldstrueif the domain can processexpression,falseotherwise.- Specified by:
canProcessin interfaceSemanticEvaluator- Parameters:
expression- the expression- Returns:
trueif the domain can processexpression,falseotherwise.
-
representation
public DomainRepresentation representation()
Description copied from interface:DataflowElementYields aDomainRepresentationof the information contained in this domain's instance.- Specified by:
representationin interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Returns:
- the representation
-
pushScope
public ReachingDefinitions pushScope(ScopeToken scope) throws SemanticException
Description copied from interface:DataflowElementPush a scope to the dataflow element.- Specified by:
pushScopein interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Parameters:
scope- the scope to be pushed- Returns:
- the element with the pushed scope
- Throws:
SemanticException- if the scope cannot be pushed- See Also:
SemanticDomain.pushScope(ScopeToken)
-
popScope
public ReachingDefinitions popScope(ScopeToken scope) throws SemanticException
Description copied from interface:DataflowElementPop a scope to the dataflow element.- Specified by:
popScopein interfaceDataflowElement<PossibleForwardDataflowDomain<ReachingDefinitions>,ReachingDefinitions>- Parameters:
scope- the scope to be popped- Returns:
- the element with the popped scope
- Throws:
SemanticException- if the scope cannot be popped- See Also:
SemanticDomain.popScope(ScopeToken)
-
-