Interface Semiring<T>

  • Type Parameters:
    T - the type of the elements of the structure
    All Superinterfaces:
    RinglikeStructure<T>, Structure<T>
    All Known Subinterfaces:
    Field<T>, OrderedField<T>, Ring<T>
    All Known Implementing Classes:
    AbstractOrderedField, DoubleField

    public interface Semiring<T>
    extends RinglikeStructure<T>
    The algebraic structure of a semiring, which has the following properties:

    R is the underlying set; a, b, c are elements of R.

    1. (R, +) is a commutative monoid with identity element 0:

      (a + b) + c = a + (b + c)

      0 + a = a + 0 = a

      a + b = b + a

    2. (R, *) is a monoid with identity element 1:

      (a*b)*c = a*(b*c)

      1*a = a*1 = a

    3. Multiplication left and right distributes over addition:

      a*(b + c) = (a*b) + (a*c) = (a + b)*c = (a*c) + (b*c)

    4. Multiplication by 0 annihilates R: