Interface EvaluationOrder

    • Method Detail

      • previous

        int previous​(int pos,
                     int len)
        Assuming that pos is the index of a sub-expression, yields the index of the sub-expression that has to be evaluated before the given one.
        Parameters:
        pos - the index of a sub-expression
        len - the total number of sub-expressions
        Returns:
        the previous index (a negative value means that there is no previous sub-expression, that is, pos is the first that needs to be evaluated)
      • next

        int next​(int pos,
                 int len)
        Assuming that pos is the index of a sub-expression, yields the index of the sub-expression that has to be evaluated after the given one.
        Parameters:
        pos - the index of a sub-expression
        len - the total number of sub-expressions
        Returns:
        the next index (a negative value means that there is no next sub-expression, that is, pos is the last that needs to be evaluated)
      • first

        int first​(int len)
        Yields the index of the first sub-expression that has to be evaluated.
        Parameters:
        len - the total number of sub-expressions
        Returns:
        the index of the first expression to evaluate
      • last

        int last​(int len)
        Yields the index of the last sub-expression that has to be evaluated.
        Parameters:
        len - the total number of sub-expressions
        Returns:
        the index of the last expression to evaluate
      • evaluate

        <A extends AbstractState<A>> AnalysisState<A> evaluate​(Expression[] subExpressions,
                                                               AnalysisState<A> entryState,
                                                               InterproceduralAnalysis<A> interprocedural,
                                                               StatementStore<A> expressions,
                                                               ExpressionSet[] computed)
                                                        throws SemanticException
        Evaluates the given sub-expressions according to this order. This method will fill computed and subStates such that subStates[i] = subExpressions[i].semantics(); computed[i] = subStates[i].computedExpressions, while also setting the runtime types for the expressions left on the stack.
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        subExpressions - the sub-expressions to evaluate
        entryState - the state to use as starting point for the evaluation
        interprocedural - the interprocedural analysis of the program to analyze
        expressions - the cache where analysis states of intermediate expressions must be stored (this method is responsible for storing the results of the sub-expressions)
        computed - an array containing, for each sub-expression, the symbolic expressions produced by its evaluation
        Returns:
        the last computed state, where the source expression can be evaluated
        Throws:
        SemanticException - if something goes wrong during the evaluation
      • bwdEvaluate

        <A extends AbstractState<A>> AnalysisState<A> bwdEvaluate​(Expression[] subExpressions,
                                                                  AnalysisState<A> entryState,
                                                                  InterproceduralAnalysis<A> interprocedural,
                                                                  StatementStore<A> expressions,
                                                                  ExpressionSet[] computed)
                                                           throws SemanticException
        Evaluates the given sub-expressions according to this order, but in reverse order and using the backward semantics.
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        subExpressions - the sub-expressions to evaluate
        entryState - the state to use as starting point for the evaluation
        interprocedural - the interprocedural analysis of the program to analyze
        expressions - the cache where analysis states of intermediate expressions must be stored (this method is responsible for storing the results of the sub-expressions)
        computed - an array containing, for each sub-expression, the symbolic expressions produced by its evaluation
        Returns:
        the last computed state, where the source expression can be evaluated
        Throws:
        SemanticException - if something goes wrong during the evaluation