haar_lib/algebra/semiring/
mod.rs

1//! 半環
2
3pub mod add_mul;
4pub mod xor_and;
5
6/// 半環
7pub trait Semiring {
8    /// 加法の単位元
9    fn zero() -> Self;
10    /// 乗法の単位元
11    fn one() -> Self;
12    /// 可換で結合的な二項演算
13    fn add(self, b: Self) -> Self;
14    /// 結合的な二項演算
15    fn mul(self, b: Self) -> Self;
16}