|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
Chain<T>: the finite Kleene chain over an integral carrier T, the full-T-range many-valued logic. Boole (2 grades) and Kleene (3) are the small distinguished members; Chain<int> spans the implementation's full int range.
More...

Public Types | |
| using | Ω = T |
| using | JoinOp = Sup |
The op-types OR / AND / RFL are: join / meet are max / min (the numeric order is the truth order), i.e. the value-returning Sup / Inf from :mereology; ¬ is logic_complement<Chain<T>>. Chain<T> reaches IsDistributiveLattice through these. | |
| using | MeetOp = Inf |
| using | RflOp = logic_complement<Chain<T>> |
Static Public Member Functions | |
| static constexpr T | AND (T a, T b) |
Meet ∧ = numeric minimum (the numeric order is the truth order). | |
| static constexpr T | OR (T a, T b) |
Join ∨ = numeric maximum. | |
| static constexpr T | RFL (T a) |
| ¬a = ~a (bitwise NOT): the order-reversing involution swapping the poles (⊥ ↔ ⊤). Overflow-free (no arithmetic). | |
Static Public Attributes | |
| static constexpr T | True = std::numeric_limits<T>::max() |
The top pole ⊤ = the carrier maximum. | |
| static constexpr T | False = std::numeric_limits<T>::min() |
The bottom pole ⊥ = the carrier minimum. | |
Chain<T>: the finite Kleene chain over an integral carrier T, the full-T-range many-valued logic. Boole (2 grades) and Kleene (3) are the small distinguished members; Chain<int> spans the implementation's full int range.
Meet AND = min, join OR = max (the numeric order is the truth order); reflection RFL = ~a (bitwise NOT), the order-reversing involution swapping ⊥ = numeric_limits::min and ⊤ = numeric_limits::max. A bounded De Morgan chain, hence Kleene (chain implies normality), not Boolean: only the two poles are complemented.
Signed and unsigned integrals both work (unsigned poles 0 / UMAX; signed INT_MIN / INT_MAX, where ~x = -1-x on two's complement). bool is excluded (its ~ promotes, breaking RFL: Boole is the 2-chain). Floating point is excluded by std::integral: totality needs min / max / ¬ everywhere, and NaN breaks the total order.
The bounds are the carrier's own min / max, so the value set is the chain. A sub-interval like [0,100] (a "Percentage" confidence, ¬-fixed at 50) is not sound here: Ω would still be all of T, so True would not be the top and ¬ could leave the interval. A genuinely bounded [Lo,Hi] chain needs a carrier that enforces the range: see Percent / Percentage below (#906). The species names the ops (min / max / ¬); raw T keeps its own boolean &&, so the concepts gate the species' named ops (register- agnostic). See #901.
| using dedekind::category::Chain< T >::JoinOp = Sup |
The op-types OR / AND / RFL are: join / meet are max / min (the numeric order is the truth order), i.e. the value-returning Sup / Inf from :mereology; ¬ is logic_complement<Chain<T>>. Chain<T> reaches IsDistributiveLattice through these.
Chain<T> either way: the machine-int-vs-ℤ question (register the numeric_limits poles as Sup / Inf identities to reach IsBoundedLattice, matching IsBoundedDeMorganChain<Chain<int>>, vs treat the carrier as unbounded ℤ) is a deliberate design decision left out of scope: FIXME(#941).