Package it.unive.lisa.analysis.lattices
Class GenericInverseSetLattice<E>
- java.lang.Object
-
- it.unive.lisa.analysis.lattices.InverseSetLattice<GenericInverseSetLattice<E>,E>
-
- it.unive.lisa.analysis.lattices.GenericInverseSetLattice<E>
-
- Type Parameters:
E
- the type of elements of this set
- All Implemented Interfaces:
BaseLattice<GenericInverseSetLattice<E>>
,Lattice<GenericInverseSetLattice<E>>
,StructuredObject
,java.lang.Iterable<E>
public class GenericInverseSetLattice<E> extends InverseSetLattice<GenericInverseSetLattice<E>,E>
A generic ready-to-useInverseSetLattice
with no additional fields, that relies on an underlying boolean value for distinguishing top and bottom values.
-
-
Field Summary
-
Fields inherited from class it.unive.lisa.analysis.lattices.InverseSetLattice
elements, isTop
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_STRING, TOP_STRING
-
-
Constructor Summary
Constructors Constructor Description GenericInverseSetLattice()
Builds an empty set representing the top element.GenericInverseSetLattice(E element)
Builds a set containing only the given element.GenericInverseSetLattice(java.util.Set<E> elements)
Builds a set with all the given elements.GenericInverseSetLattice(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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericInverseSetLattice<E>
bottom()
Yields the bottom element of this lattice.GenericInverseSetLattice<E>
mk(java.util.Set<E> set)
Utility for creating a concrete instance ofInverseSetLattice
given a set.GenericInverseSetLattice<E>
top()
Yields the top element of this lattice.-
Methods inherited from class it.unive.lisa.analysis.lattices.InverseSetLattice
contains, elements, equals, glbAux, hashCode, isBottom, isEmpty, isTop, iterator, lessOrEqualAux, lubAux, representation, size, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.analysis.BaseLattice
glb, lessOrEqual, lub, narrowing, narrowingAux, widening, wideningAux
-
-
-
-
Constructor Detail
-
GenericInverseSetLattice
public GenericInverseSetLattice()
Builds an empty set representing the top element.
-
GenericInverseSetLattice
public GenericInverseSetLattice(E element)
Builds a set containing only the given element.- Parameters:
element
- the element
-
GenericInverseSetLattice
public GenericInverseSetLattice(java.util.Set<E> elements)
Builds a set with all the given elements.- Parameters:
elements
- the elements
-
GenericInverseSetLattice
public GenericInverseSetLattice(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 elementsisTop
- ifelements
is empty, specifies if this set should be considered top or bottom
-
-
Method Detail
-
top
public GenericInverseSetLattice<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, sinceLattice.isTop()
uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isTop()
accordingly to provide a coherent test.- Returns:
- the top element
-
bottom
public GenericInverseSetLattice<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, sinceLattice.isBottom()
uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isBottom()
accordingly to provide a coherent test.- Returns:
- the bottom element
-
mk
public GenericInverseSetLattice<E> mk(java.util.Set<E> set)
Description copied from class:InverseSetLattice
Utility for creating a concrete instance ofInverseSetLattice
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 classInverseSetLattice<GenericInverseSetLattice<E>,E>
- Parameters:
set
- the set containing the elements that must be included in the lattice instance- Returns:
- a new concrete instance of
InverseSetLattice
containing the elements of the given set
-
-