Class 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
    See Also:
    https://mitpress.mit.edu/books/introduction-static-analysis
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  PointBasedHeap.Rewriter
      A BaseHeapDomain.Rewriter for the PointBasedHeap domain.
      • Nested classes/interfaces inherited from interface it.unive.lisa.analysis.heap.HeapSemanticOperation

        it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement
      • Nested classes/interfaces inherited from interface it.unive.lisa.analysis.SemanticDomain

        it.unive.lisa.analysis.SemanticDomain.Satisfiability
    • 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.
      • Fields inherited from interface it.unive.lisa.analysis.Lattice

        BOTTOM_STRING, TOP_STRING
    • Constructor Summary

      Constructors 
      Constructor Description
      PointBasedHeap()
      Builds a new instance of field-insensitive point-based heap.
      PointBasedHeap​(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
      PointBasedHeap assign​(it.unive.lisa.symbolic.value.Identifier id, it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)  
      PointBasedHeap assume​(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)  
      PointBasedHeap bottom()  
      boolean equals​(java.lang.Object obj)  
      PointBasedHeap forgetIdentifier​(it.unive.lisa.symbolic.value.Identifier id)  
      PointBasedHeap forgetIdentifiersIf​(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)  
      PointBasedHeap from​(PointBasedHeap original)
      Builds a point-based heap from a reference one.
      java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> getSubstitution()  
      int hashCode()  
      boolean isBottom()  
      boolean isTop()  
      boolean lessOrEqualAux​(PointBasedHeap other)  
      PointBasedHeap lubAux​(PointBasedHeap other)  
      PointBasedHeap mk​(PointBasedHeap reference)  
      PointBasedHeap popScope​(it.unive.lisa.analysis.ScopeToken scope)  
      PointBasedHeap pushScope​(it.unive.lisa.analysis.ScopeToken scope)  
      it.unive.lisa.analysis.representation.DomainRepresentation representation()  
      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.Satisfiability satisfies​(it.unive.lisa.symbolic.SymbolicExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)  
      PointBasedHeap semanticsOf​(it.unive.lisa.symbolic.heap.HeapExpression expression, it.unive.lisa.program.cfg.ProgramPoint pp)  
      PointBasedHeap top()  
      • Methods inherited from class it.unive.lisa.analysis.heap.BaseHeapDomain

        smallStepSemantics, toString
      • Methods inherited from class it.unive.lisa.analysis.BaseLattice

        lessOrEqual, lub, 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

        rewriteAll
      • Methods inherited from interface it.unive.lisa.analysis.Lattice

        lessOrEqual, lub, widening
      • Methods inherited from interface it.unive.lisa.analysis.SemanticDomain

        forgetIdentifiers, getDomainInstance
    • 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.
    • Constructor Detail

      • PointBasedHeap

        public PointBasedHeap()
        Builds a new instance of field-insensitive point-based heap.
      • PointBasedHeap

        public 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

        public 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
      • forgetIdentifiersIf

        public PointBasedHeap forgetIdentifiersIf​(java.util.function.Predicate<it.unive.lisa.symbolic.value.Identifier> test)
                                           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()
      • isTop

        public boolean isTop()
      • isBottom

        public boolean isBottom()
      • getSubstitution

        public java.util.List<it.unive.lisa.analysis.heap.HeapSemanticOperation.HeapReplacement> getSubstitution()
      • lubAux

        public PointBasedHeap lubAux​(PointBasedHeap other)
                              throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lubAux in class it.unive.lisa.analysis.BaseLattice<PointBasedHeap>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • lessOrEqualAux

        public boolean lessOrEqualAux​(PointBasedHeap other)
                               throws it.unive.lisa.analysis.SemanticException
        Specified by:
        lessOrEqualAux in class it.unive.lisa.analysis.BaseLattice<PointBasedHeap>
        Throws:
        it.unive.lisa.analysis.SemanticException
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class it.unive.lisa.analysis.BaseLattice<PointBasedHeap>
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in class it.unive.lisa.analysis.BaseLattice<PointBasedHeap>
      • semanticsOf

        public PointBasedHeap semanticsOf​(it.unive.lisa.symbolic.heap.HeapExpression expression,
                                          it.unive.lisa.program.cfg.ProgramPoint pp)
                                   throws it.unive.lisa.analysis.SemanticException
        Specified by:
        semanticsOf in class it.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:
        popScope in interface it.unive.lisa.analysis.SemanticDomain<PointBasedHeap,​it.unive.lisa.symbolic.SymbolicExpression,​it.unive.lisa.symbolic.value.Identifier>
        Overrides:
        popScope in class it.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:
        pushScope in interface it.unive.lisa.analysis.SemanticDomain<PointBasedHeap,​it.unive.lisa.symbolic.SymbolicExpression,​it.unive.lisa.symbolic.value.Identifier>
        Overrides:
        pushScope in class it.unive.lisa.analysis.heap.BaseHeapDomain<PointBasedHeap>
        Throws:
        it.unive.lisa.analysis.SemanticException