Class BinaryExpression

    • Constructor Detail

      • BinaryExpression

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

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

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

        protected BinaryExpression​(CFG cfg,
                                   CodeLocation location,
                                   java.lang.String constructName,
                                   EvaluationOrder order,
                                   Type staticType,
                                   Expression left,
                                   Expression right)
        Builds the expression, 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
        constructName - the name of the construct invoked by this expression
        order - the evaluation order of the sub-expressions
        staticType - the static type of this expression
        left - the first sub-expression of this expression
        right - the second sub-expression of this expression
    • 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
      • expressionSemantics

        public <A extends AbstractState<A,​H,​V,​T>,​H extends HeapDomain<H>,​V extends ValueDomain<V>,​T extends TypeDomain<T>> AnalysisState<A,​H,​V,​T> expressionSemantics​(InterproceduralAnalysis<A,​H,​V,​T> interprocedural,
                                                                                                                                                                                                                            AnalysisState<A,​H,​V,​T> state,
                                                                                                                                                                                                                            ExpressionSet<SymbolicExpression>[] params,
                                                                                                                                                                                                                            StatementStore<A,​H,​V,​T> expressions)
                                                                                                                                                                                                                     throws SemanticException
        Description copied from class: NaryExpression
        Computes the 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:
        expressionSemantics in class NaryExpression
        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:
        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
      • binarySemantics

        public abstract <A extends AbstractState<A,​H,​V,​T>,​H extends HeapDomain<H>,​V extends ValueDomain<V>,​T extends TypeDomain<T>> AnalysisState<A,​H,​V,​T> binarySemantics​(InterproceduralAnalysis<A,​H,​V,​T> interprocedural,
                                                                                                                                                                                                                                 AnalysisState<A,​H,​V,​T> state,
                                                                                                                                                                                                                                 SymbolicExpression left,
                                                                                                                                                                                                                                 SymbolicExpression right,
                                                                                                                                                                                                                                 StatementStore<A,​H,​V,​T> expressions)
                                                                                                                                                                                                                          throws SemanticException
        Computes the semantics of the expression, after the semantics of the sub-expressions have been computed. Meta variables from the sub-expressions will be forgotten after this expression returns.
        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:
        interprocedural - the interprocedural analysis of the program to analyze
        state - the state where the expression is to be evaluated
        left - the symbolic expression representing the computed value of the first sub-expression of this expression
        right - the symbolic expression representing the computed value of the second sub-expression 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