Class RightToLeftEvaluation

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <A extends AbstractState<A>>
      AnalysisState<A>
      bwdEvaluate​(Expression[] subExpressions, AnalysisState<A> entryState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, ExpressionSet[] computed)
      Evaluates the given sub-expressions according to this order, but in reverse order and using the backward semantics.
      <A extends AbstractState<A>>
      AnalysisState<A>
      evaluate​(Expression[] subExpressions, AnalysisState<A> entryState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, ExpressionSet[] 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • evaluate

        public <A extends AbstractState<A>> AnalysisState<A> evaluate​(Expression[] subExpressions,
                                                                      AnalysisState<A> entryState,
                                                                      InterproceduralAnalysis<A> interprocedural,
                                                                      StatementStore<A> expressions,
                                                                      ExpressionSet[] computed)
                                                               throws SemanticException
        Description copied from interface: EvaluationOrder
        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.
        Specified by:
        evaluate in interface EvaluationOrder
        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

        public <A extends AbstractState<A>> AnalysisState<A> bwdEvaluate​(Expression[] subExpressions,
                                                                         AnalysisState<A> entryState,
                                                                         InterproceduralAnalysis<A> interprocedural,
                                                                         StatementStore<A> expressions,
                                                                         ExpressionSet[] computed)
                                                                  throws SemanticException
        Description copied from interface: EvaluationOrder
        Evaluates the given sub-expressions according to this order, but in reverse order and using the backward semantics.
        Specified by:
        bwdEvaluate in interface EvaluationOrder
        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
      • previous

        public int previous​(int pos,
                            int len)
        Description copied from interface: EvaluationOrder
        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.
        Specified by:
        previous in interface EvaluationOrder
        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

        public int next​(int pos,
                        int len)
        Description copied from interface: EvaluationOrder
        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.
        Specified by:
        next in interface EvaluationOrder
        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

        public int first​(int len)
        Description copied from interface: EvaluationOrder
        Yields the index of the first sub-expression that has to be evaluated.
        Specified by:
        first in interface EvaluationOrder
        Parameters:
        len - the total number of sub-expressions
        Returns:
        the index of the first expression to evaluate
      • last

        public int last​(int len)
        Description copied from interface: EvaluationOrder
        Yields the index of the last sub-expression that has to be evaluated.
        Specified by:
        last in interface EvaluationOrder
        Parameters:
        len - the total number of sub-expressions
        Returns:
        the index of the last expression to evaluate