Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::category::Truth< L > Class Template Referenceexport

The Monic Wrapper for a Logical Species (Ω). More...

Public Types

using logic_species = L
using machine_type = typename L::Ω

Public Member Functions

constexpr Truth (machine_type v) noexcept
 Wrap a raw carrier value as a Truth (the monic promotion).
constexpr operator machine_type () const noexcept
constexpr bool operator== (const Truth &) const =default

Public Attributes

machine_type value

Friends

constexpr Truth operator! (Truth a) noexcept
constexpr Truth operator&& (Truth a, Truth b) noexcept(noexcept(L::AND(a.value, b.value)))
 Meet ∧ = L::AND and join ∨ = L::OR on two wrappers, spelled && / || to complete the && / || / ! register (matching the raw carriers bool / Ternary).
constexpr Truth operator|| (Truth a, Truth b) noexcept(noexcept(L::OR(a.value, b.value)))
 Join ∨ of two wrappers.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr Truth operator<= (Truth a, Truth b) noexcept
 The truth order: a <= b iff the join a ∨ b is b. Meet / join / reflection themselves are the species morphisms L::AND / L::OR / L::RFL, spelled && / || / ! on the wrapper. The rig + / * surface was retired (#901): a truth value is a De Morgan-lattice element, not a semiring element, so it carries the involution and the lattice order, not + / * / one().

Detailed Description

template<typename L = Boole>
class dedekind::category::Truth< L >

The Monic Wrapper for a Logical Species (Ω).

Wraps a raw truth type (bool, Ternary) as a De Morgan-lattice element, carrying meet && , join || , the involution ! and the lattice order <= , while preventing machine-level integral promotion. The former rig (+ / *) surface was retired: a truth value is a lattice element, not a semiring element (#901).

Constructor & Destructor Documentation

◆ Truth()

template<typename L = Boole>
dedekind::category::Truth< L >::Truth ( machine_type v)
inlineexplicitconstexprnoexcept

Wrap a raw carrier value as a Truth (the monic promotion).

logic__Monic_Construction

explicit by design: a raw carrier does not implicitly become a Truth. This keeps Truth<Boole> && bool decaying to the built-in bool && (short-circuit preserved, which matters if the raw operand has side effects), rather than binding a strict eager wrapper overload. Opt into the lattice register by wrapping explicitly: Truth<L>{v}.

Note
This is a deliberate source-breaking change from the previous implicit constructor: a Truth<L>-returning function can no longer return a bare carrier (write return Truth<L>{v}). No in-tree caller relied on the implicit form, and per the project's experimental-API-break posture no compatibility shim is kept.

Member Function Documentation

◆ operator machine_type()

template<typename L = Boole>
dedekind::category::Truth< L >::operator machine_type ( ) const
inlineexplicitconstexprnoexcept

logic__Conversion

◆ operator&&

template<typename L = Boole>
Truth operator&& ( Truth< L > a,
Truth< L > b )
friend

Meet ∧ = L::AND and join ∨ = L::OR on two wrappers, spelled && / || to complete the && / || / ! register (matching the raw carriers bool / Ternary).

logic__Lattice_Register

Note
Same-species only (Truth<L> op Truth<L>). A mixed Truth op carrier expression is deliberately not captured: because the carrier ctor is explicit the raw operand does not promote to Truth, so Truth<Boole> && bool falls to the built-in bool && bool, preserving short-circuit. Wrap explicitly to stay in the lattice. The register is strict (no short-circuit): on two wrappers both operands are already-computed, side-effect-free values, so eager meet/join is extensionally the built-in behaviour.

◆ operator<=

template<typename L = Boole>
Truth operator<= ( Truth< L > a,
Truth< L > b )
friend

The truth order: a <= b iff the join a ∨ b is b. Meet / join / reflection themselves are the species morphisms L::AND / L::OR / L::RFL, spelled && / || / ! on the wrapper. The rig + / * surface was retired (#901): a truth value is a De Morgan-lattice element, not a semiring element, so it carries the involution and the lattice order, not + / * / one().

logic__Lattice_Order


The documentation for this class was generated from the following file: