public class Product extends AbstractLattice
Note that the product of zero lattices is the trivial lattice with one element.
| Modifier and Type | Method and Description |
|---|---|
boolean |
comp(Element x,
Element y)
Check whether two elements are comparable using
Lattice.meet(Element[]). |
Lattice |
component(int k)
Return a component lattice, given its index.
|
Collection<Element> |
elements()
Generate iteratively all elements of this lattice.
|
Collection<Element> |
generators()
Return a collection of generators for the lattice.
|
boolean |
isDistributive()
Return true if this lattice is distributive.
|
Element |
join(Element... element)
Return the join of the provided elements.
|
boolean |
leq(Element x,
Element y)
Check whether an element is smaller than or equal to another element using
Lattice.meet(Element[]). |
Element |
meet(Element... element)
Return the meet of the provided elements.
|
static Lattice |
of(Lattice... lattice)
Return the product of the provided lattices.
|
Element |
one()
Return the one of this lattice.
|
Element |
proj(Element e,
int i)
Project the provided element on a component specified by index.
|
String |
toString() |
Element |
tuple(Element... element)
Return an element of this product given a tuple of elements
from its factors.
|
Element |
valueOf(String name)
Return an element of this lattice, given its name.
|
Element |
zero()
Return the zero of this lattice.
|
coveringRelation, ensureElementsInLattice, ensureElementsInLattice, ensureElementsInLattice, pscomp, psdiff, symdiff, valueOfZeroOrOnepublic static Lattice of(Lattice... lattice)
lattice - the lattices whose product has to be computed.public boolean isDistributive()
LatticeisDistributive in interface LatticeisDistributive in class AbstractLatticepublic Collection<Element> elements()
AbstractLatticeThis methods uses Lattice.generators() to obtain an initial set of elements,
and then computes joins and meets of all available elements until no new elements
are generated.
It is expected that concrete subclasses will override this method
with an ad hoc, more efficient implementation.
It is strongly suggested that concrete subclasses that do not override this method cache its result internally.
elements in interface Latticeelements in class AbstractLatticepublic Collection<Element> generators()
Latticezero or
one. There is no guarantee of freeness or minimality.public Element proj(Element e, int i)
e - an element of this product.i - a component, specified by its index starting at 0.e on the i-th component.public Element valueOf(String name)
LatticeCertain lattices make it possible to define names for elements. This method returns the element corresponding to the provided name.
name - the name of an element of this lattice.name.public Element tuple(Element... element)
element - a list of elements from each factor of this product, in the same order.element.public Element one()
LatticeNote that there is no guarantee that the returned element is the only element representing one in this lattice. Other ones may arise from computations, but they will always be equal to the element returned by this method.
public Element zero()
LatticeNote that there is no guarantee that the returned element is the only element representing zero in this lattice. Other zeroes may arise from computations, but they will always be equal to the element returned by this method.
public Element join(Element... element)
Latticezero, and upon a singleton list the only specified element.element - the elements whose join has to be computed.public Element meet(Element... element)
Latticeone, and upon a singleton list the only specified element.element - the elements whose meet has to be computed.public Lattice component(int k)
The component lattices of a product are numbered from 0. This method provides access by index to such components.
k - a component index.k.public boolean comp(Element x, Element y)
AbstractLatticeLattice.meet(Element[]).comp in interface Latticecomp in class AbstractLatticex - an element.y - another element.x.meet(y) equals x or y.public boolean leq(Element x, Element y)
AbstractLatticeLattice.meet(Element[]).leq in interface Latticeleq in class AbstractLatticex - an element.y - another element.x.meet(y) equals x.