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

The HAS-A posture in code: an Algebra HAS-A Carrier (under operations Ops) iff the carrier closes the operations (IsAlgebra), the carrier is mereologically a part of the algebra, and the algebra exposes the part via the arrow_drill_down projector. More...

Concept definition

template<typename Algebra, typename Carrier, typename... Ops>
IsAlgebra<Carrier, Ops...> &&
requires(const Algebra& a) {
{
} -> std::same_as<Carrier>;
}
The HAS-A posture in code: an Algebra HAS-A Carrier (under operations Ops) iff the carrier closes the...
Definition universal.cppm:328
The universal-algebra (A, F) pattern at the closure tier.
Definition universal.cppm:151
Minimal core part-whole relation yielding Omega.
Definition mereology.cppm:875
constexpr auto arrow_drill_down(const Whole &whole)
Generic opt-in drill-down projector for part-whole wrappers.
Definition mereology.cppm:1118

Detailed Description

The HAS-A posture in code: an Algebra HAS-A Carrier (under operations Ops) iff the carrier closes the operations (IsAlgebra), the carrier is mereologically a part of the algebra, and the algebra exposes the part via the arrow_drill_down projector.

In OO terms, HAS-A composition is mereological parthood: the named-carrier type Algebra (e.g. a Rational, a Complex<F>, a Vec2V<T>, or a thin view over a primitive carrier like F_2) HAS-A Carrier in the sense that the carrier is a part of the algebra and the algebra owns access to it. In universal-algebra vocabulary (Burris–Sankappanavar 1981 §I.1): every algebra (A, F) is a pair of a carrier set A and a family F of operations. This concept names both halves of that pair at the type level: the algebra-side closure (IsAlgebra<Carrier, Ops...>) and the mereological role of the carrier inside the algebra.

The concept composes three existing primitives:

  • IsAlgebra<Carrier, Ops...> from this partition — the closure tier of the (A, F) pair (each Op closes on the carrier A, and the carrier is std::semiregular).
  • IsPartOfRelation<Carrier, Algebra, bool> from category:mereology — the value-level part-whole relation, accepted in any of three encodings (order-style <=, predicate-style whole(part), or indexer-style whole[part]).
  • arrow_drill_down<Algebra> from category:mereology — the operator->-based projector that exposes the carrier through the algebra's operator-> overload.

The concept is non-prescriptive about which IsPartOfRelation encoding the engineer uses, which lets each named carrier choose what reads most naturally (predicate-style for thin algebra views over a primitive carrier, indexer-style for vector carriers, etc.).

Ops is a parameter pack so the concept reads at the closure tier when no operations are supplied (in which case the IsAlgebra<Carrier> requirement reduces to std::semiregular<Carrier>) and at the operations tier when concrete operations are named (in which case the operations are required to close on the carrier as well).

See also
Burris & Sankappanavar 1981 §I.1 (algebra (A, F) pair).
Le\'sniewski's mereology (https://plato.stanford.edu/entries/mereology/).
category:mereology for the IsPartOfRelation / arrow_drill_down primitives.
IsAlgebra above for the algebra-side closure tier.
Template Parameters
AlgebraThe named-carrier type — the whole of the HAS-A.
CarrierThe underlying carrier — the part of the HAS-A.
OpsOptional family of operations that close on Carrier. When omitted, only the closure tier is required.

Filed under #573.