1 | initial version |
Luckily this semiring is subsemiring of InfinityRing
:
sage: from sage.matrix.operation_table import OperationTable
sage: R = InfinityRing
sage: OperationTable([R(0),R(1)], operation=operator.add, names='digits')
+ 0 1
+----
0| 0 0
1| 1 1
sage: OperationTable([R(0),R(1)], operation=operator.mul, names='digits')
* 0 1
+----
0| 0 0
1| 0 1
2 | No.2 Revision |
Luckily this semiring is a subsemiring of InfinityRing
:
sage: from sage.matrix.operation_table import OperationTable
sage: R = InfinityRing
sage: OperationTable([R(0),R(1)], operation=operator.add, names='digits')
+ 0 1
+----
0| 0 0
1| 1 1
sage: OperationTable([R(0),R(1)], operation=operator.mul, names='digits')
* 0 1
+----
0| 0 0
1| 0 1
3 | No.3 Revision |
Luckily this semiring is a subsemiring of InfinityRing
:
sage: from sage.matrix.operation_table import OperationTable
sage: R = InfinityRing
sage: OperationTable([R(0),R(1)], operation=operator.add, names='digits')
+ 0 1
+----
0| 0 0
1| 1 1
sage: OperationTable([R(0),R(1)], operation=operator.mul, names='digits')
* 0 1
+----
0| 0 0
1| 0 1
There is however a bug in addition, which I reported at https://trac.sagemath.org/ticket/34231
4 | No.4 Revision |
Luckily this semiring is a subsemiring of InfinityRing
:
sage: from sage.matrix.operation_table import OperationTable
sage: R = InfinityRing
sage: OperationTable([R(0),R(1)], operation=operator.add, names='digits')
+ 0 1
+----
0| 0 0
0 # here we a bug: it should be 0 1
1| 1 1
sage: OperationTable([R(0),R(1)], operation=operator.mul, names='digits')
* 0 1
+----
0| 0 0
1| 0 1
There is however a bug in addition, which I reported at https://trac.sagemath.org/ticket/34231
5 | No.5 Revision |
OPTION #1. Luckily this semiring is a subsemiring of InfinityRing
:
sage: from sage.matrix.operation_table import OperationTable
sage: R = InfinityRing
sage: OperationTable([R(0),R(1)], operation=operator.add, names='digits')
+ 0 1
+----
0| 0 0 # here we a bug: it should be 0 1
1| 1 1
sage: OperationTable([R(0),R(1)], operation=operator.mul, names='digits')
* 0 1
+----
0| 0 0
1| 0 1
There is however a bug in addition, which I reported at https://trac.sagemath.org/ticket/34231
OPTION #2. Another approach is to use TropicalSemiring
as follows:
R = TropicalSemiring(Zmod(2),use_min=False)
6 | No.6 Revision |
OPTION #1. Luckily this semiring is a subsemiring of InfinityRing
:
sage: from sage.matrix.operation_table import OperationTable
sage: R = InfinityRing
sage: OperationTable([R(0),R(1)], operation=operator.add, names='digits')
+ 0 1
+----
0| 0 1
1| 1 1
sage: OperationTable([R(0),R(1)], operation=operator.mul, names='digits')
* 0 1
+----
0| 0 0
1| 0 1
There is however a bug in addition, which I reported at https://trac.sagemath.org/ticket/34231
OPTION #2. Another approach is to use TropicalSemiring
as follows:
R = TropicalSemiring(Zmod(2),use_min=False)
TropicalSemiring(GF(2), use_min=False)