tnorms
T-norm and t-conorm families.
tnorms provides common fuzzy-logic aggregation families and fold helpers for
multi-way conjunction and disjunction over values in [0, 1].
Dual-licensed under MIT or Apache-2.0.
[]
= "0.2.0"
use ;
let or_degree = tconorm;
let and_degree = tnorm;
assert!;
assert!;
Families
Named constants:
| Constant | T-norm | T-conorm |
|---|---|---|
GODEL |
min(a, b) |
max(a, b) |
PRODUCT |
a * b |
a + b - a * b |
LUKASIEWICZ |
max(0, a + b - 1) |
min(1, a + b) |
LogicFamily also provides the corresponding residual implication:
let implication = Product.residuum;
assert!;
TruthAlgebra exposes the same logics as marker types for callers that select
the algebra at the type level:
use ;
let degree = tnorm_f32;
assert!;
Core logic families also expose scalar gradients:
let gradient = Product.tnorm_gradient;
assert_eq!;
For long product aggregations, keep the value in log space until the final readout:
let log_degree = log_product;
let degree = product_from_log;
assert!;
Families also expose conservative copula metadata:
assert_eq!;
assert_eq!;
With the burn feature enabled, the same core families can evaluate Burn
tensors:
use ;
The burn feature follows Burn 0.20's Rust toolchain requirements.
| Family | T-conorm behavior |
|---|---|
Maximum |
Hard OR |
Probabilistic |
Probabilistic sum |
Bounded |
Lukasiewicz bounded sum |
Einstein |
Smooth rational OR |
Hamacher |
Aggressive rational OR |
Yager |
Lp-style family |
Frank |
Interpolating family |
Dombi |
Power-based family |
SchweizerSklar |
Parametric family spanning min, product, Lukasiewicz, and drastic limits |
SugenoWeber |
Parametric family spanning drastic, Lukasiewicz, and product limits |
AczelAlsina |
Product-to-min Archimedean family |
MayorTorrens |
Min-to-Lukasiewicz ordinal-sum family |
Drastic |
Discontinuous drastic sum |
NilpotentMinimum |
Nilpotent-minimum dual |
GeneratorFamily exposes additive generators for the Archimedean families.
residuum() computes the corresponding residual implication where the family
has a left-continuous path. OrdinalSum composes families on disjoint
sub-intervals of [0, 1].
Additional aggregation helpers include standard/Sugeno/Yager negations, Kleene-Dienes/Reichenbach/Lukasiewicz/Godel/Product implications, OWA, power means, and representable uninorms.
Default builds use std. --no-default-features builds the scalar API without
std; the Burn feature requires std.