Class AllocationSiteBasedAnalysis<A extends AllocationSiteBasedAnalysis<A>>
- java.lang.Object
-
- it.unive.lisa.analysis.heap.pointbased.AllocationSiteBasedAnalysis<A>
-
- Type Parameters:
A
- the concrete type of analysis that methods of this class return
- All Implemented Interfaces:
it.unive.lisa.analysis.BaseLattice<A>
,it.unive.lisa.analysis.heap.BaseHeapDomain<A>
,it.unive.lisa.analysis.heap.HeapDomain<A>
,it.unive.lisa.analysis.heap.HeapSemanticOperation
,it.unive.lisa.analysis.heap.MemoryOracle
,it.unive.lisa.analysis.Lattice<A>
,it.unive.lisa.analysis.ScopedObject<A>
,it.unive.lisa.analysis.SemanticDomain<A,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>
,it.unive.lisa.util.representation.StructuredObject
- Direct Known Subclasses:
FieldSensitivePointBasedHeap
,PointBasedHeap
public abstract class AllocationSiteBasedAnalysis<A extends AllocationSiteBasedAnalysis<A>> extends java.lang.Object implements it.unive.lisa.analysis.heap.BaseHeapDomain<A>
A base class for heap analyses based on the allocation sites of the objects and arrays they track, namely the position of the code where heap locations are generated. All heap locations that are generated at the same allocation sites are abstracted into a single unique heap identifier. Concrete instances have control over their field-sensitivity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AllocationSiteBasedAnalysis.Rewriter
ABaseHeapDomain.Rewriter
for theAllocationSiteBasedAnalysis
domain.
-
Field Summary
Fields Modifier and Type Field Description it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites>
heapEnv
An heap environment tracking which allocation sites are associated to each identifier.java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement>
replacements
The replacements to be applied after the generation of this domain instance.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AllocationSiteBasedAnalysis()
Builds a new instance of allocation site-based heap.AllocationSiteBasedAnalysis(it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv)
Builds a new instance of allocation site-based heap from its heap environment.AllocationSiteBasedAnalysis(it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv, java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> replacements)
Builds a new instance of allocation site-based heap from its heap environment and replacements.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description it.unive.lisa.analysis.lattices.Satisfiability
alias(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
A
assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
A
assume(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle)
boolean
equals(java.lang.Object obj)
protected java.util.Set<AllocationSite>
getAllocatedAt(java.lang.String location)
Yields an allocation site nameid
if it is tracked by this domain,null
otherwise.java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement>
getSubstitution()
int
hashCode()
boolean
isBottom()
it.unive.lisa.analysis.lattices.Satisfiability
isReachableFrom(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
boolean
isTop()
boolean
knowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)
boolean
lessOrEqualAux(A other)
protected abstract A
mk(A reference, it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv)
Builds a new instance of this class by copying abstract information fromreference
and using the given environment for storing points-to information.it.unive.lisa.util.representation.StructuredRepresentation
representation()
it.unive.lisa.analysis.lattices.ExpressionSet
rewrite(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
it.unive.lisa.analysis.lattices.Satisfiability
satisfies(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
A
semanticsOf(it.unive.lisa.symbolic.heap.HeapExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
A
shallowCopy(it.unive.lisa.symbolic.value.Identifier id, StackAllocationSite site, java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> replacements, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle)
Performs the assignment ofsite
to the identifierid
whensite
is a static allocation site, thus performing a shallow copy instead of aliasing handling the heap replacements.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.analysis.heap.BaseHeapDomain
mk, mk, popScope, pushScope, smallStepSemantics
-
Methods inherited from interface it.unive.lisa.analysis.BaseLattice
glb, glbAux, lessOrEqual, lub, lubAux, narrowing, narrowingAux, toString, widening, wideningAux
-
-
-
-
Field Detail
-
heapEnv
public final it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv
An heap environment tracking which allocation sites are associated to each identifier.
-
replacements
public final java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> replacements
The replacements to be applied after the generation of this domain instance.
-
-
Constructor Detail
-
AllocationSiteBasedAnalysis
protected AllocationSiteBasedAnalysis()
Builds a new instance of allocation site-based heap.
-
AllocationSiteBasedAnalysis
public AllocationSiteBasedAnalysis(it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv)
Builds a new instance of allocation site-based heap from its heap environment.- Parameters:
heapEnv
- the heap environment that this instance tracks
-
AllocationSiteBasedAnalysis
public AllocationSiteBasedAnalysis(it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv, java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> replacements)
Builds a new instance of allocation site-based heap from its heap environment and replacements.- Parameters:
heapEnv
- the heap environment that this instance tracksreplacements
- the heap replacements of this instance
-
-
Method Detail
-
mk
protected abstract A mk(A reference, it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv)
Builds a new instance of this class by copying abstract information fromreference
and using the given environment for storing points-to information.- Parameters:
reference
- the domain whose abstract information needs to be copiedheapEnv
- the heap environment that this instance tracks- Returns:
- the new instance
-
assign
public A assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
assign
in interfaceit.unive.lisa.analysis.SemanticDomain<A extends AllocationSiteBasedAnalysis<A>,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
getAllocatedAt
protected java.util.Set<AllocationSite> getAllocatedAt(java.lang.String location)
Yields an allocation site nameid
if it is tracked by this domain,null
otherwise.- Parameters:
location
- allocation site's name to be searched- Returns:
- an allocation site name
id
if it is tracked by this domain,null
otherwise
-
shallowCopy
public A shallowCopy(it.unive.lisa.symbolic.value.Identifier id, StackAllocationSite site, java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> replacements, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
Performs the assignment ofsite
to the identifierid
whensite
is a static allocation site, thus performing a shallow copy instead of aliasing handling the heap replacements.- Parameters:
id
- the identifier to be updatedsite
- the allocation site to be assignedreplacements
- the list of replacements to be updatedpp
- the program point where this operation occursoracle
- the oracle for inter-domain communication- Returns:
- the point-based heap instance where
id
is updated withstar_y
and the needed heap replacements - Throws:
it.unive.lisa.analysis.SemanticException
- if something goes wrong during the analysis
-
assume
public A assume(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint src, it.unive.lisa.program.cfg.ProgramPoint dest, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
assume
in interfaceit.unive.lisa.analysis.SemanticDomain<A extends AllocationSiteBasedAnalysis<A>,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
satisfies
public it.unive.lisa.analysis.lattices.Satisfiability satisfies(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
satisfies
in interfaceit.unive.lisa.analysis.SemanticDomain<A extends AllocationSiteBasedAnalysis<A>,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>
- Throws:
it.unive.lisa.analysis.SemanticException
-
representation
public it.unive.lisa.util.representation.StructuredRepresentation representation()
- Specified by:
representation
in interfaceit.unive.lisa.util.representation.StructuredObject
-
isTop
public boolean isTop()
- Specified by:
isTop
in interfaceit.unive.lisa.analysis.Lattice<A extends AllocationSiteBasedAnalysis<A>>
-
isBottom
public boolean isBottom()
- Specified by:
isBottom
in interfaceit.unive.lisa.analysis.Lattice<A extends AllocationSiteBasedAnalysis<A>>
-
getSubstitution
public java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> getSubstitution()
- Specified by:
getSubstitution
in interfaceit.unive.lisa.analysis.heap.HeapSemanticOperation
-
lessOrEqualAux
public boolean lessOrEqualAux(A other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
lessOrEqualAux
in interfaceit.unive.lisa.analysis.BaseLattice<A extends AllocationSiteBasedAnalysis<A>>
- Throws:
it.unive.lisa.analysis.SemanticException
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceit.unive.lisa.analysis.BaseLattice<A extends AllocationSiteBasedAnalysis<A>>
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceit.unive.lisa.analysis.BaseLattice<A extends AllocationSiteBasedAnalysis<A>>
- Overrides:
equals
in classjava.lang.Object
-
semanticsOf
public A semanticsOf(it.unive.lisa.symbolic.heap.HeapExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
semanticsOf
in interfaceit.unive.lisa.analysis.heap.BaseHeapDomain<A extends AllocationSiteBasedAnalysis<A>>
- Throws:
it.unive.lisa.analysis.SemanticException
-
rewrite
public it.unive.lisa.analysis.lattices.ExpressionSet rewrite(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
rewrite
in interfaceit.unive.lisa.analysis.heap.MemoryOracle
- Throws:
it.unive.lisa.analysis.SemanticException
-
knowsIdentifier
public boolean knowsIdentifier(it.unive.lisa.symbolic.value.Identifier id)
- Specified by:
knowsIdentifier
in interfaceit.unive.lisa.analysis.SemanticDomain<A extends AllocationSiteBasedAnalysis<A>,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>
-
alias
public it.unive.lisa.analysis.lattices.Satisfiability alias(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
alias
in interfaceit.unive.lisa.analysis.heap.MemoryOracle
- Throws:
it.unive.lisa.analysis.SemanticException
-
isReachableFrom
public it.unive.lisa.analysis.lattices.Satisfiability isReachableFrom(it.unive.lisa.symbolic.SymbolicExpression x, it.unive.lisa.symbolic.SymbolicExpression y, it.unive.lisa.program.cfg.ProgramPoint pp, it.unive.lisa.analysis.SemanticOracle oracle) throws it.unive.lisa.analysis.SemanticException
- Specified by:
isReachableFrom
in interfaceit.unive.lisa.analysis.heap.MemoryOracle
- Throws:
it.unive.lisa.analysis.SemanticException
-
-