Class CallWithResult

    • 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 to
        location - the location where this expression is defined within the program
        callType - the call type of this call
        qualifier - the optional qualifier of the call (can be null or empty - see Call.getFullTargetName() for more info)
        targetName - the name of the target of this call
        order - the evaluation order of the sub-expressions
        staticType - the static type of this call
        parameters - 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 when parameters are used as actual parameters, and the state when the call is executed is entryState.
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        entryState - the abstract analysis state when the call is reached
        interprocedural - the interprocedural analysis of the program to analyze
        expressions - the cache where analysis states of intermediate expressions must be stored
        parameters - 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 an Identifier 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 class NaryExpression
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        interprocedural - the interprocedural analysis of the program to analyze
        state - the state where the expression is to be evaluated
        params - the symbolic expressions representing the computed values of the sub-expressions of this expression
        expressions - 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