Package it.unive.lisa.analysis.dataflow
Interface DataflowElement<D extends DataflowDomain<D,E>,E extends DataflowElement<D,E>>
-
- Type Parameters:
D
- the concrete type ofDataflowDomain
that 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 ofIdentifier
s 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 boolean
canProcess(SymbolicExpression expression)
Yieldstrue
if the domain can processexpression
,false
otherwise.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 givenexpression
to 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 theIdentifier
s 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 givenexpression
to 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
.E
popScope(ScopeToken token)
Pop a scope to the dataflow element.E
pushScope(ScopeToken token)
Push a scope to the dataflow element.DomainRepresentation
representation()
Yields aDomainRepresentation
of the information contained in this domain's instance.default boolean
tracksIdentifiers(Identifier id)
Yieldstrue
if the domain tracks information on the identifierid
,false
otherwise.
-
-
-
Method Detail
-
getInvolvedIdentifiers
java.util.Collection<Identifier> getInvolvedIdentifiers()
Yields all theIdentifier
s 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 givenexpression
to the givenid
.- Parameters:
id
- theIdentifier
being assignedexpression
- the expressions that is being assigned toid
pp
- the program point where this operation happensdomain
- theDataflowDomain
that 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
- theDataflowDomain
that 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 givenexpression
to the givenid
.- Parameters:
id
- theIdentifier
being assignedexpression
- the expressions that is being assigned toid
pp
- the program point where this operation happensdomain
- theDataflowDomain
that 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
- theDataflowDomain
that 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 aDomainRepresentation
of 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:SemanticEvaluator
Yieldstrue
if the domain tracks information on the identifierid
,false
otherwise.- Specified by:
tracksIdentifiers
in interfaceSemanticEvaluator
- Parameters:
id
- the identifier- Returns:
true
if the domain tracks information on the identifierid
,false
otherwise
-
canProcess
default boolean canProcess(SymbolicExpression expression)
Description copied from interface:SemanticEvaluator
Yieldstrue
if the domain can processexpression
,false
otherwise.- Specified by:
canProcess
in interfaceSemanticEvaluator
- Parameters:
expression
- the expression- Returns:
true
if the domain can processexpression
,false
otherwise.
-
-