Class BinaryStatement

    • Constructor Detail

      • BinaryStatement

        protected BinaryStatement​(CFG cfg,
                                  CodeLocation location,
                                  java.lang.String constructName,
                                  Expression left,
                                  Expression right)
        Builds the statement, happening at the given location in the program. The EvaluationOrder is LeftToRightEvaluation.
        Parameters:
        cfg - the cfg that this statement belongs to
        location - the location where the statement is defined within the program
        constructName - the name of the construct represented by this statement
        left - the first sub-expression of this statement
        right - the second sub-expression of this statement
      • BinaryStatement

        protected BinaryStatement​(CFG cfg,
                                  CodeLocation location,
                                  java.lang.String constructName,
                                  EvaluationOrder order,
                                  Expression left,
                                  Expression right)
        Builds the statement, happening at the given location in the program.
        Parameters:
        cfg - the cfg that this statement belongs to
        location - the location where the statement is defined within the program
        constructName - the name of the construct represented by this statement
        order - the evaluation order of the sub-expressions
        left - the first sub-expression of this statement
        right - the second sub-expression of this statement
    • Method Detail

      • getLeft

        public Expression getLeft()
        Yields the left-most (first) sub-expression of this expression.
        Returns:
        the left-most sub-expression
      • getRight

        public Expression getRight()
        Yields the right-most (second) sub-expression of this expression.
        Returns:
        the right-most sub-expression
      • 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: NaryStatement
        Computes the forward semantics of the statement, 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 NaryStatement
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        interprocedural - the interprocedural analysis of the program to analyze
        state - the state where the statement is to be evaluated
        params - the symbolic expressions representing the computed values of the sub-expressions of this statement
        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 statement
        Throws:
        SemanticException - if something goes wrong during the computation
      • fwdBinarySemantics

        public abstract <A extends AbstractState<A>> AnalysisState<A> fwdBinarySemantics​(InterproceduralAnalysis<A> interprocedural,
                                                                                         AnalysisState<A> state,
                                                                                         SymbolicExpression left,
                                                                                         SymbolicExpression right,
                                                                                         StatementStore<A> expressions)
                                                                                  throws SemanticException
        Computes the forward semantics of the statement, after the semantics of the sub-expressions have been computed. Meta variables from the sub-expressions will be forgotten after this statement returns.
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        interprocedural - the interprocedural analysis of the program to analyze
        state - the state where the statement is to be evaluated
        left - the symbolic expression representing the computed value of the first sub-expression of this statement
        right - the symbolic expression representing the computed value of the second sub-expression of this statement
        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 statement
        Throws:
        SemanticException - if something goes wrong during the computation
      • bwdBinarySemantics

        public <A extends AbstractState<A>> AnalysisState<A> bwdBinarySemantics​(InterproceduralAnalysis<A> interprocedural,
                                                                                AnalysisState<A> state,
                                                                                SymbolicExpression left,
                                                                                SymbolicExpression right,
                                                                                StatementStore<A> expressions)
                                                                         throws SemanticException
        Computes the backward semantics of the statement, after the semantics of the sub-expressions have been computed. Meta variables from the sub-expressions will be forgotten after this statement returns. By default, this method delegates to fwdBinarySemantics(InterproceduralAnalysis, AnalysisState, SymbolicExpression, SymbolicExpression, 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.
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        interprocedural - the interprocedural analysis of the program to analyze
        state - the state where the statement is to be evaluated
        left - the symbolic expression representing the computed value of the first sub-expression of this statement
        right - the symbolic expression representing the computed value of the second sub-expression of this statement
        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 statement
        Throws:
        SemanticException - if something goes wrong during the computation