Class GenericSetLattice<E>

    • Constructor Detail

      • GenericSetLattice

        public GenericSetLattice()
        Builds an empty set representing the top element.
      • GenericSetLattice

        public GenericSetLattice​(E element)
        Builds a set containing only the given element.
        Parameters:
        element - the element
      • GenericSetLattice

        public GenericSetLattice​(java.util.Set<E> elements)
        Builds a set with all the given elements.
        Parameters:
        elements - the elements
      • GenericSetLattice

        public GenericSetLattice​(java.util.Set<E> elements,
                                 boolean isTop)
        Builds a set with all the given elements, also specifying whether an empty set should be considered top or bottom.
        Parameters:
        elements - the elements
        isTop - if elements is empty, specifies if this set should be considered top or bottom
    • Method Detail

      • top

        public GenericSetLattice<E> 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 GenericSetLattice<E> 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
      • mk

        public GenericSetLattice<E> mk​(java.util.Set<E> set)
        Description copied from class: SetLattice
        Utility for creating a concrete instance of SetLattice given a set. This decouples the instance of set used during computation of the elements to put in the lattice from the actual type of set underlying the lattice.
        Specified by:
        mk in class SetLattice<GenericSetLattice<E>,​E>
        Parameters:
        set - the set containing the elements that must be included in the lattice instance
        Returns:
        a new concrete instance of SetLattice containing the elements of the given set