deep_causality_algebra 0.1.0

Abstract algebra traits (groups, rings, fields, algebras) and isomorphism markers for deep_causality.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * SPDX-License-Identifier: MIT
 * Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
 */

//! A commutative monoid: a [`Monoid`](crate::Monoid) whose `combine` is order-independent.

use crate::Monoid;

/// A **commutative monoid**: a [`Monoid`] whose operation additionally satisfies
///
/// - **Commutativity:** `x.combine(y) == y.combine(x)`.
///
/// This is the algebra a `Collection` folds through when child order carries no meaning — the
/// multiset / order-independence property (see `algebraic-causaloid-assumptions.md` #1) follows
/// from commutativity + associativity, not from an ad-hoc assumption.
pub trait CommutativeMonoid: Monoid {}