Expand description
T-conorm (s-norm) families for fuzzy logic and differentiable relaxations.
A t-conorm S: [0, 1]^2 -> [0, 1] generalizes logical OR. It is:
- Commutative: S(a, b) = S(b, a)
- Associative: S(S(a, b), c) = S(a, S(b, c))
- Monotone: a1 <= a2 => S(a1, b) <= S(a2, b)
- Bounded: S(a, 0) = a (0 is identity)
Different families provide different “softness” of the OR operation, useful in differentiable relaxations and probabilistic reasoning.
§Named families
The constants GODEL, PRODUCT, and LUKASIEWICZ name the three
common fuzzy-logic families. LogicFamily adds the corresponding
residuum for implication:
assert_eq!(tnorms::tnorm(tnorms::GODEL, 0.4, 0.7), 0.4);
assert!((tnorms::tnorm(tnorms::PRODUCT, 0.4, 0.7) - 0.28).abs() < 1e-12);
assert!((tnorms::tnorm(tnorms::LUKASIEWICZ, 0.4, 0.7) - 0.1).abs() < 1e-12);
assert_eq!(tnorms::LogicFamily::Godel.residuum(0.7, 0.4), 0.4);
assert_eq!(tnorms::LogicFamily::Product.tnorm_gradient(0.4, 0.7).da, 0.7);TruthAlgebra exposes the same three families as zero-sized marker types
for crates that choose the logic at the type level:
use tnorms::{Product, TruthAlgebra};
assert!((Product::tnorm_f32(0.4, 0.7) - 0.28).abs() < 1e-6);The generic TConormFamily catalog is an aggregation catalog.
residuum is available for families with a known left-continuous path;
LogicFamily remains the standard fuzzy-logic surface where the t-norm
and residuum form the adjoint pair by construction.
§Catalog
| Family | Formula S(a,b) | Parameter | Behavior |
|---|---|---|---|
| Maximum | max(a,b) | none | Hard OR |
| Probabilistic | a+b-ab | none | Independent events |
| Bounded (Lukasiewicz) | min(1, a+b) | none | Saturating sum |
| Einstein | (a+b)/(1+ab) | none | Smooth OR |
| Hamacher | (a+b-2ab)/(1-ab) | none | Aggressive |
| Yager | min(1, (a^p + b^p)^(1/p)) | p >= 1 | Lp norm |
| Frank | 1 - log_s(1+(s^(1-a)-1)(s^(1-b)-1)/(s-1)) | s > 0 | Interpolates max<->bounded |
| Dombi | 1/(1+((1/a-1)^p + (1/b-1)^p)^(-1/p)) | p > 0 | Power-based |
| Schweizer-Sklar | dual of (x^p+y^p-1)^(1/p) | p | spans min/product/Łukasiewicz/drastic |
| Sugeno-Weber | dual of max(0,(x+y-1+pxy)/(1+p)) | p >= -1 | spans drastic/Łukasiewicz/product |
| Aczel-Alsina | dual of exp(-(((-ln x)^p+(-ln y)^p)^(1/p))) | p > 0 | product-to-min family |
| Mayor-Torrens | ordinal-sum dual | p in [0, 1] | min-to-Łukasiewicz ordinal sum |
| Drastic | drastic sum | none | discontinuous limit |
| Nilpotent minimum | nilpotent-minimum dual | none | left-continuous threshold |
Based on: Petersen et al., gendr – Generalized Differentiable Rendering. The t-conorm catalog provides the relaxation families used for differentiable logical operations and soft aggregation.
Structs§
- Binary
Gradient - Partial derivatives of a binary operation.
- Godel
- Godel truth algebra: minimum t-norm, maximum t-conorm, and Godel residuum.
- Lukasiewicz
- Lukasiewicz truth algebra: bounded-sum t-norm, bounded t-conorm, and Lukasiewicz residuum.
- Ordinal
Segment - One interval of an ordinal-sum t-norm or t-conorm.
- Ordinal
Sum - Ordinal sum over disjoint sub-intervals of
[0, 1]. - Product
- Product truth algebra: product t-norm, probabilistic t-conorm, and Goguen residuum.
Enums§
- Copula
Compatibility - Whether a t-norm family is known to satisfy the copula constraints.
- Generator
Family - Archimedean additive-generator family.
- Implication
Family - Fuzzy implication family.
- Logic
Family - Standard t-norm fuzzy logic families with residual implication.
- Mixed
Region - Mixed-region behavior for representable uninorms.
- Negation
Family - Fuzzy negation family.
- TConorm
Family - T-conorm family selection.
Constants§
- GODEL
- Godel family:
min(a, b)t-norm andmax(a, b)t-conorm. - LUKASIEWICZ
- Lukasiewicz family:
max(0, a + b - 1)t-norm andmin(1, a + b)t-conorm. - PRODUCT
- Product family:
a * bt-norm anda + b - a * bt-conorm.
Traits§
- Truth
Algebra - A standard residuated truth algebra on degrees in
[0, 1].
Functions§
- implication
- Evaluate a fuzzy implication
a -> b. - log_
product - Sum of logs for product t-norm aggregation.
- negation
- Evaluate a fuzzy negation.
- owa
- Ordered weighted averaging over
values. - power_
mean - Generalized power mean over values in
[0, 1]. - power_
mean_ weighted - Weighted generalized power mean over values in
[0, 1]. - product_
from_ log - Convert a log-space product back to a degree in
[0, 1]. - representable_
uninorm - Evaluate a representable uninorm with neutral point
e. - residuum
- Evaluate the residuum
a -> bfor a t-norm family when available. - residuum_
numeric - Numerically approximate the residuum as
sup { c : T(a, c) <= b }. - tconorm
- Evaluate a t-conorm S(a, b) for the given family.
- tconorm_
fold - Aggregate multiple values using a t-conorm (generalized multi-way OR).
- tconorm_
generic - Evaluate a t-conorm S(a, b) for the given family and float type.
- tconorm_
gradient - Evaluate the t-conorm gradient with respect to
(a, b). - tnorm
- The dual t-norm T(a,b) = 1 - S(1-a, 1-b) for a given t-conorm family.
- tnorm_
fold - Aggregate multiple values using a t-norm (generalized multi-way AND).
- tnorm_
generic - Evaluate the standard-negation dual t-norm for a generic float type.
- tnorm_
gradient - Evaluate the t-norm gradient with respect to
(a, b).
Type Aliases§
- Family
- Short alias for selecting a t-norm/t-conorm family.