Skip to main content

Module fuzzy

Module fuzzy 

Source

Structs§

MamdaniRule
One Mamdani rule’s contribution: its firing strength and its consequent membership function consequent_mu sampled over the shared output universe.
SugenoRule
One Sugeno (TSK) rule: its firing strength and a crisp consequent value (a 0th-order constant, or a pre-evaluated 1st-order linear function of the inputs).

Functions§

conjunction
Fuzzy conjunction (Gödel t-norm = min) of the truth degrees carried by quins. Empty input → 1.0 (the t-norm identity). Zero-heap.
defuzz_bisector
Bisector: the universe point that splits the area under μ into two equal halves.
defuzz_centroid
Centroid / centre-of-gravity (COG): Σ(uᵢ·μᵢ) / Σ μᵢ.
defuzz_mean_of_max
Mean-of-Maximum (MOM): the mean of the universe points attaining maximum membership.
defuzz_smallest_of_max
Smallest-of-Maximum (SOM): the smallest universe point attaining maximum membership.
degree
Read a proposition’s fuzzy truth degree (canonical f32 in metadata, via the FrameLayout ABI), clamped to [0,1].
disjunction
Fuzzy disjunction (Gödel t-conorm = max) of the truth degrees carried by quins. Empty input → 0.0 (the t-conorm identity). Zero-heap.
firing_strength
Rule firing strength = Gödel t-norm (min) of the antecedent membership degrees. Empty antecedent → 1.0 (the t-norm identity). Use degree() to source each membership from a Quin.
fuzzy_not
Standard fuzzy negation (complement) — 1 - a, clamped to [0,1].
hedge_extremely
Concentration hedge “extremely” — μ³.
hedge_more_or_less
Dilation hedge “more or less” / “somewhat” — √μ (broadens, raises partial memberships).
hedge_very
Concentration hedge “very” — μ² (sharpens, lowers partial memberships).
mamdani_infer
Mamdani inference: clip each rule’s consequent at its firing strength (min-implication), aggregate across rules by max into scratch, then defuzzify by centroid over universe. None if the aggregate set carries no mass. Zero-heap (caller owns scratch, sized to the universe).
sugeno_infer
Sugeno (TSK) inference: the firing-strength-weighted average of rule consequents, Σ(wᵢ·zᵢ) / Σ wᵢ. None if total firing is ~0 (refuse rather than divide by zero).
t_conorm_drastic
Drastic t-conorm — the largest t-conorm: b if a==0, a if b==0, else 1.
t_conorm_godel
Gödel t-conorm (fuzzy OR) — the maximum.
t_conorm_lukasiewicz
Łukasiewicz t-conorm (fuzzy OR) — min(1, a + b).
t_conorm_product
Product t-conorm (fuzzy OR) — a + b - a·b (the probabilistic sum).
t_norm_drastic
Drastic t-norm — the smallest t-norm: b if a==1, a if b==1, else 0.
t_norm_godel
Many-valued / fuzzy logic over truth degrees in [0, 1]. Distinct from the Bayesian probabilistic modality: fuzzy conjunction uses a t-norm (not a product), modelling DEGREES of (partial) satisfaction — e.g. a right that is partially fulfilled. Each proposition carries its truth degree as an f32 in the quin metadata. Zero-heap throughout. Gödel t-norm (fuzzy AND) — the minimum.
t_norm_lukasiewicz
Łukasiewicz t-norm (fuzzy AND) — max(0, a + b - 1).
t_norm_product
Product t-norm (fuzzy AND) — a · b (the probabilistic/algebraic conjunction).