Package it.unive.lisa.analysis.heap
Interface BaseHeapDomain<H extends BaseHeapDomain<H>>
-
- Type Parameters:
H
- the concreteBaseHeapDomain
instance
- All Superinterfaces:
BaseLattice<H>
,HeapDomain<H>
,HeapSemanticOperation
,Lattice<H>
,MemoryOracle
,ScopedObject<H>
,SemanticDomain<H,SymbolicExpression,Identifier>
,StructuredObject
public interface BaseHeapDomain<H extends BaseHeapDomain<H>> extends BaseLattice<H>, HeapDomain<H>
A base implementation of theHeapDomain
interface, handling base cases ofsmallStepSemantics(SymbolicExpression, ProgramPoint, SemanticOracle)
. All implementers ofHeapDomain
should inherit from this class for ensuring a consistent behavior on the base cases, unless explicitly needed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
BaseHeapDomain.Rewriter
-
Nested classes/interfaces inherited from interface it.unive.lisa.analysis.heap.HeapSemanticOperation
HeapSemanticOperation.HeapReplacement
-
-
Field Summary
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_STRING, TOP_STRING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description H
mk(H reference)
Creates a new instance of this domain containing the same abstract information of reference.H
mk(H reference, java.util.List<HeapSemanticOperation.HeapReplacement> replacements)
Creates a new instance of this domain containing the same abstract information of reference.default H
popScope(ScopeToken scope)
Pops the scope identified by the given token from this object.default H
pushScope(ScopeToken scope)
Pushes a new scope, identified by the give token, in this object.H
semanticsOf(HeapExpression expression, ProgramPoint pp, SemanticOracle oracle)
Yields a new instance of this domain, built by evaluating the semantics of the given heap expression.default H
smallStepSemantics(SymbolicExpression expression, ProgramPoint pp, SemanticOracle oracle)
Yields a copy of this domain, that has been modified accordingly to the semantics of the givenexpression
.-
Methods inherited from interface it.unive.lisa.analysis.BaseLattice
equals, glb, glbAux, hashCode, lessOrEqual, lessOrEqualAux, lub, lubAux, narrowing, narrowingAux, toString, widening, wideningAux
-
Methods inherited from interface it.unive.lisa.analysis.heap.HeapSemanticOperation
getSubstitution
-
Methods inherited from interface it.unive.lisa.analysis.heap.MemoryOracle
alias, areMutuallyReachable, isReachableFrom, reachableFrom, rewrite, rewrite
-
Methods inherited from interface it.unive.lisa.analysis.SemanticDomain
assign, assume, forgetIdentifier, forgetIdentifiers, forgetIdentifiersIf, getAllDomainInstances, getDomainInstance, knowsIdentifier, satisfies
-
Methods inherited from interface it.unive.lisa.util.representation.StructuredObject
representation
-
-
-
-
Method Detail
-
smallStepSemantics
default H smallStepSemantics(SymbolicExpression expression, ProgramPoint pp, SemanticOracle oracle) throws SemanticException
Description copied from interface:SemanticDomain
Yields a copy of this domain, that has been modified accordingly to the semantics of the givenexpression
.- Specified by:
smallStepSemantics
in interfaceSemanticDomain<H extends BaseHeapDomain<H>,SymbolicExpression,Identifier>
- Parameters:
expression
- the expression whose semantics need to be computedpp
- the program point that where this operation is being evaluatedoracle
- the oracle for inter-domain communication- Returns:
- a copy of this domain, modified accordingly to the semantics of
expression
- Throws:
SemanticException
- if an error occurs during the computation
-
mk
H mk(H reference)
Creates a new instance of this domain containing the same abstract information of reference. The returned object is effectively a new instance, meaning that all substitutions should be cleared. If this domain does not apply substitutions, it is fine to returnthis
.- Parameters:
reference
- the domain whose abstract information needs to be copied- Returns:
- a new instance of this domain
-
mk
H mk(H reference, java.util.List<HeapSemanticOperation.HeapReplacement> replacements)
Creates a new instance of this domain containing the same abstract information of reference. The returned object is effectively a new instance, but with the given substitution. If this domain does not apply substitutions, it is fine to returnthis
.- Parameters:
reference
- the domain whose abstract information needs to be copiedreplacements
- the heap replacements of this instance- Returns:
- the new instance
-
pushScope
default H pushScope(ScopeToken scope) throws SemanticException
Description copied from interface:ScopedObject
Pushes a new scope, identified by the give token, in this object. This causes all variables not associated with a scope (and thus visible) to be mapped to the given scope and hidden away, until the scope is popped withScopedObject.popScope(ScopeToken)
.- Specified by:
pushScope
in interfaceScopedObject<H extends BaseHeapDomain<H>>
- Parameters:
scope
- the token identifying the scope to push- Returns:
- a copy of this object where the local unscoped variables have been hidden
- Throws:
SemanticException
- if an error occurs during the computation
-
popScope
default H popScope(ScopeToken scope) throws SemanticException
Description copied from interface:ScopedObject
Pops the scope identified by the given token from this object. This causes all the visible variables (i.e. that are not mapped to a scope) to be removed, while the local variables that were associated to the given scope token (and thus hidden) will become visible again.- Specified by:
popScope
in interfaceScopedObject<H extends BaseHeapDomain<H>>
- Parameters:
scope
- the token of the scope to be restored- Returns:
- a copy of this object where the local variables have been removed, while the variables mapped to the given scope are visible again
- Throws:
SemanticException
- if an error occurs during the computation
-
semanticsOf
H semanticsOf(HeapExpression expression, ProgramPoint pp, SemanticOracle oracle) throws SemanticException
Yields a new instance of this domain, built by evaluating the semantics of the given heap expression.- Parameters:
expression
- the expression to evaluatepp
- the program point that where this expression is being evaluatedoracle
- the oracle for inter-domain communication- Returns:
- a new instance of this domain
- Throws:
SemanticException
- if an error occurs during the computation
-
-