Interface BaseNonRelationalValueDomain<T extends BaseNonRelationalValueDomain<T>>

    • Method Detail

      • canProcess

        default boolean canProcess​(SymbolicExpression expression,
                                   ProgramPoint pp,
                                   SemanticOracle oracle)
        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
        pp - the program point where this method is queried
        oracle - the oracle for inter-domain communication
        Returns:
        true if the domain can process expression, false otherwise.
      • evalIdentifier

        default T evalIdentifier​(Identifier id,
                                 ValueEnvironment<T> environment,
                                 ProgramPoint pp,
                                 SemanticOracle oracle)
                          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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the identifier
        Throws:
        SemanticException - if an error occurs during the computation
      • evalSkip

        default T evalSkip​(Skip skip,
                           ProgramPoint pp,
                           SemanticOracle oracle)
                    throws SemanticException
        Yields the evaluation of a skip expression.
        Parameters:
        skip - the skip expression to be evaluated
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the skip expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalPushAny

        default T evalPushAny​(PushAny pushAny,
                              ProgramPoint pp,
                              SemanticOracle oracle)
                       throws SemanticException
        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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the push-any expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalPushInv

        default T evalPushInv​(PushInv pushInv,
                              ProgramPoint pp,
                              SemanticOracle oracle)
                       throws SemanticException
        Yields the evaluation of a push-inv expression.
        Parameters:
        pushInv - the push-inv expression to be evaluated
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the push-inv expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalTypeConv

        default T evalTypeConv​(BinaryExpression conv,
                               T left,
                               T right,
                               ProgramPoint pp,
                               SemanticOracle oracle)
                        throws SemanticException
        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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the type conversion expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalTypeCast

        default T evalTypeCast​(BinaryExpression cast,
                               T left,
                               T right,
                               ProgramPoint pp,
                               SemanticOracle oracle)
                        throws SemanticException
        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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the type cast expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalNullConstant

        default T evalNullConstant​(ProgramPoint pp,
                                   SemanticOracle oracle)
                            throws SemanticException
        Yields the evaluation of the null constant NullConstant.
        Parameters:
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the constant
        Throws:
        SemanticException - if an error occurs during the computation
      • evalNonNullConstant

        default T evalNonNullConstant​(Constant constant,
                                      ProgramPoint pp,
                                      SemanticOracle oracle)
                               throws SemanticException
        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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the constant
        Throws:
        SemanticException - if an error occurs during the computation
      • evalUnaryExpression

        default T evalUnaryExpression​(UnaryOperator operator,
                                      T arg,
                                      ProgramPoint pp,
                                      SemanticOracle oracle)
                               throws SemanticException
        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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalBinaryExpression

        default T evalBinaryExpression​(BinaryOperator operator,
                                       T left,
                                       T right,
                                       ProgramPoint pp,
                                       SemanticOracle oracle)
                                throws SemanticException
        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 TypeCast nor TypeConv.
        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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalTernaryExpression

        default T evalTernaryExpression​(TernaryOperator operator,
                                        T left,
                                        T middle,
                                        T right,
                                        ProgramPoint pp,
                                        SemanticOracle oracle)
                                 throws SemanticException
        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
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the expression
        Throws:
        SemanticException - if an error occurs during the computation
      • evalValueExpression

        default T evalValueExpression​(ValueExpression expression,
                                      T[] subExpressions,
                                      ProgramPoint pp,
                                      SemanticOracle oracle)
                               throws SemanticException
        Yields the evaluation of a generic ValueExpression, where the recursive evaluation of its sub-expressions, if any, has already happened and is passed in the subExpressions parameters. It is guaranteed that no element of subExpressions is Lattice.bottom().

        This method allows evaluating frontend-defined expressions. For all standard expressions defined within LiSA, the corresponding evaluation method will be invoked instead.
        Parameters:
        expression - the expression to evaluate
        subExpressions - the instances of this domain representing the abstract values of all its sub-expressions, if any; if there are no sub-expressions, this parameter can be null or empty
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        the evaluation of the expression
        Throws:
        SemanticException - if an error occurs during the computation
      • satisfiesAbstractValue

        default Satisfiability satisfiesAbstractValue​(T value,
                                                      ProgramPoint pp,
                                                      SemanticOracle oracle)
                                               throws SemanticException
        Yields the satisfiability of an abstract value of type <T>.
        Parameters:
        value - the abstract value whose satisfiability is to be evaluated
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        Satisfiability.SATISFIED if the expression is satisfied by this domain, Satisfiability.NOT_SATISFIED if it is not satisfied, or 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)
        Throws:
        SemanticException - if an error occurs during the computation
      • satisfiesNonNullConstant

        default Satisfiability satisfiesNonNullConstant​(Constant constant,
                                                        ProgramPoint pp,
                                                        SemanticOracle oracle)
                                                 throws SemanticException
        Yields the satisfiability of the given non-null constant on this abstract domain.
        Parameters:
        constant - the constant to satisfied
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        Satisfiability.SATISFIED is the constant is satisfied by this domain, Satisfiability.NOT_SATISFIED if it is not satisfied, or 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)
        Throws:
        SemanticException - if an error occurs during the computation
      • satisfiesBinaryExpression

        default Satisfiability satisfiesBinaryExpression​(BinaryOperator operator,
                                                         T left,
                                                         T right,
                                                         ProgramPoint pp,
                                                         SemanticOracle oracle)
                                                  throws SemanticException
        Yields the satisfiability of a BinaryExpression applying operator to two expressions whose abstract values are left, and right. This method returns an instance of Satisfiability. It is guaranteed that operator is neither LogicalAnd nor LogicalOr, and that both left and right are not Lattice.bottom().
        Parameters:
        operator - the binary operator applied by the expression
        left - an instance of this abstract domain representing the argument of the left-hand side of the binary expression
        right - an instance of this abstract domain representing the argument of the right-hand side of the binary expression
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        Satisfiability.SATISFIED if the expression is satisfied by this domain, Satisfiability.NOT_SATISFIED if it is not satisfied, or 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)
        Throws:
        SemanticException - if an error occurs during the computation
      • satisfiesTernaryExpression

        default Satisfiability satisfiesTernaryExpression​(TernaryOperator operator,
                                                          T left,
                                                          T middle,
                                                          T right,
                                                          ProgramPoint pp,
                                                          SemanticOracle oracle)
                                                   throws SemanticException
        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 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
        oracle - the oracle for inter-domain communication
        Returns:
        Satisfiability.SATISFIED if the expression is satisfied by this domain, Satisfiability.NOT_SATISFIED if it is not satisfied, or 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)
        Throws:
        SemanticException - if an error occurs during the computation
      • assumeTernaryExpression

        default ValueEnvironment<T> assumeTernaryExpression​(ValueEnvironment<T> environment,
                                                            TernaryOperator operator,
                                                            ValueExpression left,
                                                            ValueExpression middle,
                                                            ValueExpression right,
                                                            ProgramPoint src,
                                                            ProgramPoint dest,
                                                            SemanticOracle oracle)
                                                     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
        src - the program point that where this operation is being evaluated, corresponding to the one that generated the given expression
        dest - the program point where the execution will move after the expression has been assumed
        oracle - the oracle for inter-domain communication
        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

        default ValueEnvironment<T> assumeUnaryExpression​(ValueEnvironment<T> environment,
                                                          UnaryOperator operator,
                                                          ValueExpression expression,
                                                          ProgramPoint src,
                                                          ProgramPoint dest,
                                                          SemanticOracle oracle)
                                                   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
        src - the program point that where this operation is being evaluated, corresponding to the one that generated the given expression
        dest - the program point where the execution will move after the expression has been assumed
        oracle - the oracle for inter-domain communication
        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