Class PointBasedHeap
- java.lang.Object
-
- it.unive.lisa.analysis.BaseLattice<H>
-
- it.unive.lisa.analysis.heap.BaseHeapDomain<PointBasedHeap>
-
- it.unive.lisa.analysis.heap.pointbased.PointBasedHeap
-
- All Implemented Interfaces:
it.unive.lisa.analysis.heap.HeapDomain<PointBasedHeap>,it.unive.lisa.analysis.heap.HeapSemanticOperation,it.unive.lisa.analysis.Lattice<PointBasedHeap>,it.unive.lisa.analysis.SemanticDomain<PointBasedHeap,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>
- Direct Known Subclasses:
FieldSensitivePointBasedHeap
public class PointBasedHeap extends it.unive.lisa.analysis.heap.BaseHeapDomain<PointBasedHeap>
A field-insensitive point-based heap implementation that abstracts heap locations depending on their allocation sites, 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. The implementation follows X. Rival and K. Yi, "Introduction to Static Analysis An Abstract Interpretation Perspective", Section 8.3.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classPointBasedHeap.RewriterABaseHeapDomain.Rewriterfor thePointBasedHeapdomain.
-
Field Summary
Fields Modifier and Type Field Description protected it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites>heapEnvAn heap environment tracking which allocation sites are associated to each identifier.
-
Constructor Summary
Constructors Modifier Constructor Description PointBasedHeap()Builds a new instance of field-insensitive point-based heap.protectedPointBasedHeap(it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv)Builds a new instance of field-insensitive point-based heap from its heap environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PointBasedHeapassign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)PointBasedHeapassume(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)PointBasedHeapbottom()booleanequals(java.lang.Object obj)PointBasedHeapforgetIdentifier(it.unive.lisa.symbolic.value.Identifier id)protected PointBasedHeapfrom(PointBasedHeap original)Builds a point-based heap from a reference one.java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement>getSubstitution()inthashCode()booleanisBottom()booleanisTop()protected booleanlessOrEqualAux(PointBasedHeap other)protected PointBasedHeaplubAux(PointBasedHeap other)PointBasedHeapmk(PointBasedHeap reference)PointBasedHeappopScope(it.unive.lisa.analysis.ScopeToken scope)PointBasedHeappushScope(it.unive.lisa.analysis.ScopeToken scope)it.unive.lisa.analysis.representation.DomainRepresentationrepresentation()it.unive.lisa.analysis.lattices.ExpressionSet<it.unive.lisa.symbolic.value.ValueExpression>rewrite(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)it.unive.lisa.analysis.SemanticDomain.Satisfiabilitysatisfies(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)protected PointBasedHeapsemanticsOf(it.unive.lisa.symbolic.heap.HeapExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)PointBasedHeaptop()protected PointBasedHeapwideningAux(PointBasedHeap other)-
Methods inherited from class it.unive.lisa.analysis.heap.BaseHeapDomain
smallStepSemantics, toString
-
-
-
-
Field Detail
-
heapEnv
protected final it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv
An heap environment tracking which allocation sites are associated to each identifier.
-
-
Constructor Detail
-
PointBasedHeap
public PointBasedHeap()
Builds a new instance of field-insensitive point-based heap.
-
PointBasedHeap
protected PointBasedHeap(it.unive.lisa.analysis.nonrelational.heap.HeapEnvironment<AllocationSites> heapEnv)
Builds a new instance of field-insensitive point-based heap from its heap environment.- Parameters:
heapEnv- the heap environment that this instance tracks
-
-
Method Detail
-
from
protected PointBasedHeap from(PointBasedHeap original)
Builds a point-based heap from a reference one.- Parameters:
original- reference point-based heap- Returns:
- a point-based heap build from the original one
-
assign
public PointBasedHeap assign(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp) throws it.unive.lisa.analysis.SemanticException
- Throws:
it.unive.lisa.analysis.SemanticException
-
assume
public PointBasedHeap assume(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp) throws it.unive.lisa.analysis.SemanticException
- Throws:
it.unive.lisa.analysis.SemanticException
-
forgetIdentifier
public PointBasedHeap forgetIdentifier(it.unive.lisa.symbolic.value.Identifier id) throws it.unive.lisa.analysis.SemanticException
- Throws:
it.unive.lisa.analysis.SemanticException
-
satisfies
public it.unive.lisa.analysis.SemanticDomain.Satisfiability satisfies(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp) throws it.unive.lisa.analysis.SemanticException- Throws:
it.unive.lisa.analysis.SemanticException
-
representation
public it.unive.lisa.analysis.representation.DomainRepresentation representation()
-
top
public PointBasedHeap top()
-
isTop
public boolean isTop()
-
bottom
public PointBasedHeap bottom()
-
isBottom
public boolean isBottom()
-
getSubstitution
public java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> getSubstitution()
-
mk
public PointBasedHeap mk(PointBasedHeap reference)
- Specified by:
mkin classit.unive.lisa.analysis.heap.BaseHeapDomain<PointBasedHeap>
-
lubAux
protected PointBasedHeap lubAux(PointBasedHeap other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
lubAuxin classit.unive.lisa.analysis.BaseLattice<PointBasedHeap>- Throws:
it.unive.lisa.analysis.SemanticException
-
wideningAux
protected PointBasedHeap wideningAux(PointBasedHeap other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
wideningAuxin classit.unive.lisa.analysis.BaseLattice<PointBasedHeap>- Throws:
it.unive.lisa.analysis.SemanticException
-
lessOrEqualAux
protected boolean lessOrEqualAux(PointBasedHeap other) throws it.unive.lisa.analysis.SemanticException
- Specified by:
lessOrEqualAuxin classit.unive.lisa.analysis.BaseLattice<PointBasedHeap>- Throws:
it.unive.lisa.analysis.SemanticException
-
hashCode
public int hashCode()
- Specified by:
hashCodein classit.unive.lisa.analysis.BaseLattice<PointBasedHeap>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin classit.unive.lisa.analysis.BaseLattice<PointBasedHeap>
-
semanticsOf
protected PointBasedHeap semanticsOf(it.unive.lisa.symbolic.heap.HeapExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp) throws it.unive.lisa.analysis.SemanticException
- Specified by:
semanticsOfin classit.unive.lisa.analysis.heap.BaseHeapDomain<PointBasedHeap>- Throws:
it.unive.lisa.analysis.SemanticException
-
rewrite
public it.unive.lisa.analysis.lattices.ExpressionSet<it.unive.lisa.symbolic.value.ValueExpression> rewrite(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp) throws it.unive.lisa.analysis.SemanticException- Throws:
it.unive.lisa.analysis.SemanticException
-
popScope
public PointBasedHeap popScope(it.unive.lisa.analysis.ScopeToken scope) throws it.unive.lisa.analysis.SemanticException
- Specified by:
popScopein interfaceit.unive.lisa.analysis.SemanticDomain<PointBasedHeap,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>- Overrides:
popScopein classit.unive.lisa.analysis.heap.BaseHeapDomain<PointBasedHeap>- Throws:
it.unive.lisa.analysis.SemanticException
-
pushScope
public PointBasedHeap pushScope(it.unive.lisa.analysis.ScopeToken scope) throws it.unive.lisa.analysis.SemanticException
- Specified by:
pushScopein interfaceit.unive.lisa.analysis.SemanticDomain<PointBasedHeap,it.unive.lisa.symbolic.SymbolicExpression,it.unive.lisa.symbolic.value.Identifier>- Overrides:
pushScopein classit.unive.lisa.analysis.heap.BaseHeapDomain<PointBasedHeap>- Throws:
it.unive.lisa.analysis.SemanticException
-
-