|
|||||||||
| 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.IntervalAntichains
public class IntervalAntichains
The distributive lattice of antichains of intervals of a linear finite order. It is isomorphic to the order-ideal completion of intervals ordered by reverse inclusion, the isomorphism being given by taking the union of all principal ideals generated by the elements of an antichain.
Given an integer n, this class represents the lattice of interval antichains of the linear order { 0, 1, …, n−1 }.
This lattice plays a prominent rôle in “An algebra for structured text search and a framework for its implementation”, by Charles L.A. Clarke, Gordon V. Cormack, and Forbes J. Burkowski, Comput. J., 38(1):43−56, 1995, where it is used to denote regions of text satisfying a query (albeit the authors do not remark that their lattice is actually an order-ideal completion). The algorithms used in this implementation are described in “Efficient lazy algorithms for minimal-interval semantics”, by Paolo Boldi and Sebastiano Vigna, Proc. SPIRE 2006, number 4209 in Lecture Notes in Computer Science, pages 134−149. Springer–Verlag, 2006, where a more mathematically oriented description of the lattice can be found.
| Field Summary | |
|---|---|
int |
n
Number of elements used to generate intervals. |
| Fields inherited from interface it.unimi.dsi.lama4j.Lattice |
|---|
RING, UTF8 |
| Constructor Summary | |
|---|---|
IntervalAntichains(int n)
|
|
| Method Summary | |
|---|---|
boolean |
comp(Element x,
Element y)
Returns whether the two provided elements are comparable. |
Set<Element> |
generators()
Returns a set of generators for the lattice. |
Element |
join(Element... element)
Returns the join of the provided elements. |
boolean |
leq(Element x,
Element y)
Returns whether an element is less than or equal to another element in the natural order of this lattice. |
Element |
meet(Element... element)
Returns the meet of the provided elements. |
Element |
minus(Element x,
Element y)
Returns an antichain equal to the first element from which all intervals containing some interval of the second element have been eliminated. |
Element |
one()
Returns the one of this lattice. |
Element |
valueOf(String name)
Parses an antichain, returning the corresponding element. |
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, elements, ensureElementsInLattice, ensureElementsInLattice, ensureElementsInLattice, pscomp, valueOfZeroOrOne |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final int n
| Constructor Detail |
|---|
public IntervalAntichains(int n)
| Method Detail |
|---|
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 Set<Element> generators()
Latticezero or
one. There is no guarantee of freeness or minimality.
public Element valueOf(String name)
An interval is described (using Hoare's notation) by a pair of integers, separated by two dots and surrounded by square brackets. Thus, [1..3] denotes the interval containing the integers 1, 2, and 3. The shortcut [x] can be used to denote the singleton interval containing x.
An interval antichain is described by a list of intervals separated by commas. Of course, no interval in the list must contain another interval. Intervals can be in any order. For instance, [1..3], [2..4], [0] is a legal antichain.
Spaces are not significative, but the two dots in an interval must be consecutive.
name - the description of an antichain.
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)
comp in interface Latticecomp in class AbstractLatticex - an element.y - another element.
public boolean leq(Element x,
Element y)
This implementation is based on a simple linear greedy algorithm that uses an explicit definition (an antichain A is smaller than or equal to an antichain B iff for every interval in A there is a corresponding smaller interval in B).
leq in interface Latticeleq in class AbstractLatticex - an element.y - another element.
x ≤ y.
public Element minus(Element x,
Element y)
In the case of this lattice, the difference assumes the simple form above, and it can be easily computed with a linear greedy algorithm.
minus in interface Latticeminus in class AbstractLatticex - an element.y - another element.
x with intervals
containing some interval of y removed.Lattice.minus(Element, Element)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||