-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRing.java
53 lines (47 loc) · 1.01 KB
/
Ring.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.github.vincentk.dedekind.algebra.structures;
import com.github.vincentk.dedekind.algebra.sets.Rings;
import com.github.vincentk.dedekind.sets.binary.function.operation.Closure;
/**
* @see https://en.wikipedia.org/wiki/Ring_(mathematics)
* @param <R>
*/
public interface Ring<
E extends Ring.Re<E>,
R extends Ring<E, R>>
extends
Rings,
SemiRing<E, R>,
Group.P<E, R>
{
interface Re<R extends Re<R>>
extends
SemiRing.SmrE<R>,
Group.P.Pe<R>
{
/**
* Subtraction (inverse of addition).
*
* @param that
* @return this - that
*/
@Override
default R minus(R that) {
return plus(that.negate());
}
default R 一(R that) {
return minus(that);
}
}
/**
* The integers numbers are a well-known ring.
* They are the closure of the rational numbers under addition and multiplication.
* @param <N>
*/
interface Integer<
E extends Re<E>,
Z extends Integer<E, Z>
>
extends Ring<E, Z>, Integers,
Closure<E, Z, E, Z, Z>
{}
}