MG4J uses minimal-interval semantics to express the semantics of a query. A single-index query is turned into an element of a interval-antichain lattice; the element expresses the regions of the documents that satisfy the query. Queries involving more than one index are turned into elements of a sum of such lattices.Manipulating the above lattices is not always trivial, so we decided to write a full Java package that could manipulate easily any kind of lattice. Marco Rosa wrote the first implementation, under Sebastiano Vigna's supervision, as part of his degree thesis.
First of all, have a look at the
Element interfaces to see which operations
are supported. The main idea is that by playing with an interactive environment such as
the BeanShell you can create lattices, create elements,
and use Java variables and syntactic constructs as if you were using an ad hoc computational
algebra package. The
Lattices static container
provides methods that do nice things such as
emitting a representation
of the covering relation in the Graphviz language, that
can be automatically drawn into a Hasse diagram, as shown on the right for the free
lattice on three generators (actually, the sum of three 3-chains).
There are two ways you can use LaMa4J: you can enrich the existing set of lattices (see,
so on), or you can build new lattices using operators such as
for distributive lattices) and dualisation.