Class MonolithicHeap

    • Constructor Detail

      • MonolithicHeap

        public MonolithicHeap()
    • Method Detail

      • rewrite

        public ExpressionSet<ValueExpression> rewrite​(SymbolicExpression expression,
                                                      ProgramPoint pp)
                                               throws SemanticException
        Description copied from interface: HeapDomain
        Rewrites a SymbolicExpression, getting rid of the parts that access heap structures, substituting them with synthetic HeapLocations representing the accessed locations. The expression returned by this method should not contain HeapExpressions.

        If no rewriting is necessary, the input expression can be returned instead.
        Parameters:
        expression - the expression to rewrite
        pp - the program point that where this expression is being rewritten
        Returns:
        the rewritten expression, or the original one
        Throws:
        SemanticException - if something goes wrong during the rewriting
      • assign

        public MonolithicHeap assign​(Identifier id,
                                     SymbolicExpression expression,
                                     ProgramPoint pp)
                              throws SemanticException
        Description copied from interface: SemanticDomain
        Yields a copy of this domain, where id has been assigned to value.
        Parameters:
        id - the identifier to assign the value to
        expression - the expression to assign
        pp - the program point that where this operation is being evaluated
        Returns:
        a copy of this domain, modified by the assignment
        Throws:
        SemanticException - if an error occurs during the computation
      • mk

        protected MonolithicHeap mk​(MonolithicHeap reference)
        Description copied from class: BaseHeapDomain
        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 return this.
        Specified by:
        mk in class BaseHeapDomain<MonolithicHeap>
        Parameters:
        reference - the domain whose abstract information needs to be copied
        Returns:
        a new instance of this domain
      • semanticsOf

        protected MonolithicHeap semanticsOf​(HeapExpression expression,
                                             ProgramPoint pp)
        Description copied from class: BaseHeapDomain
        Yields a new instance of this domain, built by evaluating the semantics of the given heap expression.
        Specified by:
        semanticsOf in class BaseHeapDomain<MonolithicHeap>
        Parameters:
        expression - the expression to evaluate
        pp - the program point that where this expression is being evaluated
        Returns:
        a new instance of this domain
      • assume

        public MonolithicHeap assume​(SymbolicExpression expression,
                                     ProgramPoint pp)
                              throws SemanticException
        Description copied from interface: SemanticDomain
        Yields a copy of this domain, modified by assuming that the given expression holds. It is required that the returned domain is in relation with this one. A safe (but imprecise) implementation of this method can always return this.
        Parameters:
        expression - the expression to assume to hold.
        pp - the program point that where this operation is being evaluated
        Returns:
        the (optionally) modified copy of this domain
        Throws:
        SemanticException - if an error occurs during the computation
      • forgetIdentifier

        public MonolithicHeap forgetIdentifier​(Identifier id)
                                        throws SemanticException
        Description copied from interface: SemanticDomain
        Forgets an Identifier. This means that all information regarding the given id will be lost. This method should be invoked whenever an identifier gets out of scope.
        Parameters:
        id - the identifier to forget
        Returns:
        the semantic domain without information about the given id
        Throws:
        SemanticException - if an error occurs during the computation
      • lubAux

        protected MonolithicHeap lubAux​(MonolithicHeap other)
                                 throws SemanticException
        Description copied from class: BaseLattice
        Performs the least upper bound operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        Specified by:
        lubAux in class BaseLattice<MonolithicHeap>
        Parameters:
        other - the other lattice element
        Returns:
        the least upper bound between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • wideningAux

        protected MonolithicHeap wideningAux​(MonolithicHeap other)
                                      throws SemanticException
        Description copied from class: BaseLattice
        Performs the widening operation between this lattice element and the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        Specified by:
        wideningAux in class BaseLattice<MonolithicHeap>
        Parameters:
        other - the other lattice element
        Returns:
        the widening between this and other
        Throws:
        SemanticException - if an error occurs during the computation
      • lessOrEqualAux

        protected boolean lessOrEqualAux​(MonolithicHeap other)
                                  throws SemanticException
        Description copied from class: BaseLattice
        Yields true if and only if this lattice element is in relation with (usually represented through ≤) the given one, assuming that base cases have already been handled. In particular, it is guaranteed that:
        • other is not null
        • other is neither top nor bottom
        • this is neither top nor bottom
        • this and other are not the same object (according both to == and to Object.equals(Object))
        Specified by:
        lessOrEqualAux in class BaseLattice<MonolithicHeap>
        Parameters:
        other - the other lattice element
        Returns:
        true if and only if that condition holds
        Throws:
        SemanticException - if an error occurs during the computation
      • top

        public MonolithicHeap top()
        Description copied from interface: Lattice
        Yields the top element of this lattice. The returned element should be unique across different calls to this method, since Lattice.isTop() uses reference equality by default. If the value returned by this method is not a singleton, override Lattice.isTop() accordingly to provide a coherent test.
        Returns:
        the top element
      • bottom

        public MonolithicHeap bottom()
        Description copied from interface: Lattice
        Yields the bottom element of this lattice. The returned element should be unique across different calls to this method, since Lattice.isBottom() uses reference equality by default. If the value returned by this method is not a singleton, override Lattice.isBottom() accordingly to provide a coherent test.
        Returns:
        the bottom element