Class UnaryExpression

    • Constructor Detail

      • UnaryExpression

        protected UnaryExpression​(CFG cfg,
                                  CodeLocation location,
                                  java.lang.String constructName,
                                  Expression subExpression)
        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
        subExpression - the sub-expression of this expression
      • UnaryExpression

        protected UnaryExpression​(CFG cfg,
                                  CodeLocation location,
                                  java.lang.String constructName,
                                  Type staticType,
                                  Expression subExpression)
        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 the expression is defined within the program
        constructName - the name of the construct represented by this expression
        staticType - the static type of this expression
        subExpression - the sub-expression of this expression
      • UnaryExpression

        protected UnaryExpression​(CFG cfg,
                                  CodeLocation location,
                                  java.lang.String constructName,
                                  EvaluationOrder order,
                                  Expression subExpression)
        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
        subExpression - the sub-expression of this expression
      • UnaryExpression

        protected UnaryExpression​(CFG cfg,
                                  CodeLocation location,
                                  java.lang.String constructName,
                                  EvaluationOrder order,
                                  Type staticType,
                                  Expression subExpression)
        Builds the expression, happening at the given location in the program.
        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
        staticType - the static type of this expression
        subExpression - the sub-expression of this expression
    • Method Detail

      • getSubExpression

        public Expression getSubExpression()
        Yields the only sub-expression of this unary expression.
        Returns:
        the only 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: NaryExpression
        Computes the forward 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:
        forwardSemanticsAux in class NaryExpression
        Type Parameters:
        A - the type of AbstractState
        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
      • fwdUnarySemantics

        public abstract <A extends AbstractState<A>> AnalysisState<A> fwdUnarySemantics​(InterproceduralAnalysis<A> interprocedural,
                                                                                        AnalysisState<A> state,
                                                                                        SymbolicExpression expr,
                                                                                        StatementStore<A> expressions)
                                                                                 throws SemanticException
        Computes the forward semantics of the expression, after the semantics of the sub-expression has been computed. Meta variables from the sub-expression will be forgotten after this expression returns.
        Type Parameters:
        A - the type of AbstractState
        Parameters:
        interprocedural - the interprocedural analysis of the program to analyze
        state - the state where the expression is to be evaluated
        expr - the symbolic expressions representing the computed value of the 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
      • bwdUnarySemantics

        public <A extends AbstractState<A>> AnalysisState<A> bwdUnarySemantics​(InterproceduralAnalysis<A> interprocedural,
                                                                               AnalysisState<A> state,
                                                                               SymbolicExpression expr,
                                                                               StatementStore<A> expressions)
                                                                        throws SemanticException
        Computes the backward semantics of the expression, after the semantics of the sub-expression has been computed. Meta variables from the sub-expression will be forgotten after this expression returns. By default, this method delegates to fwdUnarySemantics(InterproceduralAnalysis, AnalysisState, 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 expression is to be evaluated
        expr - the symbolic expressions representing the computed value of the 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