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.
- (R, +) is a commutative monoid with identity element 0:
(a + b) + c = a + (b + c)
0 + a = a + 0 = a
a + b = b + a
- (R, *) is a monoid with identity element 1:
(a*b)*c = a*(b*c)
1*a = a*1 = a
- Multiplication left and right distributes over addition:
a*(b + c) = (a*b) + (a*c) = (a + b)*c = (a*c) + (b*c)
- Multiplication by 0 annihilates R:
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommutativeMonoid<T>
additionStructure()
Returns the grouplike structure representing the addition of elements.Monoid<T>
multiplicationStructure()
Returns the grouplike structure representing the multiplication of elements.
-
-
-
Method Detail
-
additionStructure
CommutativeMonoid<T> additionStructure()
Description copied from interface:RinglikeStructure
Returns the grouplike structure representing the addition of elements.- Specified by:
additionStructure
in interfaceRinglikeStructure<T>
- Returns:
- the group like structure for the addition
-
multiplicationStructure
Monoid<T> multiplicationStructure()
Description copied from interface:RinglikeStructure
Returns the grouplike structure representing the multiplication of elements.- Specified by:
multiplicationStructure
in interfaceRinglikeStructure<T>
- Returns:
- the group like structure for multiplication
-
-