|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.dsi.lama4j.AbstractLattice
it.unimi.dsi.lama4j.AbstractDistributiveLattice
it.unimi.dsi.lama4j.Sum
public class Sum
The (categorical) sum (a.k.a. free direct product) of distributive lattices.
As for every algebraic theory, elements are terms built from the elements of the two lattices, and quotiented w.r.t. all equations of the theory and all equations that are true in either summand. Each element of a summand is thus identified with an element of the sum, which can be obtained by injection.
In this implementation, to avoid equivalence classes and make the sum computable we restrict to distributive lattices and use Grätzer–Lakser's (disjunctive) canonical representatives (see “Chain conditions in the distributive free product of lattices&rdquo, Trans. Amer. Math. Soc., 144:301−312, 1969) described in clausal form.
A clause is a set of elements from the summands. A reduced clause is a clause containing at most one element from each summand. A (clausal) formula is a set of clauses.
Formulae can be interpreted in a disjunctive or conjunctive way (i.e., as a join of meets or a meet of joins), and both intepretations are used during computations. A (disjunctive or conjunctive) reduced formula is a set of reduced clauses in which no clause can be eliminated without affecting the formula's value. Elements of a sum are stored as disjunctive reduced formulae.
Warning: if one of the summands is trivial (just one element)
it will not annihilate the sum (as it should happen) but
rather it will behave like a neutral element (a rôle actually
played by the two-element Boolean lattice). This unfortunate restriction
is caused by the difficulty of detecting whether one of the summands is trivial (as
Lattice.elements() is optional).
| Field Summary |
|---|
| Fields inherited from interface it.unimi.dsi.lama4j.Lattice |
|---|
RING, UTF8 |
| Method Summary | |
|---|---|
boolean |
comp(Element x,
Element y)
Checks whether two elements are comparable using Lattice.meet(Element[]). |
Set<Element> |
elements()
Generates iteratively all elements of this lattice. |
Set<Element> |
generators()
Returns a set of generators for the lattice. |
Element |
inj(int k,
Element element)
Injects an element of a summand into this sum. |
Element |
join(Element... element)
Returns the join of the provided elements. |
boolean |
leq(Element x,
Element y)
Checks whether an element is smaller than or equal to another element using Lattice.meet(Element[]). |
Element |
meet(Element... element)
Returns the meet of the provided elements. |
static Lattice |
of(Lattice... distributiveLattice)
Returns the sum of the given distributive lattices. |
static Lattice |
of(Lattice[] distributiveLattice,
String[] name)
Returns the sum of the given distributive lattices, giving them specified names. |
Element |
one()
Returns the one of this lattice. |
String |
toString()
|
Element |
valueOf(String name)
Returns an element of this lattice, given its name. |
Element |
zero()
Returns the zero of this lattice. |
| Methods inherited from class it.unimi.dsi.lama4j.AbstractDistributiveLattice |
|---|
isDistributive |
| Methods inherited from class it.unimi.dsi.lama4j.AbstractLattice |
|---|
coveringRelation, ensureElementsInLattice, ensureElementsInLattice, ensureElementsInLattice, minus, pscomp, valueOfZeroOrOne |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static Lattice of(Lattice... distributiveLattice)
distributiveLattice - the distributive lattices whose sum has to be computed.
public static Lattice of(Lattice[] distributiveLattice,
String[] name)
distributiveLattice - the distributive lattices whose sum has to be computed.name - a parallel list of names for each distributiveLattice.
public Set<Element> generators()
Latticezero or
one. There is no guarantee of freeness or minimality.
public Set<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 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 inj(int k,
Element element)
k - the index of a summand.element - an element of the k-th summand.
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 Element meet(Element... element)
Latticeone, and upon a singleton list the only specified element.
element - the elements whose meet has to be computed.
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 String toString()
toString in class Object
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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||