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 concreteBaseHeapDomain
instance
- All Implemented Interfaces:
HeapDomain<H>
,HeapSemanticOperation
,Lattice<H>
,SemanticDomain<H,SymbolicExpression,Identifier>
public abstract class BaseHeapDomain<H extends BaseHeapDomain<H>> extends BaseLattice<H> implements HeapDomain<H>
A base implementation of theHeapDomain
interface, handling base cases ofsmallStepSemantics(SymbolicExpression, ProgramPoint)
. 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 Class Description static class
BaseHeapDomain.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_STRING, TOP_STRING
-
-
Constructor Summary
Constructors Constructor Description BaseHeapDomain()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract H
mk(H reference)
Creates a new instance of this domain containing the same abstract information of reference.H
popScope(ScopeToken scope)
Pops the scope identified by the given token from the domain.H
pushScope(ScopeToken scope)
Pushes a new scope, identified by the give token, in the domain.abstract H
semanticsOf(HeapExpression expression, ProgramPoint pp)
Yields a new instance of this domain, built by evaluating the semantics of the given heap expression.H
smallStepSemantics(SymbolicExpression expression, ProgramPoint pp)
Yields a copy of this domain, that has been modified accordingly to the semantics of the givenexpression
.java.lang.String
toString()
-
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, forgetIdentifiersIf, getDomainInstance, representation, satisfies
-
-
-
-
Method Detail
-
toString
public final java.lang.String toString()
- Specified by:
toString
in classBaseLattice<H extends BaseHeapDomain<H>>
-
smallStepSemantics
public H smallStepSemantics(SymbolicExpression expression, ProgramPoint pp) 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 evaluated- Returns:
- a copy of this domain, modified accordingly to the semantics of
expression
- Throws:
SemanticException
- if an error occurs during the computation
-
mk
public 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:SemanticDomain
Pushes 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:
pushScope
in 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:SemanticDomain
Pops 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:
popScope
in 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
public 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
-
-