Interface EvaluationOrder

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <A extends AbstractState<A,​H,​V,​T>,​H extends HeapDomain<H>,​V extends ValueDomain<V>,​T extends TypeDomain<T>>
      AnalysisState<A,​H,​V,​T>
      evaluate​(Expression[] subExpressions, AnalysisState<A,​H,​V,​T> entryState, InterproceduralAnalysis<A,​H,​V,​T> interprocedural, StatementStore<A,​H,​V,​T> expressions, ExpressionSet<SymbolicExpression>[] computed)
      Evaluates the given sub-expressions according to this order.
      int first​(int len)
      Yields the index of the first sub-expression that has to be evaluated.
      int last​(int len)
      Yields the index of the last sub-expression that has to be evaluated.
      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.
      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.
    • 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,​H,​V,​T>,​H extends HeapDomain<H>,​V extends ValueDomain<V>,​T extends TypeDomain<T>> AnalysisState<A,​H,​V,​T> evaluate​(Expression[] subExpressions,
                                                                                                                                                                                                          AnalysisState<A,​H,​V,​T> entryState,
                                                                                                                                                                                                          InterproceduralAnalysis<A,​H,​V,​T> interprocedural,
                                                                                                                                                                                                          StatementStore<A,​H,​V,​T> expressions,
                                                                                                                                                                                                          ExpressionSet<SymbolicExpression>[] 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
        H - the type of the HeapDomain
        V - the type of the ValueDomain
        T - the type of TypeDomain
        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