Ask Your Question
1

define a finite semiring

asked 2022-07-11 22:45:31 +0200

Max Alekseyev gravatar image

updated 2022-07-11 22:50:00 +0200

What would be the simplest way to define the semiring with elements $\{0, 1\}$ with the logical OR ($|$) operation as addition and the standard integer multiplication?

At very least it should be accepted by PolynomialRing as the domain for coefficients.

edit retag flag offensive close merge delete

Comments

Is this GF(2)?

dan_fulea gravatar imagedan_fulea ( 2022-07-13 12:47:09 +0200 )edit

No. In $GF(2)$ we have $1+1=0$, while here $1+1=1$.

Max Alekseyev gravatar imageMax Alekseyev ( 2022-07-13 13:39:12 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-07-27 17:39:32 +0200

Max Alekseyev gravatar image

updated 2022-07-27 17:55:46 +0200

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-07-11 22:45:31 +0200

Seen: 35 times

Last updated: Jul 27