Interface BaseInferredValue<T extends BaseInferredValue<T>>

    • Method Detail

      • eval

        default InferredValue.InferredPair<T> eval​(ValueExpression expression,
                                                   InferenceSystem<T> environment,
                                                   ProgramPoint pp,
                                                   SemanticOracle oracle)
                                            throws SemanticException
        Description copied from interface: InferredValue
        Evaluates a ValueExpression, assuming that the values of program variables are the ones stored in environment.
        Specified by:
        eval in interface InferredValue<T extends BaseInferredValue<T>>
        Parameters:
        expression - the expression to evaluate
        environment - the environment containing the values of program variables for the evaluation
        pp - the program point that where this operation is being evaluated
        oracle - the oracle for inter-domain communication
        Returns:
        an new instance of this domain, representing the abstract result of expression when evaluated on environment. The returned value is a pair that express both the result of the evaluation and the updated execution state
        Throws:
        SemanticException - if something goes wrong during the computation
      • evalIdentifier

        default InferredValue.InferredPair<T> evalIdentifier​(Identifier id,
                                                             InferenceSystem<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 InferredValue.InferredPair<T> evalSkip​(Skip skip,
                                                       T state,
                                                       ProgramPoint pp,
                                                       SemanticOracle oracle)
                                                throws SemanticException
        Yields the evaluation of a skip expression.
        Parameters:
        skip - the skip expression to be evaluated
        state - the current execution state
        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 InferredValue.InferredPair<T> evalPushAny​(PushAny pushAny,
                                                          T state,
                                                          ProgramPoint pp,
                                                          SemanticOracle oracle)
                                                   throws SemanticException
        Yields the evaluation of a push-any expression.
        Parameters:
        pushAny - the push-any expression to be evaluated
        state - the current execution state
        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 InferredValue.InferredPair<T> evalPushInv​(PushInv pushInv,
                                                          T state,
                                                          ProgramPoint pp,
                                                          SemanticOracle oracle)
                                                   throws SemanticException
        Yields the evaluation of a push-inv expression.
        Parameters:
        pushInv - the push-inv expression to be evaluated
        state - the current execution state
        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
      • evalNonNullConstant

        default InferredValue.InferredPair<T> evalNonNullConstant​(Constant constant,
                                                                  T state,
                                                                  ProgramPoint pp,
                                                                  SemanticOracle oracle)
                                                           throws SemanticException
        Yields the evaluation of the given non-null constant.
        Parameters:
        constant - the constant to evaluate
        state - the current execution state
        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 InferredValue.InferredPair<T> evalUnaryExpression​(UnaryOperator operator,
                                                                  T arg,
                                                                  T state,
                                                                  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
        state - the current execution state
        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 InferredValue.InferredPair<T> evalBinaryExpression​(BinaryOperator operator,
                                                                   T left,
                                                                   T right,
                                                                   T state,
                                                                   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
        state - the current execution state
        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
      • evalTypeConv

        default InferredValue.InferredPair<T> evalTypeConv​(BinaryExpression conv,
                                                           T left,
                                                           T right,
                                                           T state,
                                                           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
        state - the current execution state
        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 InferredValue.InferredPair<T> evalTypeCast​(BinaryExpression cast,
                                                           T left,
                                                           T right,
                                                           T state,
                                                           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
        state - the current execution state
        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
      • evalTernaryExpression

        default InferredValue.InferredPair<T> evalTernaryExpression​(TernaryOperator operator,
                                                                    T left,
                                                                    T middle,
                                                                    T right,
                                                                    T state,
                                                                    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
        state - the current execution state
        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,
                                                      T state,
                                                      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
        state - the current execution state
        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
      • satisfiesPushAny

        default Satisfiability satisfiesPushAny​(PushAny pushAny,
                                                T state,
                                                SemanticOracle oracle)
                                         throws SemanticException
        Yields the satisfiability of the push any expression.
        Parameters:
        pushAny - the push any expression to satisfy
        state - the current execution state
        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,
                                                        T state,
                                                        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
        state - the current execution state
        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
      • satisfiesUnaryExpression

        default Satisfiability satisfiesUnaryExpression​(UnaryOperator operator,
                                                        T arg,
                                                        T state,
                                                        ProgramPoint pp,
                                                        SemanticOracle oracle)
                                                 throws SemanticException
        Yields the satisfiability of a UnaryExpression applying operator to an expression whose abstract value is arg, returning an instance of Satisfiability. It is guaranteed that operator is not LogicalNegation and arg is not Lattice.bottom().
        Parameters:
        operator - the unary operator applied by the expression
        arg - an instance of this abstract domain representing the argument of the unary expression
        state - the current execution state
        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
      • satisfiesBinaryExpression

        default Satisfiability satisfiesBinaryExpression​(BinaryOperator operator,
                                                         T left,
                                                         T right,
                                                         T state,
                                                         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
        state - the current execution state
        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,
                                                          T state,
                                                          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
        state - the current execution state
        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
      • 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.
      • assume

        default InferenceSystem<T> assume​(InferenceSystem<T> environment,
                                          ValueExpression expression,
                                          ProgramPoint src,
                                          ProgramPoint dest,
                                          SemanticOracle oracle)
                                   throws SemanticException
        Description copied from interface: NonRelationalElement
        Yields the environment environment on which the expression expression is assumed to hold by this domain. The returned environment must be an updated version of the given one, where the relevant abstractions have been (optionally) updated. Returning the given environment as-is is always a sound implementation.
        Specified by:
        assume in interface NonRelationalElement<T extends BaseInferredValue<T>,​ValueExpression,​InferenceSystem<T extends BaseInferredValue<T>>>
        Parameters:
        environment - the environment
        expression - the expression to be assumed
        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 where expression is assumed to hold
        Throws:
        SemanticException - if an error occurs during the computation