Class DataflowDomain<D extends DataflowDomain<D,​E>,​E extends DataflowElement<D,​E>>

    • Constructor Detail

      • DataflowDomain

        public DataflowDomain​(E domain,
                              java.util.Set<E> elements,
                              boolean isTop,
                              boolean isBottom)
        Builds the domain.
        Parameters:
        domain - a singleton instance to be used during semantic operations to perform kill and gen operations
        elements - the set of elements contained in this domain
        isTop - whether or not this domain is the top of the lattice
        isBottom - whether or not this domain is the bottom of the lattice
    • Method Detail

      • mk

        public abstract D mk​(E domain,
                             java.util.Set<E> elements,
                             boolean isTop,
                             boolean isBottom)
        Utility for creating a concrete instance of DataflowDomain given its core fields.
        Parameters:
        domain - the underlying domain
        elements - the elements contained in the instance to be created
        isTop - whether the created domain is the top element of the lattice
        isBottom - whether the created domain is the bottom element of the lattice
        Returns:
        the concrete instance of domain
      • assume

        public D assume​(ValueExpression 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.
        Specified by:
        assume in interface SemanticDomain<D extends DataflowDomain<D,​E>,​ValueExpression,​Identifier>
        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
      • top

        public D 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.
        Specified by:
        top in interface Lattice<D extends DataflowDomain<D,​E>>
        Returns:
        the top element
      • isTop

        public boolean isTop()
        Description copied from interface: Lattice
        Yields true if and only if this object represents the top of the lattice. The default implementation of this method uses reference equality between this and the value returned by Lattice.top(), thus assuming that the top element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.
        Specified by:
        isTop in interface Lattice<D extends DataflowDomain<D,​E>>
        Returns:
        true if this is the top of the lattice
      • bottom

        public D 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.
        Specified by:
        bottom in interface Lattice<D extends DataflowDomain<D,​E>>
        Returns:
        the bottom element
      • isBottom

        public boolean isBottom()
        Description copied from interface: Lattice
        Yields true if and only if this object represents the bottom of the lattice. The default implementation of this method uses reference equality between this and the value returned by Lattice.bottom(), thus assuming that the bottom element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.
        Specified by:
        isBottom in interface Lattice<D extends DataflowDomain<D,​E>>
        Returns:
        true if this is the bottom of the lattice
      • getDataflowElements

        public final java.util.Set<E> getDataflowElements()
        Yields the DataflowElements contained in this domain instance.
        Returns:
        the elements
      • popScope

        public D 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 interface SemanticDomain<D extends DataflowDomain<D,​E>,​ValueExpression,​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