Class BaseNonRelationalValueDomain<T extends BaseNonRelationalValueDomain<T>>

    • Constructor Detail

      • BaseNonRelationalValueDomain

        public BaseNonRelationalValueDomain()
    • Method Detail

      • tracksIdentifiers

        public boolean tracksIdentifiers​(Identifier id)
        Description copied from interface: SemanticEvaluator
        Yields true if the domain tracks information on the identifier id, false otherwise.
        Specified by:
        tracksIdentifiers in interface SemanticEvaluator
        Parameters:
        id - the identifier
        Returns:
        true if the domain tracks information on the identifier id, false otherwise
      • canProcess

        public boolean canProcess​(SymbolicExpression expression)
        Description copied from interface: SemanticEvaluator
        Yields true if the domain can process expression, false otherwise.
        Specified by:
        canProcess in interface SemanticEvaluator
        Parameters:
        expression - the expression
        Returns:
        true if the domain can process expression, false otherwise.
      • evalIdentifier

        protected T evalIdentifier​(Identifier id,
                                   ValueEnvironment<T> environment,
                                   ProgramPoint pp)
                            throws SemanticException
        Yields the evaluation of an identifier in a given environment.
        Parameters:
        id - the identifier to be evaluated
        environment - the environment where the identifier must be evaluated
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the identifier
        Throws:
        SemanticException - if an error occurs during the computation
      • evalPushAny

        protected T evalPushAny​(PushAny pushAny,
                                ProgramPoint pp)
        Yields the evaluation of a push-any expression.
        Parameters:
        pushAny - the push-any expression to be evaluated
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the push-any expression
      • evalTypeConv

        protected T evalTypeConv​(BinaryExpression conv,
                                 T left,
                                 T right,
                                 ProgramPoint pp)
        Yields the evaluation of a type conversion expression.
        Parameters:
        conv - the type conversion expression
        left - the left expression, namely the expression to be converted
        right - the right expression, namely the types to which left should be converted
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the type conversion expression
      • evalTypeCast

        protected T evalTypeCast​(BinaryExpression cast,
                                 T left,
                                 T right,
                                 ProgramPoint pp)
        Yields the evaluation of a type cast expression.
        Parameters:
        cast - the type casted expression
        left - the left expression, namely the expression to be casted
        right - the right expression, namely the types to which left should be casted
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the type cast expression
      • evalNullConstant

        protected T evalNullConstant​(ProgramPoint pp)
        Yields the evaluation of the null constant NullConstant.
        Parameters:
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the constant
      • evalNonNullConstant

        protected T evalNonNullConstant​(Constant constant,
                                        ProgramPoint pp)
        Yields the evaluation of the given non-null constant.
        Parameters:
        constant - the constant to evaluate
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the constant
      • evalUnaryExpression

        protected T evalUnaryExpression​(UnaryOperator operator,
                                        T arg,
                                        ProgramPoint pp)
        Yields the evaluation of a UnaryExpression applying operator to an expression whose abstract value is arg. It is guaranteed that arg is not Lattice.bottom().
        Parameters:
        operator - the operator applied by the expression
        arg - the instance of this domain representing the abstract value of the expresion's argument
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the expression
      • evalBinaryExpression

        protected T evalBinaryExpression​(BinaryOperator operator,
                                         T left,
                                         T right,
                                         ProgramPoint pp)
        Yields the evaluation of a BinaryExpression applying operator to two expressions whose abstract value are left and right, respectively. It is guaranteed that both left and right are not Lattice.bottom() and that operator is neither BinaryOperator.TYPE_CAST nor BinaryOperator.TYPE_CONV.
        Parameters:
        operator - the operator applied by the expression
        left - the instance of this domain representing the abstract value of the left-hand side argument
        right - the instance of this domain representing the abstract value of the right-hand side argument
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the expression
      • evalTernaryExpression

        protected T evalTernaryExpression​(TernaryOperator operator,
                                          T left,
                                          T middle,
                                          T right,
                                          ProgramPoint pp)
        Yields the evaluation of a TernaryExpression applying operator to two expressions whose abstract value are left, middle and right, respectively. It is guaranteed that both left and right are not Lattice.bottom().
        Parameters:
        operator - the operator applied by the expression
        left - the instance of this domain representing the abstract value of the left-hand side argument
        middle - the instance of this domain representing the abstract value of the middle argument
        right - the instance of this domain representing the abstract value of the right-hand side argument
        pp - the program point that where this operation is being evaluated
        Returns:
        the evaluation of the expression
      • satisfiesTernaryExpression

        protected SemanticDomain.Satisfiability satisfiesTernaryExpression​(TernaryOperator operator,
                                                                           T left,
                                                                           T middle,
                                                                           T right,
                                                                           ProgramPoint pp)
        Yields the satisfiability of a TernaryExpression applying operator to three expressions whose abstract values are left, middle and right. This method returns an instance of SemanticDomain.Satisfiability. It is guaranteed that left, middle and right are not Lattice.bottom().
        Parameters:
        operator - the ternary operator applied by the expression
        left - an instance of this abstract domain representing the argument of the left-most side of the ternary expression
        middle - an instance of this abstract domain representing the argument in the middle of the ternary expression
        right - an instance of this abstract domain representing the argument of the right-most side of the ternary expression
        pp - the program point that where this operation is being evaluated
        Returns:
        SemanticDomain.Satisfiability.SATISFIED if the expression is satisfied by this domain, SemanticDomain.Satisfiability.NOT_SATISFIED if it is not satisfied, or SemanticDomain.Satisfiability.UNKNOWN if it is either impossible to determine if it satisfied, or if it is satisfied by some values and not by some others (this is equivalent to a TOP boolean value)
      • assumeTernaryExpression

        protected ValueEnvironment<T> assumeTernaryExpression​(ValueEnvironment<T> environment,
                                                              TernaryOperator operator,
                                                              ValueExpression left,
                                                              ValueExpression middle,
                                                              ValueExpression right,
                                                              ProgramPoint pp)
                                                       throws SemanticException
        Yields the environment environment assuming that a ternary expression with operator operator, left argument left, middle argument middle,and right argument right holds.
        Parameters:
        environment - the environment on which the expression must be assumed
        operator - the operator of the ternary expression
        left - the left-hand side argument of the ternary expression
        middle - the middle-hand side argument of the ternary expression
        right - the right-hand side argument of the ternary expression
        pp - the program point where the ternary expression occurs
        Returns:
        the environment environment assuming that a ternary expression with operator operator, left argument left, middle argument middle,and right argument right holds
        Throws:
        SemanticException - if something goes wrong during the assumption
      • assumeUnaryExpression

        protected ValueEnvironment<T> assumeUnaryExpression​(ValueEnvironment<T> environment,
                                                            UnaryOperator operator,
                                                            ValueExpression expression,
                                                            ProgramPoint pp)
                                                     throws SemanticException
        Yields the environment environment assuming that an unary expression with operator operator and argument expression holds.
        Parameters:
        environment - the environment on which the expression must be assumed
        operator - the operator of the unary expression
        expression - the argument of the unary expression
        pp - the program point where the unary expression occurs
        Returns:
        the environment environment assuming that an unary expression with operator operator and argument expression holds.
        Throws:
        SemanticException - if something goes wrong during the assumption
      • glbAux

        protected T glbAux​(T other)
        Performs the greatest lower bound operation between this domain element and other, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        • this and other are not comparable
        Parameters:
        other - the other domain element
        Returns:
        the greatest lower bound between this domain element and other