Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::algebra::HasSemiringOperators Concept Referenceexport

Pure syntactic shape: T closes strictly under + and *, with structural identities T{} and T{1}. More...

Concept definition

template<typename T>
concept dedekind::algebra::HasSemiringOperators = requires(T a, T b) {
{ a + b } -> std::same_as<T>;
{ a * b } -> std::same_as<T>;
T{};
T{1};
}
Pure syntactic shape: T closes strictly under + and *, with structural identities T{}...
Definition ring.cppm:267

Detailed Description

Pure syntactic shape: T closes strictly under + and *, with structural identities T{} and T{1}.

ring__Semiring_Shape_And_Homomorphisms

The literal-operator shape concept HasRingOperators above covers the ring surface (+, -, unary -, *). The semiring surface drops subtraction / unary negation but adds the structural identities T{} and T{1} — the "no additive inverse" carriers (booleans under OR/AND, naturals, tropical semirings).

Below we add the semiring-shape sibling and the homomorphism shape concept that lifts the ring surface to morphism-preservation claims. Both are pure-shape (no axiomatic claim); the strict categorical counterparts live in category:total.

History (#394 retire-Like sweep): IsRingLike (identical body to HasRingOperators), IsSemiringLike (identical body to HasSemiringOperators below), and IsRingLikeHomomorphism were collapsed into the literal-shape vocabulary — the operational-vs-shape distinction had no structural difference, so the *Like names were redundant aliases. Pattern-(b) carriers (e.g. Rational<long>, IEEE double) still satisfy these shape concepts via the same mechanism as before; the rationale for accepting them is now expressed by saying "the strict half (e.g. @c IsRing) does not fire on this carrier under the active numeric policy, but the literal-shape (@c HasRingOperators) does".

The semiring-shape sibling of HasRingOperators: drops binary / unary - (no additive inverse required) but adds the structural default-constructor and unit constructor. Carriers that fire: bool under OR/AND, unsigned int (also fires HasRingOperators), naturals, tropical and other exotic semirings.

Replaces the former IsSemiringLike (identical body) under the #394 retire-Like sweep.