Class CallWithResult
- java.lang.Object
-
- it.unive.lisa.program.cfg.statement.Statement
-
- it.unive.lisa.program.cfg.statement.Expression
-
- it.unive.lisa.program.cfg.statement.NaryExpression
-
- it.unive.lisa.program.cfg.statement.call.Call
-
- it.unive.lisa.program.cfg.statement.call.CallWithResult
-
- All Implemented Interfaces:
ProgramPoint
,ResolvedCall
,MetaVariableCreator
,CodeElement
,CodeNode<CFG,Statement,Edge>
,Node<CFG,Statement,Edge>
,java.lang.Comparable<Statement>
public abstract class CallWithResult extends Call implements MetaVariableCreator, ResolvedCall
A call that evaluate its result directly.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unive.lisa.program.cfg.statement.call.Call
Call.CallType
-
-
Constructor Summary
Constructors Constructor Description CallWithResult(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, Type staticType, Expression... parameters)
Builds the call, happening at the given location in the program.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <A extends AbstractState<A>>
AnalysisState<A>backwardSemanticsAux(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, ExpressionSet[] params, StatementStore<A> expressions)
Computes the backward semantics of the expression, after the semantics of all sub-expressions have been computed.abstract <A extends AbstractState<A>>
AnalysisState<A>compute(AnalysisState<A> entryState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, ExpressionSet[] parameters)
Computes an analysis state that abstracts the result of this call whenparameters
are used as actual parameters, and the state when the call is executed isentryState
.<A extends AbstractState<A>>
AnalysisState<A>forwardSemanticsAux(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, ExpressionSet[] params, StatementStore<A> expressions)
Computes the forward semantics of the expression, after the semantics of all sub-expressions have been computed.-
Methods inherited from class it.unive.lisa.program.cfg.statement.call.Call
compareCallAux, compareSameClassAndParams, equals, getCallType, getFullTargetName, getParameters, getQualifier, getSource, getTargetName, hashCode, parameterTypes, setSource, toString
-
Methods inherited from class it.unive.lisa.program.cfg.statement.NaryExpression
accept, backwardSemantics, compareSameClass, forwardSemantics, getConstructName, getOrder, getStatementEvaluatedAfter, getStatementEvaluatedBefore, getSubExpressions
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Expression
getMetaVariables, getParentStatement, getRootStatement, getStaticType, setParentStatement
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Statement
compareTo, getCFG, getEvaluationPredecessor, getEvaluationSuccessor, getLocation, stopsExecution, throwsError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.program.cfg.statement.MetaVariableCreator
getMetaVariable
-
Methods inherited from interface it.unive.lisa.program.cfg.ProgramPoint
getProgram
-
Methods inherited from interface it.unive.lisa.program.cfg.statement.call.ResolvedCall
getTargets
-
-
-
-
Constructor Detail
-
CallWithResult
public CallWithResult(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, Type staticType, Expression... parameters)
Builds the call, happening at the given location in the program.- Parameters:
cfg
- the cfg that this expression belongs tolocation
- the location where this expression is defined within the programcallType
- the call type of this callqualifier
- the optional qualifier of the call (can be null or empty - seeCall.getFullTargetName()
for more info)targetName
- the name of the target of this callorder
- the evaluation order of the sub-expressionsstaticType
- the static type of this callparameters
- the parameters of this call
-
-
Method Detail
-
compute
public abstract <A extends AbstractState<A>> AnalysisState<A> compute(AnalysisState<A> entryState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, ExpressionSet[] parameters) throws SemanticException
Computes an analysis state that abstracts the result of this call whenparameters
are used as actual parameters, and the state when the call is executed isentryState
.- Type Parameters:
A
- the type ofAbstractState
- Parameters:
entryState
- the abstract analysis state when the call is reachedinterprocedural
- the interprocedural analysis of the program to analyzeexpressions
- the cache where analysis states of intermediate expressions must be storedparameters
- the expressions representing the actual parameters of the call- Returns:
- an abstract analysis state representing the abstract result of
the cfg call. The
AnalysisState.getComputedExpressions()
will contain anIdentifier
pointing to the meta variable containing the abstraction of the returned value, if any - Throws:
SemanticException
- if something goes wrong during the computation
-
forwardSemanticsAux
public <A extends AbstractState<A>> AnalysisState<A> forwardSemanticsAux(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, ExpressionSet[] params, StatementStore<A> expressions) throws SemanticException
Description copied from class:NaryExpression
Computes the forward semantics of the expression, after the semantics of all sub-expressions have been computed. Meta variables from the sub-expressions will be forgotten after this call returns.- Specified by:
forwardSemanticsAux
in classNaryExpression
- Type Parameters:
A
- the type ofAbstractState
- Parameters:
interprocedural
- the interprocedural analysis of the program to analyzestate
- the state where the expression is to be evaluatedparams
- the symbolic expressions representing the computed values of the sub-expressions of this expressionexpressions
- the cache where analysis states of intermediate expressions are stored and that can be accessed to query for post-states of parameters expressions- Returns:
- the
AnalysisState
representing the abstract result of the execution of this expression - Throws:
SemanticException
- if something goes wrong during the computation
-
backwardSemanticsAux
public <A extends AbstractState<A>> AnalysisState<A> backwardSemanticsAux(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, ExpressionSet[] params, StatementStore<A> expressions) throws SemanticException
Description copied from class:NaryExpression
Computes the backward semantics of the expression, after the semantics of all sub-expressions have been computed. Meta variables from the sub-expressions will be forgotten after this call returns. By default, this method delegates toNaryExpression.forwardSemanticsAux(InterproceduralAnalysis, AnalysisState, ExpressionSet[], StatementStore)
, as it is fine for most atomic statements. One should redefine this method if a statement's semantics is composed of a series of smaller operations.- Overrides:
backwardSemanticsAux
in classNaryExpression
- Type Parameters:
A
- the type ofAbstractState
- Parameters:
interprocedural
- the interprocedural analysis of the program to analyzestate
- the state where the expression is to be evaluatedparams
- the symbolic expressions representing the computed values of the sub-expressions of this expressionexpressions
- the cache where analysis states of intermediate expressions are stored and that can be accessed to query for post-states of parameters expressions- Returns:
- the
AnalysisState
representing the abstract result of the execution of this expression - Throws:
SemanticException
- if something goes wrong during the computation
-
-