Interface MemoryOracle

    • Method Detail

      • rewrite

        default ExpressionSet rewrite​(ExpressionSet expressions,
                                      ProgramPoint pp,
                                      SemanticOracle oracle)
                               throws SemanticException
        Rewrites the given expressions to a simpler form containing no sub expressions regarding the heap (that is, HeapExpressions). Every expression contained in the result can be safely cast to ValueExpression.
        Parameters:
        expressions - the expressions to rewrite
        pp - the program point where the rewrite happens
        oracle - the oracle for inter-domain communication
        Returns:
        the rewritten expressions
        Throws:
        SemanticException - if something goes wrong while rewriting
      • reachableFrom

        default ExpressionSet reachableFrom​(SymbolicExpression e,
                                            ProgramPoint pp,
                                            SemanticOracle oracle)
                                     throws SemanticException
        Yields all the Identifiers that are reachable starting from the Identifier represented (directly or after rewriting) by the given expression. This corresponds to recursively explore the memory region reachable by e, traversing all possible pointers until no more are available.
        Parameters:
        e - the expression corresponding to the starting point
        pp - the ProgramPoint where the computation happens
        oracle - the oracle for inter-domain communication
        Returns:
        the expressions representing memory regions reachable from e
        Throws:
        SemanticException - if something goes wrong during the computation
      • isReachableFrom

        Satisfiability isReachableFrom​(SymbolicExpression x,
                                       SymbolicExpression y,
                                       ProgramPoint pp,
                                       SemanticOracle oracle)
                                throws SemanticException
        Yields whether or not the Identifier represented (directly or after rewriting) by the second expression is reachable starting from the Identifier represented (directly or after rewriting) by the first expression. Note that, for this method to return Satisfiability.SATISFIED, not only x needs to be a pointer to another expression, but the latter should be a pointer as well, and so on until y is reached.
        Parameters:
        x - the first expression
        y - the second expression
        pp - the ProgramPoint where the computation happens
        oracle - the oracle for inter-domain communication
        Returns:
        whether or not the second expression can be reached from the first one
        Throws:
        SemanticException - if something goes wrong during the computation
      • areMutuallyReachable

        default Satisfiability areMutuallyReachable​(SymbolicExpression x,
                                                    SymbolicExpression y,
                                                    ProgramPoint pp,
                                                    SemanticOracle oracle)
                                             throws SemanticException
        Yields whether or not the Identifier represented (directly or after rewriting) by the second expression is reachable starting from the Identifier represented (directly or after rewriting) by the first expression, and vice versa. This is equivalent to invoking isReachableFrom(x, y, pp, oracle).and(isReachableFrom(y, x, pp, oracle)), that corresponds to the default implementation of this method.
        Parameters:
        x - the first expression
        y - the second expression
        pp - the ProgramPoint where the computation happens
        oracle - the oracle for inter-domain communication
        Returns:
        whether or not the two expressions are mutually reachable
        Throws:
        SemanticException - if something goes wrong during the computation