public class Op extends Object implements Lattice
Instances of this class wrap a given lattice, dualising all its operations.
Since the lattice axioms (including distributivity) are self-dual, by reversing the order relation (or, equivalently, exchanging meets and joins) we get a new lattice. Note that the definitions of difference and relative pseudocomplement are dual, so a lattice is a Browerian algebra iff its opposite is a Heyting algebra.
| Modifier and Type | Method and Description |
|---|---|
boolean |
comp(Element x,
Element y)
Return whether the two provided elements are comparable.
|
Map<Element,Set<Element>> |
coveringRelation()
Compute the covering relation by transposing the covering relation of the
dualised lattice.
|
Collection<Element> |
elements()
Return all elements of this lattice (optional operation).
|
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)
Return whether an element is less than or equal to another element in the natural order of
this lattice.
|
Element |
meet(Element... element)
Return the meet of the provided elements.
|
Element |
one()
Return the one of this lattice.
|
Element |
pscomp(Element x,
Element y)
Return the pseudocomplement of the first element relative to the second element (optional operation).
|
Element |
psdiff(Element x,
Element y)
Return the Brouwerian pseudo-difference of two elements (optional operation).
|
Element |
symdiff(Element x,
Element y)
Return the symmetric difference of the arguments, that is,
psdiff(x,y).join(psdiff(y,x)). |
Element |
valueOf(String name)
Return a dualised element by name.
|
Element |
zero()
Return the zero of this lattice.
|
public Op(Lattice lattice)
public boolean isDistributive()
LatticeisDistributive in interface Latticepublic Element meet(Element... element)
Latticeone, and upon a singleton list the only specified element.public Element join(Element... element)
Latticezero, and upon a singleton list the only specified element.public Collection<Element> generators()
Latticezero or
one. There is no guarantee of freeness or minimality.generators in interface Latticepublic Collection<Element> elements()
LatticeThis operation might not implemented, for instance, in infinite lattices.
public Element valueOf(String name)
Dual elements have the same name of the corresponding elements of the dualised lattice, except for zero and one, which have the standard names.
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 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 boolean comp(Element x, Element y)
Latticepublic boolean leq(Element x, Element y)
Latticepublic Element psdiff(Element x, Element y)
LatticeThe (Brouwerian) pseudo-difference of x and y, usually denoted by x − y, is defined by a Galois connection with the join operation (categorically speaking, an adjunction):
If the Galois connection exists, this lattice is endowed with the structure of a Brouwerian algebra. In that case, if the lattice is finite
and the lattice is necessarily distributive. Conversely, all finite distributive lattices are Brouwerian algebras, with x − y defined as above.
public Element pscomp(Element x, Element y)
LatticeThe pseudocomplement of x relative to y, denoted by x ⇒ y, is defined by a Galois connection with the meet operation (categorically speaking, an adjunction):
If the Galois connection exists, this lattice is endowed with the structure of a Heyting algebra. In that case, if the lattice is finite
and the lattice is necessarily distributive. Conversely, all finite distributive lattices are Heyting algebras.
public Element symdiff(Element x, Element y)
Latticepsdiff(x,y).join(psdiff(y,x)).symdiff in interface Latticex - an element.y - another element.x Δ y.Element.join(Element),
Lattice.psdiff(Element, Element)