Interface NonRelationalHeapDomain<T extends NonRelationalHeapDomain<T>>

    • Method Detail

      • rewrite

        ExpressionSet rewrite​(SymbolicExpression expression,
                              HeapEnvironment<T> environment,
                              ProgramPoint pp,
                              SemanticOracle oracle)
                       throws SemanticException
        Rewrites a SymbolicExpression, getting rid of the parts that access heap structures, substituting them with synthetic HeapLocations representing the accessed locations. The expression(s) returned by this method should not contain HeapExpressions.

        Note that a single expression might be rewritten to more than one expression, depending on the individual reasoning of the domain.

        If no rewriting is necessary, the input expression can be returned instead.
        Parameters:
        expression - the expression to rewrite
        environment - the environment containing information about the program variables
        pp - the program point that where this expression is being rewritten
        oracle - the oracle for inter-domain communication
        Returns:
        the rewritten expressions, or the original one
        Throws:
        SemanticException - if something goes wrong during the rewriting
      • rewrite

        default ExpressionSet rewrite​(ExpressionSet expressions,
                                      HeapEnvironment<T> environment,
                                      ProgramPoint pp,
                                      SemanticOracle oracle)
                               throws SemanticException
        Rewrites all SymbolicExpressions, getting rid of the parts that access heap structures, substituting them with synthetic HeapLocations representing the accessed locations. The expressions returned by this method should not contain HeapExpressions.

        If no rewriting is necessary, the returned ExpressionSet will contain the input expressions.

        The default implementation of this method simply iterates over the input expressions, invoking rewrite(SymbolicExpression, HeapEnvironment, ProgramPoint, SemanticOracle) on all of them.

        The collection returned by this method usually contains one expression, but instances created through lattice operations (e.g., lub) might contain more.
        Parameters:
        expressions - the expressions to rewrite
        environment - the environment containing information about the program variables
        pp - the program point that where this expressions are being rewritten
        oracle - the oracle for inter-domain communication
        Returns:
        the rewritten expressions, or the original ones
        Throws:
        SemanticException - if something goes wrong during the rewriting
      • isReachableFrom

        Satisfiability isReachableFrom​(SymbolicExpression x,
                                       SymbolicExpression y,
                                       HeapEnvironment<T> environment,
                                       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
        environment - the environment containing information about the program variables
        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