Package it.unive.lisa.analysis.heap
Class BaseHeapDomain<H extends BaseHeapDomain<H>>
- java.lang.Object
-
- it.unive.lisa.analysis.BaseLattice<H>
-
- it.unive.lisa.analysis.heap.BaseHeapDomain<H>
-
- Type Parameters:
H- the concreteBaseHeapDomaininstance
- All Implemented Interfaces:
HeapDomain<H>,HeapSemanticOperation,Lattice<H>,SemanticDomain<H,SymbolicExpression,Identifier>
- Direct Known Subclasses:
MonolithicHeap,PointBasedHeap,TypeBasedHeap
public abstract class BaseHeapDomain<H extends BaseHeapDomain<H>> extends BaseLattice<H> implements HeapDomain<H>
A base implementation of theHeapDomaininterface, handling base cases ofsmallStepSemantics(SymbolicExpression, ProgramPoint). All implementers ofHeapDomainshould inherit from this class for ensuring a consistent behavior on the base cases, unless explicitly needed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBaseHeapDomain.Rewriter-
Nested classes/interfaces inherited from interface it.unive.lisa.analysis.heap.HeapSemanticOperation
HeapSemanticOperation.HeapReplacement
-
Nested classes/interfaces inherited from interface it.unive.lisa.analysis.SemanticDomain
SemanticDomain.Satisfiability
-
-
Field Summary
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_REPR, BOTTOM_STRING, TOP_REPR, TOP_STRING
-
-
Constructor Summary
Constructors Constructor Description BaseHeapDomain()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Hmk(H reference)Creates a new instance of this domain containing the same abstract information of reference.HpopScope(ScopeToken scope)Pops the scope identified by the given token from the domain.HpushScope(ScopeToken scope)Pushes a new scope, identified by the give token, in the domain.protected abstract HsemanticsOf(HeapExpression expression, ProgramPoint pp)Yields a new instance of this domain, built by evaluating the semantics of the given heap expression.HsmallStepSemantics(SymbolicExpression expression, ProgramPoint pp)Yields a copy of this domain, that has been modified accordingly to the semantics of the givenexpression.java.lang.StringtoString()-
Methods inherited from class it.unive.lisa.analysis.BaseLattice
equals, hashCode, lessOrEqual, lessOrEqualAux, lub, lubAux, widening, wideningAux
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.analysis.heap.HeapDomain
rewrite, rewriteAll
-
Methods inherited from interface it.unive.lisa.analysis.heap.HeapSemanticOperation
getSubstitution
-
Methods inherited from interface it.unive.lisa.analysis.Lattice
bottom, isBottom, isTop, lessOrEqual, lub, top, widening
-
Methods inherited from interface it.unive.lisa.analysis.SemanticDomain
assign, assume, forgetIdentifier, forgetIdentifiers, representation, satisfies
-
-
-
-
Method Detail
-
toString
public final java.lang.String toString()
- Specified by:
toStringin classBaseLattice<H extends BaseHeapDomain<H>>
-
smallStepSemantics
public final H smallStepSemantics(SymbolicExpression expression, ProgramPoint pp) throws SemanticException
Description copied from interface:SemanticDomainYields a copy of this domain, that has been modified accordingly to the semantics of the givenexpression.- Specified by:
smallStepSemanticsin 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 evaluated- Returns:
- a copy of this domain, modified accordingly to the semantics of
expression - Throws:
SemanticException- if an error occurs during the computation
-
mk
protected abstract 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
-
pushScope
public H pushScope(ScopeToken scope) throws SemanticException
Description copied from interface:SemanticDomainPushes a new scope, identified by the give token, in the domain. This causes information about 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 withSemanticDomain.popScope(ScopeToken).- Specified by:
pushScopein interfaceSemanticDomain<H extends BaseHeapDomain<H>,SymbolicExpression,Identifier>- Parameters:
scope- the token identifying the scope to push- Returns:
- a copy of this domain where the local variables have been hidden
- Throws:
SemanticException- if an error occurs during the computation
-
popScope
public H popScope(ScopeToken scope) throws SemanticException
Description copied from interface:SemanticDomainPops the scope identified by the given token from the domain. This causes all the visible variables (i.e. that are not mapped to a scope) to be removed from the domain, while the local variables that were associated to the given scope token (and thus hidden) will become visible again.- Specified by:
popScopein interfaceSemanticDomain<H extends BaseHeapDomain<H>,SymbolicExpression,Identifier>- Parameters:
scope- the token of the scope to be restored- Returns:
- a copy of this domain 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
protected abstract H semanticsOf(HeapExpression expression, ProgramPoint pp) 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 evaluated- Returns:
- a new instance of this domain
- Throws:
SemanticException- if an error occurs during the computation
-
-