Class Op

java.lang.Object
it.unimi.dsi.lama4j.Op
All Implemented Interfaces:
Lattice

public class Op
extends Object
implements Lattice
The opposite (a.k.a. dual) of a given 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.

  • Constructor Details

  • Method Details

    • isDistributive

      public boolean isDistributive()
      Description copied from interface: Lattice
      Return true if this lattice is distributive.
      Specified by:
      isDistributive in interface Lattice
      Returns:
      true if this lattice is distributive.
    • meet

      public Element meet​(Element... element)
      Description copied from interface: Lattice
      Return the meet of the provided elements. In particular, upon the empty list of arguments returns one, and upon a singleton list the only specified element.
      Specified by:
      meet in interface Lattice
      Parameters:
      element - the elements whose meet has to be computed.
      Returns:
      the meet of the provided elements.
    • join

      public Element join​(Element... element)
      Description copied from interface: Lattice
      Return the join of the provided elements. In particular, upon the empty list of arguments returns zero, and upon a singleton list the only specified element.
      Specified by:
      join in interface Lattice
      Parameters:
      element - the elements whose join has to be computed.
      Returns:
      the join of the provided elements.
    • generators

      public Collection<Element> generators()
      Description copied from interface: Lattice
      Return a collection of generators for the lattice. The set will not include zero or one. There is no guarantee of freeness or minimality.
      Specified by:
      generators in interface Lattice
      Returns:
      a collection of generators.
    • elements

      public Collection<Element> elements()
      Description copied from interface: Lattice
      Return all elements of this lattice (optional operation).

      This operation might not implemented, for instance, in infinite lattices.

      Specified by:
      elements in interface Lattice
      Returns:
      the collection of all elements of this lattice.
    • valueOf

      public Element valueOf​(String name)
      Return a dualised element by 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.

      Specified by:
      valueOf in interface Lattice
      Parameters:
      name - the name of an element of this lattice.
      Returns:
      the element of this lattice named name.
    • zero

      public Element 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.

      Specified by:
      zero in interface Lattice
      Returns:
      the zero of this lattice.
    • one

      public Element 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.

      Specified by:
      one in interface Lattice
      Returns:
      the one of this lattice.
    • comp

      public boolean comp​(Element x, Element y)
      Description copied from interface: Lattice
      Return whether the two provided elements are comparable.
      Specified by:
      comp in interface Lattice
      Parameters:
      x - an element.
      y - another element.
      Returns:
      true if x ≤ y or y ≤ x, false otherwise.
    • leq

      public boolean leq​(Element x, Element y)
      Description copied from interface: Lattice
      Return whether an element is less than or equal to another element in the natural order of this lattice.
      Specified by:
      leq in interface Lattice
      Parameters:
      x - an element.
      y - another element.
      Returns:
      true if x ≤ y, false otherwise.
    • psdiff

      public Element psdiff​(Element x, Element y)
      Description copied from interface: Lattice
      Return the Brouwerian pseudo-difference of two elements (optional operation).

      The (Brouwerian) pseudo-difference of x and y, usually denoted by xy, is defined by a Galois connection with the join operation (categorically speaking, an adjunction):

      xyt  iff  xyt  for all t.

      If the Galois connection exists, this lattice is endowed with the structure of a Brouwerian algebra. In that case, if the lattice is finite

      xy = inf { z | xyz },

      and the lattice is necessarily distributive. Conversely, all finite distributive lattices are Brouwerian algebras, with xy defined as above.

      Specified by:
      psdiff in interface Lattice
      Parameters:
      x - an element.
      y - another element.
      Returns:
      xy.
    • pscomp

      public Element pscomp​(Element x, Element y)
      Description copied from interface: Lattice
      Return the pseudocomplement of the first element relative to the second element (optional operation).

      The pseudocomplement of x relative to y, denoted by xy, is defined by a Galois connection with the meet operation (categorically speaking, an adjunction):

      tyx  iff  xty  for all t.

      If the Galois connection exists, this lattice is endowed with the structure of a Heyting algebra. In that case, if the lattice is finite

      xy = sup { z | xzy },

      and the lattice is necessarily distributive. Conversely, all finite distributive lattices are Heyting algebras.

      Specified by:
      pscomp in interface Lattice
      Parameters:
      x - an element.
      y - another element.
      Returns:
      xy.
    • symdiff

      public Element symdiff​(Element x, Element y)
      Description copied from interface: Lattice
      Return the symmetric difference of the arguments, that is, psdiff(x,y).join(psdiff(y,x)).
      Specified by:
      symdiff in interface Lattice
      Parameters:
      x - an element.
      y - another element.
      Returns:
      x Δ y.
      See Also:
      Element.join(Element), Lattice.psdiff(Element, Element)
    • coveringRelation

      public Map<Element,​Set<Element>> coveringRelation()
      Compute the covering relation by transposing the covering relation of the dualised lattice.
      Specified by:
      coveringRelation in interface Lattice
      Returns:
      a map from elements to set of elements representing the covering relation.