|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
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(). | |
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).
|
inlineexplicitconstexprnoexcept |
Wrap a raw carrier value as a Truth (the monic promotion).
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}.
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.
|
inlineexplicitconstexprnoexcept |
Meet ∧ = L::AND and join ∨ = L::OR on two wrappers, spelled && / || to complete the && / || / ! register (matching the raw carriers bool / Ternary).
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. 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().