Interface SemiLattice<E>

All Superinterfaces:
Magma<E>, Set<E>

public interface SemiLattice<E> extends Magma<E>
A set equipped with a commutative, associative and idempotent binary operation.

This structure represents half of a lattice. The operation is typically called "join" (∨) or "meet" (∧).

Mathematical Definition

A semilattice (S, •) satisfies:

  • Associativity: (a • b) • c = a • (b • c)
  • Commutativity: a • b = b • a
  • Idempotency: a • a = a

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Tests whether this magma's operation is associative.
    default boolean
    Tests whether this magma's operation is commutative.
    default boolean
    Tests for idempotency (a • a = a).
    operate(E a, E b)
    The binary operation (join or meet).

    Methods inherited from interface Set

    contains, description, isEmpty
  • Method Details

    • operate

      E operate(E a, E b)
      The binary operation (join or meet).
      Specified by:
      operate in interface Magma<E>
      Parameters:
      a - the first operand
      b - the second operand
      Returns:
      the result of a ∗ b
      See Also:
    • isAssociative

      default boolean isAssociative()
      Description copied from interface: Magma
      Tests whether this magma's operation is associative.

      An operation ∗ is associative if for all a, b, c:
      (a ∗ b) ∗ c = a ∗ (b ∗ c)

      If this returns true, this magma is actually a

      invalid reference
      Semigroup
      .

      Specified by:
      isAssociative in interface Magma<E>
      Returns:
      true if the operation is associative
      See Also:
      • invalid reference
        Semigroup
    • isCommutative

      default boolean isCommutative()
      Description copied from interface: Magma
      Tests whether this magma's operation is commutative.

      An operation ∗ is commutative if for all a, b:
      a ∗ b = b ∗ a

      Specified by:
      isCommutative in interface Magma<E>
      Returns:
      true if the operation is commutative
    • isIdempotent

      default boolean isIdempotent()
      Tests for idempotency (a • a = a).
      Returns:
      always true for semilattices