Package it.unimi.dsi.lama4j
Class Parts
java.lang.Object
it.unimi.dsi.lama4j.AbstractLattice
it.unimi.dsi.lama4j.AbstractDistributiveLattice
it.unimi.dsi.lama4j.Parts
- All Implemented Interfaces:
Lattice
public class Parts extends AbstractDistributiveLattice
The distributive lattice of subsets of an initial segment of the natural numbers.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Parts(int n)
-
Method Summary
Modifier and Type Method Description Collection<Element>
generators()
Return a collection of generators for the lattice.Element
join(Element... elements)
Return the join of the provided elements.Element
meet(Element... elements)
Return the meet of the provided elements.Element
one()
Return the one of this lattice.Element
pscomp(Element x, Element y)
Compute the set implication of two elements.Element
psdiff(Element x, Element y)
Compute the pseudo-difference of two elements.String
toString()
Element
valueOf(int... element)
Return an element of this lattice corresponding to the specified subset.Element
valueOf(String name)
Return an element of this lattice, given its name.Element
zero()
Return the zero of this lattice.Methods inherited from class it.unimi.dsi.lama4j.AbstractLattice
comp, coveringRelation, elements, ensureElementsInLattice, ensureElementsInLattice, ensureElementsInLattice, leq, symdiff, valueOfZeroOrOne
-
Constructor Details
-
Parts
public Parts(int n)
-
-
Method Details
-
valueOf
Description copied from interface:Lattice
Return an element of this lattice, given its name.Certain lattices make it possible to define names for elements. This method returns the element corresponding to the provided name.
- Parameters:
name
- the name of an element of this lattice.- Returns:
- the element of this lattice named
name
.
-
valueOf
Return an element of this lattice corresponding to the specified subset.- Parameters:
element
- a list of integers interpreted as a subset.- Returns:
- an element of this lattice corresponding to the specified subset.
-
generators
Description copied from interface:Lattice
Return a collection of generators for the lattice. The set will not includezero
orone
. There is no guarantee of freeness or minimality.- Returns:
- a collection of generators.
-
one
Description copied from interface:Lattice
Return the one of this lattice.Note 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.
- Returns:
- the one of this lattice.
-
zero
Description copied from interface:Lattice
Return the zero of this lattice.Note 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.
- Returns:
- the zero of this lattice.
-
join
Description copied from interface:Lattice
Return the join of the provided elements. In particular, upon the empty list of arguments returnszero
, and upon a singleton list the only specified element.- Parameters:
elements
- the elements whose join has to be computed.- Returns:
- the join of the provided elements.
-
meet
Description copied from interface:Lattice
Return the meet of the provided elements. In particular, upon the empty list of arguments returnsone
, and upon a singleton list the only specified element.- Parameters:
elements
- the elements whose meet has to be computed.- Returns:
- the meet of the provided elements.
-
psdiff
Compute the pseudo-difference of two elements.In the case of a Boolean algebra, x − y = x ∧ ~y.
- Specified by:
psdiff
in interfaceLattice
- Overrides:
psdiff
in classAbstractLattice
- Parameters:
x
- an element.y
- another element.- Returns:
x
−y
.- See Also:
Lattice.psdiff(Element, Element)
-
pscomp
Compute the set implication of two elements.In the case of a Boolean algebra, x ⇒ y = ~x ∨ y.
- Specified by:
pscomp
in interfaceLattice
- Overrides:
pscomp
in classAbstractLattice
- Parameters:
x
- an element.y
- another element.- Returns:
x
⇒y
.- See Also:
Lattice.pscomp(Element, Element)
-
toString
-