Package it.unive.lisa.analysis.dataflow
Interface DataflowElement<D extends DataflowDomain<D,E>,E extends DataflowElement<D,E>>
-
- Type Parameters:
D- the concrete type ofDataflowDomainthat contains instances of this elementE- the concrete type ofDataflowElement
- All Superinterfaces:
SemanticEvaluator
public interface DataflowElement<D extends DataflowDomain<D,E>,E extends DataflowElement<D,E>> extends SemanticEvaluator
An element of the dataflow domain, that contains a collection ofIdentifiers in its definition. A domain element implements standard dataflow gen (gen(Identifier, ValueExpression, ProgramPoint, DataflowDomain),gen(ValueExpression, ProgramPoint, DataflowDomain)) and kill (kill(Identifier, ValueExpression, ProgramPoint, DataflowDomain),kill(ValueExpression, ProgramPoint, DataflowDomain)) operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancanProcess(SymbolicExpression expression)Yieldstrueif the domain can processexpression,falseotherwise.java.util.Collection<E>gen(Identifier id, ValueExpression expression, ProgramPoint pp, D domain)The dataflow gen operation, yielding the dataflow elements that are generated by the assignment of the givenexpressionto the givenid.java.util.Collection<E>gen(ValueExpression expression, ProgramPoint pp, D 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.java.util.Collection<E>kill(Identifier id, ValueExpression expression, ProgramPoint pp, D domain)The dataflow kill operation, yielding the dataflow elements that are killed by the assignment of the givenexpressionto the givenid.java.util.Collection<E>kill(ValueExpression expression, ProgramPoint pp, D domain)The dataflow kill operation, yielding the dataflow elements that are killed by evaluating the given non-assigningexpression.EpopScope(ScopeToken token)Pop a scope to the dataflow element.EpushScope(ScopeToken token)Push a scope to the dataflow element.DomainRepresentationrepresentation()Yields aDomainRepresentationof the information contained in this domain's instance.default booleantracksIdentifiers(Identifier id)Yieldstrueif the domain tracks information on the identifierid,falseotherwise.
-
-
-
Method Detail
-
getInvolvedIdentifiers
java.util.Collection<Identifier> getInvolvedIdentifiers()
Yields all theIdentifiers that are involved in the definition of this element.- Returns:
- the identifiers
-
gen
java.util.Collection<E> gen(Identifier id, ValueExpression expression, ProgramPoint pp, D domain) throws SemanticException
The dataflow gen operation, yielding the dataflow elements that are generated by the assignment of the givenexpressionto the givenid.- 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
- Throws:
SemanticException- if an error occurs during the computation
-
gen
java.util.Collection<E> gen(ValueExpression expression, ProgramPoint pp, D domain) throws SemanticException
The dataflow gen operation, yielding the dataflow elements that are generated by evaluating the given non-assigningexpression.- 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
- Throws:
SemanticException- if an error occurs during the computation
-
kill
java.util.Collection<E> kill(Identifier id, ValueExpression expression, ProgramPoint pp, D domain) throws SemanticException
The dataflow kill operation, yielding the dataflow elements that are killed by the assignment of the givenexpressionto the givenid.- 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
- Throws:
SemanticException- if an error occurs during the computation
-
kill
java.util.Collection<E> kill(ValueExpression expression, ProgramPoint pp, D domain) throws SemanticException
The dataflow kill operation, yielding the dataflow elements that are killed by evaluating the given non-assigningexpression.- 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
- Throws:
SemanticException- if an error occurs during the computation
-
representation
DomainRepresentation representation()
Yields aDomainRepresentationof the information contained in this domain's instance.- Returns:
- the representation
-
pushScope
E pushScope(ScopeToken token) throws SemanticException
Push a scope to the dataflow element.- Parameters:
token- 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
E popScope(ScopeToken token) throws SemanticException
Pop a scope to the dataflow element.- Parameters:
token- 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)
-
tracksIdentifiers
default 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
default 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.
-
-