Package it.unive.lisa.analysis.heap
Interface MemoryOracle
-
- All Known Subinterfaces:
AbstractState<A>,BaseHeapDomain<H>,HeapDomain<D>,SemanticOracle
- All Known Implementing Classes:
HeapEnvironment
public interface MemoryOracleAn oracle that can be queried for information about the static and dynamic memory of the program.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Satisfiabilityalias(SymbolicExpression x, SymbolicExpression y, ProgramPoint pp, SemanticOracle oracle)Yields whether or not the two given expressions are aliases, that is, if they point to the same region of memory.default SatisfiabilityareMutuallyReachable(SymbolicExpression x, SymbolicExpression y, ProgramPoint pp, SemanticOracle oracle)Yields whether or not theIdentifierrepresented (directly or after rewriting) by the second expression is reachable starting from theIdentifierrepresented (directly or after rewriting) by the first expression, and vice versa.SatisfiabilityisReachableFrom(SymbolicExpression x, SymbolicExpression y, ProgramPoint pp, SemanticOracle oracle)Yields whether or not theIdentifierrepresented (directly or after rewriting) by the second expression is reachable starting from theIdentifierrepresented (directly or after rewriting) by the first expression.default ExpressionSetreachableFrom(SymbolicExpression e, ProgramPoint pp, SemanticOracle oracle)Yields all theIdentifiers that are reachable starting from theIdentifierrepresented (directly or after rewriting) by the given expression.default ExpressionSetrewrite(ExpressionSet expressions, ProgramPoint pp, SemanticOracle oracle)Rewrites the given expressions to a simpler form containing no sub expressions regarding the heap (that is,HeapExpressions).ExpressionSetrewrite(SymbolicExpression expression, ProgramPoint pp, SemanticOracle oracle)Rewrites the given expression to a simpler form containing no sub expressions regarding the heap (that is,HeapExpressions).
-
-
-
Method Detail
-
rewrite
ExpressionSet rewrite(SymbolicExpression expression, ProgramPoint pp, SemanticOracle oracle) throws SemanticException
Rewrites the given expression to a simpler form containing no sub expressions regarding the heap (that is,HeapExpressions). Every expression contained in the result can be safely cast toValueExpression.- Parameters:
expression- the expression to rewritepp- the program point where the rewrite happensoracle- the oracle for inter-domain communication- Returns:
- the rewritten expressions
- Throws:
SemanticException- if something goes wrong while rewriting
-
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 toValueExpression.- Parameters:
expressions- the expressions to rewritepp- the program point where the rewrite happensoracle- the oracle for inter-domain communication- Returns:
- the rewritten expressions
- Throws:
SemanticException- if something goes wrong while rewriting
-
alias
Satisfiability alias(SymbolicExpression x, SymbolicExpression y, ProgramPoint pp, SemanticOracle oracle) throws SemanticException
Yields whether or not the two given expressions are aliases, that is, if they point to the same region of memory. Note that, for this method to returnSatisfiability.SATISFIED, both expressions should be pointers to other expressions.- Parameters:
x- the first expressiony- the second expressionpp- theProgramPointwhere the computation happensoracle- the oracle for inter-domain communication- Returns:
- whether or not the two expressions are aliases
- Throws:
SemanticException- if something goes wrong during the computation
-
reachableFrom
default ExpressionSet reachableFrom(SymbolicExpression e, ProgramPoint pp, SemanticOracle oracle) throws SemanticException
Yields all theIdentifiers that are reachable starting from theIdentifierrepresented (directly or after rewriting) by the given expression. This corresponds to recursively explore the memory region reachable bye, traversing all possible pointers until no more are available.- Parameters:
e- the expression corresponding to the starting pointpp- theProgramPointwhere the computation happensoracle- 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 theIdentifierrepresented (directly or after rewriting) by the second expression is reachable starting from theIdentifierrepresented (directly or after rewriting) by the first expression. Note that, for this method to returnSatisfiability.SATISFIED, not onlyxneeds to be a pointer to another expression, but the latter should be a pointer as well, and so on untilyis reached.- Parameters:
x- the first expressiony- the second expressionpp- theProgramPointwhere the computation happensoracle- 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 theIdentifierrepresented (directly or after rewriting) by the second expression is reachable starting from theIdentifierrepresented (directly or after rewriting) by the first expression, and vice versa. This is equivalent to invokingisReachableFrom(x, y, pp, oracle).and(isReachableFrom(y, x, pp, oracle)), that corresponds to the default implementation of this method.- Parameters:
x- the first expressiony- the second expressionpp- theProgramPointwhere the computation happensoracle- 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
-
-