Skip to content
coden

Fuzzy logic: t-norms, implications and IF–THEN rules

Degrees of truth, t-norms and t-conorms (minimum, product, Łukasiewicz), which classical laws survive, residual implications and evaluating rules on a fan controlled by temperature and humidity.

14 minutes Matěj Žalmánek 2026-10-15

Series AI basics Part 34 of 52
  1. Map of artificial intelligence: what is what and how it all fits together
  2. A brief history of artificial intelligence: from Turing to language models
  3. Data, model, training, inference: the basic terms on a single example
  4. How to read mathematical notation: symbols, indices, sums and quantifiers
  5. Sets and relations: the building blocks of definitions in AI
  6. Functions and mappings: why every AI model is a function
  7. Logic and proofs: the rules AI reasons by
  8. Graphs and trees: the structure that both search and neural networks stand on
  9. Linear algebra for machine learning: vectors, matrices and why AI mostly multiplies
  10. Derivatives, the gradient and the chain rule: how a model finds out which way to learn
  11. Gradient descent: how a model learns
  12. What probability is: from rolling dice to the Kolmogorov axioms
  13. Conditional probability and Bayes’ theorem: how to update your estimate when you learn something new
  14. Random variables and the cumulative distribution function: one function that tells you everything about a distribution
  15. Probability density and probability mass functions: why a continuous variable has zero probability at a point
  16. Expected value, variance and covariance: where a distribution lies, how wide it is and what goes with what
  17. Overview of probability distributions: Bernoulli, binomial, Poisson, uniform, normal and exponential
  18. Law of large numbers and central limit theorem: why averages behave so predictably
  19. Statistics and parameter estimation: maximum likelihood, MAP and confidence intervals
  20. Information theory: entropy, cross-entropy and KL divergence — where loss functions come from
  21. State-space search: BFS, DFS, UCS and A* with animations
  22. Games and adversaries: minimax, alpha-beta pruning and Monte Carlo tree search
  23. Constraint satisfaction: backtracking, constraint propagation and AC-3 on sudoku and a map of Czech regions
  24. Logic and knowledge systems: forward and backward chaining, resolution and expert systems
  25. Planning: STRIPS, the blocks world, heuristics from relaxation and planning in AI agents
  26. Local search and simulated annealing: a travelling salesman through the Czech regional capitals
  27. Genetic algorithms: population, crossover, mutation and selection on a backpack for a hike
  28. Evolution strategies and genetic programming: from the one-fifth rule to Kepler’s law
  29. Ant colony optimization: how a pheromone trail finds a short path
  30. Particle swarm optimisation: inertia, personal experience and the swarm’s experience
  31. Neuroevolution: evolving the weights and shape of neural networks, and the NEAT algorithm
  32. Fuzzy sets and membership functions: how to write down “somewhat warm”
  33. Fuzzy logic and probability: why “somewhat warm” does not mean “probably warm”
  34. Fuzzy logic: t-norms, implications and IF–THEN rules
  35. Fuzzy control: Mamdani and Sugeno from a fan to a pole on a cart
  36. Fuzzy clustering: the fuzzy c-means algorithm and points between clusters
  37. Neuro-fuzzy systems (ANFIS): fuzzy rules that learn from data
  38. Markov chains: the transition matrix, the stationary distribution and PageRank
  39. Hidden Markov models: the Viterbi algorithm and the dishonest casino
  40. Bayesian networks: why the grass is wet and what it means for the sprinkler
  41. The Kalman filter: how to estimate where a car is and how fast it goes from imprecise measurements
  42. Types of machine learning: supervised, unsupervised, semi-supervised and more
  43. Prompts, context and RAG: how to give a model the right information
  44. Variational autoencoders (VAE): new images from a continuous latent space
  45. Generative adversarial networks (GAN): the forger versus the detective
  46. Diffusion models: how pure noise becomes an image
  47. Markov decision processes: states, actions, rewards and the Bellman equations
  48. Q-learning and DQN: learning the value of actions, from a table to a neural network
  49. Policy gradient and PPO: learning the policy directly
  50. How an AI agent works: a language model in a loop with tools
  51. Programming with AI agents: the task, tests and review
  52. Evaluating and securing AI systems: how to measure and how to keep watch

Full series syllabus 52 of 83 topics published

What you will take away
  • What t-norms and t-conorms are and why “and” in fuzzy logic is a whole family of operations.
  • Which laws of classical logic hold for the minimum, the product and the Łukasiewicz t-norm.
  • How IF–THEN rules are evaluated: firing strength, clipping the conclusion and combining with the maximum.

Useful to know first: Fuzzy sets and membership functions: how to write down “somewhat warm”, Logic and proofs: the rules AI reasons by

Fuzzy sets gave words like “warm” a precise meaning. Now we want to reason with them: combine them with the connectives “and”, “or”, “not” and write rules such as “if it is warm and humid, run the fan at full speed”. In classical logic it is clear what “and” means — true when both parts are true. But what if one part is true to degree 0.7 and the other to 0.6? It turns out there is a whole family of sensible answers — and each of them keeps a different piece of classical logic.

This builds on the parts Fuzzy sets and membership functions, Fuzzy logic and probability and Logic and proofs.

1. From membership to truth

At 25 °C the statement “it is warm” has degree of truth 0.5 — the same number as the membership of 25 °C in the set “warm”. Fuzzy logic is a logic in which statements take truth values from the whole interval [0, 1], not just 0 and 1. Connectives are functions that compute the truth of the whole from the truth of its parts. Classical logic is the special case in which only the extreme values are used.

Definition — truth value of a compound statement

Let T : [0, 1]2 → [0, 1] be a t-norm (the connective “and”), S : [0, 1]2 → [0, 1] a t-conorm (“or”), ¬ : [0, 1] → [0, 1] a negation (“not”) and I : [0, 1]2 → [0, 1] an implication (“if–then”) — all of them are defined below. The truth value ‖φ‖ ∈ [0, 1] of a statement φ is defined recursively by the structure of the statement:

  1. an atomic statement “x is A”, where X is a non-empty set, A a fuzzy set on X and x ∈ X, has the value ‖x is A‖ = μA(x);
  2. for statements φ, ψ, ‖φ and ψ‖ = T(‖φ‖, ‖ψ‖);
  3. ‖φ or ψ‖ = S(‖φ‖, ‖ψ‖);
  4. ‖not φ‖ = ¬‖φ‖;
  5. ‖if φ, then ψ‖ = I(‖φ‖, ‖ψ‖).

So the value of a compound statement depends only on the values of its parts. If we restrict the values to {0, 1}, we get classical propositional logic.

In plain words

A compound statement is evaluated bottom-up: memberships first, then the connectives one by one, just as you fill in a truth table in classical logic — only instead of 0 and 1 we plug in numbers in between.

Example — “it is warm and not humid” at 27 °C and 60 %

“Warm” is the triangle (22, 28, 34), so ‖warm‖ = 27 − 22/28 − 22 = 5/6 ≈ 0.83. “Humid” rises from 40 to 70 %: ‖humid‖ = 60 − 40/70 − 40 = 2/3 ≈ 0.67, so ‖not humid‖ = 1 − 2/3 = 1/3 ≈ 0.33.

  • with the minimum: min(5/6, 1/3) = 0.33,
  • with the product: 5/6 · 1/3 = 5/18 = 0.28,
  • with the Łukasiewicz t-norm (colours as in its breakdown below): TŁ = max(0, 5/6 + 1/3 − 1) = 1/6 = 0.17.

Three sensible answers to the same question — which one to choose is what the rest of this part is about.

2. T-norms: what “and” means

Definition — t-norm

Let T : [0, 1]2 → [0, 1] be a function. T is a t-norm if and only if for all a, b, c ∈ [0, 1]

  1. commutativity: T(a, b) = T(b, a);
  2. associativity: T(a, T(b, c)) = T(T(a, b), c);
  3. monotonicity: b ≤ c ⇒ T(a, b) ≤ T(a, c);
  4. 1 is the neutral element: T(a, 1) = a.

The value T(a, b) is the truth of “A and B” when A and B have truths a and b.

In plain words

Four reasonable demands on “and”: order does not matter, brackets do not matter, better inputs do not give a worse result, and “A and true” is the same as A. It also follows that “A and false” is false, so at the extreme values every t-norm behaves exactly like the classical “and”.

The four most important ones:

  • Minimum (Gödel, Zadeh) T(a, b) = min(a, b) — a chain is as strong as its weakest link.
  • Product T(a, b) = a · b — like the probability of two independent events.
  • Łukasiewicz T(a, b) = max(0, a + b − 1) — the lower Fréchet bound from the previous part.
  • Drastic — b when a = 1; a when b = 1; otherwise 0.

The least obvious one is the Łukasiewicz t-norm, so let us take it apart:

TŁ(a, b) = max(0, a + b − 1)

TŁ(a, b)
the truth of “A and B” — how much truth both parts must have in common
a + b
the truths of both parts together — picture them as two segments of length a and b that have to fit into a line segment of length 1
− 1
the length of the whole segment — whatever part of a + b exceeds one cannot fit side by side and must overlap; the overlap is what holds at the same time
max(0, …)
when the segments fit side by side (a + b ≤ 1), they need not overlap at all — the truth of “and” is then 0, not a negative number
For 0.7 and 0.6: TŁ(0.7, 0.6) = max(0, 0.7 + 0.6 − 1) = 0.3. In the worst case the segments overlap by only that much — the same reasoning gives the lower Fréchet bound for the probability of an intersection from the previous part.
minimum T(0.7, 0.6) = 0.60 truth of a (0–1) truth of b (0–1) product T(0.7, 0.6) = 0.42 truth of a (0–1) truth of b (0–1) Łukasiewicz T(0.7, 0.6) = 0.30 truth of a (0–1) truth of b (0–1) drastic T(0.7, 0.6) = 0.00 truth of a (0–1) truth of b (0–1)
Four t-norms on the square [0, 1]², the lighter, the larger

For a = 0.7 and b = 0.6 they give 0.60, 0.42, 0.30 and 0. The minimum is the most generous of all, the drastic one the strictest — and that holds in general:

Theorem — bounds of t-norms

Let T be a t-norm and TD the drastic t-norm, i.e. TD(a, 1) = a, TD(1, b) = b and TD(a, b) = 0 for a, b < 1. Then for all a, b ∈ [0, 1]

TD(a, b) ≤ T(a, b) ≤ min(a, b).

Proof. Upper bound: by monotonicity and the neutral one, T(a, b) ≤ T(a, 1) = a, and by commutativity likewise T(a, b) ≤ b. Lower bound: if a = 1, then T(1, b) = b = TD(1, b); if b = 1, similarly. Otherwise TD(a, b) = 0 and T(a, b) ≥ 0 always holds. ∎

In plain words

“A and B” can never be truer than the weaker of its two parts (this follows from monotonicity and the neutral one: T(a, b) ≤ T(a, 1) = a). All t-norms therefore lie between two extremes.

3. T-conorms and negation: “or” and “not”

Definition — t-conorm, negation, duality
  1. A function S : [0, 1]2 → [0, 1] is a t-conorm if and only if for all a, b, c ∈ [0, 1], S(a, b) = S(b, a), S(a, S(b, c)) = S(S(a, b), c), b ≤ c ⇒ S(a, b) ≤ S(a, c) and S(a, 0) = a — that is, the same properties as a t-norm, except that the neutral element is 0.
  2. The standard negation is the function ¬ : [0, 1] → [0, 1], ¬a = 1 − a.
  3. Let T be a t-norm. The dual t-conorm of T is the function S : [0, 1]2 → [0, 1] given for all a, b ∈ [0, 1] by S(a, b) = 1 − T(1 − a, 1 − b) (the properties of T imply that S really is a t-conorm).

For a t-norm T and its dual t-conorm S, De Morgan’s laws hold for all a, b ∈ [0, 1]: ¬T(a, b) = S(¬a, ¬b) and ¬S(a, b) = T(¬a, ¬b).

In plain words

“A or B” is the same as “it is not true that neither A nor B”. So every “and” brings its own “or”. The minimum goes with the maximum, the product with the probabilistic sum a + b − ab, the Łukasiewicz t-norm with the bounded sum min(1, a + b). For 0.7 and 0.6 they give 0.70, 0.88 and 1.

S(a, b) = 1 − T(1 − a, 1 − b)

S(a, b)
the truth of “A or B” — we want to derive it from “and”, not invent it separately
1 − a, 1 − b
the truths of “not A” and “not B” — “or” fails exactly when neither part holds
T
the chosen t-norm — computes how much “not A and not B” holds, i.e. how much “or” fails
1 −
the outer negation — turns “how much it fails” into “how much it holds”; thanks to it De Morgan’s laws hold for every pair T, S automatically
Example — three t-conorms by dualization

The colours in the numerical calculations correspond to the terms of the formula above.

  • Minimum: 1 − min(1 − a, 1 − b) = max(a, b); the smaller complement belongs to the larger number. For 0.7 and 0.6: 1 − min(0.3, 0.4) = 1 − 0.3 = 0.70.
  • Product: 1 − (1 − a)(1 − b) = 1 − (1 − a − b + ab) = a + b − ab. For 0.7 and 0.6: 1 − 0.3 · 0.4 = 1 − 0.12 = 0.88.
  • Łukasiewicz: 1 − max(0, (1 − a) + (1 − b) − 1) = 1 − max(0, 1 − a − b) = min(1, a + b). For 0.7 and 0.6: 1 − max(0, 0.3 + 0.4 − 1) = 1 − 0 = 1.00.

The probabilistic sum has a familiar meaning: for independent events P(A ∪ B) = P(A) + P(B) − P(A)P(B) — the overlap, which would otherwise be counted twice, is subtracted.

4. Which laws survive

Classical logic has plenty of laws. In fuzzy logic not all of them can hold at once — and each t-norm makes a different choice. Checked on the grid of values 0, 0.05, …, 1:

LawMinimumProductŁukasiewicz
idempotence: A and A = Ayesnono
non-contradiction: A and not A = 0nonoyes
excluded middle: A or not A = 1nonoyes
De Morgan’s lawsyesyesyes
distributivity of “and” over “or”yesnono

The minimum keeps the “algebra” — idempotence and distributivity — but loses the law of non-contradiction: “warm and not warm” can be as high as 0.5. Łukasiewicz keeps both non-contradiction and the excluded middle, but “warm and warm” at 0.7 gives only 0.4. This is a known result: the minimum is the only idempotent t-norm, and with it the law of non-contradiction cannot hold. Choosing a connective is therefore choosing which properties we care about.

Theorem — the minimum is the only idempotent t-norm

Let T be a t-norm that is idempotent, i.e. T(a, a) = a for all a ∈ [0, 1]. Then T(a, b) = min(a, b) for all a, b ∈ [0, 1].

Proof. Let a ≤ b. By idempotence and monotonicity a = T(a, a) ≤ T(a, b), and by the theorem on bounds T(a, b) ≤ min(a, b) = a. Hence T(a, b) = a; for a > b the same follows by commutativity. ∎

Corollary. Idempotence and the law of non-contradiction (with the standard negation) cannot hold together: only the minimum is idempotent, and at the point 0.5 it gives min(0.5, 1 − 0.5) = 0.5 ≠ 0.

Example — counterexamples and one proof from the table

Colours for the Łukasiewicz t-norm as in its breakdown above.

  • Łukasiewicz satisfies non-contradiction for every a, not just on the grid: TŁ(a, 1 − a) = max(0, a + 1 − a − 1) = max(0, 0) = 0. Likewise min(1, a + 1 − a) = 1 is the law of excluded middle.
  • Łukasiewicz is not idempotent: TŁ(0.7, 0.7) = 0.7 + 0.7 − 1 = 0.4 ≠ 0.7.
  • The product is not distributive: for a = b = c = 0.5, “a and (b or c)” = 0.5 · (0.5 + 0.5 − 0.25) = 0.3750, but “(a and b) or (a and c)” = 0.25 + 0.25 − 0.25 · 0.25 = 0.4375.
  • The product violates non-contradiction: 0.5 · (1 − 0.5) = 0.25 ≠ 0.

A single counterexample is enough to make a law fail. A “yes” in the table, on the other hand, is checked only on the grid — but for Łukasiewicz’s non-contradiction there is a general proof above.

5. Implication

Definition — residual implication

Let T be a continuous t-norm. The residuum (residual implication) of the t-norm T is the function I : [0, 1]2 → [0, 1] given for all a, b ∈ [0, 1] by

I(a, b) = sup { c ∈ [0, 1] : T(a, c) ≤ b }.

The set in the braces is non-empty (it contains c = 0, because T(a, 0) = 0), so the supremum exists. Then for all a, b, c ∈ [0, 1], T(a, c) ≤ b if and only if c ≤ I(a, b). For the three basic t-norms we get:

  1. minimum → the Gödel implication: I(a, b) = 1 if a ≤ b, and I(a, b) = b if a > b;
  2. product → the Goguen implication: I(a, b) = 1 if a ≤ b, and I(a, b) = b/a if a > b;
  3. the Łukasiewicz t-norm → the Łukasiewicz implication: I(a, b) = min(1, 1 − a + b).
In plain words

“If A, then B” is the strongest claim that, together with A, gives no more than B is worth. The implication is fully true whenever the premise is not truer than the conclusion — just as in classical logic, where anything follows from a falsehood. For premise 0.8 and conclusion 0.3 the three implications give 0.3, 0.375 and 0.5.

I(a, b) = sup { c ∈ [0, 1] : T(a, c) ≤ b }

I(a, b)
the truth of “if A, then B” for a premise with truth a and a conclusion with truth b
c ∈ [0, 1]
a candidate for the truth of the implication — we try every possible value
T(a, c)
“A and (if A, then B)” — what we infer from the premise and the implication together; this is exactly what modus ponens does
≤ b
the soundness condition — the inferred conclusion must not be truer than B really is; the implication must not “promise more”
sup
the largest of the sound candidates — the implication should be as strong as possible, otherwise it would always be 0 and say nothing
The implication is the strongest claim with which modus ponens never infers more from A than B is worth.
Example — three implications for premise 0.8 and conclusion 0.3

We look for the largest c for which T(0.8, c) ≤ 0.3 (colours as in the formula above):

  • minimum: min(0.8, c) ≤ 0.3 holds if and only if c ≤ 0.3 (because 0.8 > 0.3), so I = 0.300,
  • product: 0.8 · c ≤ 0.3, i.e. c ≤ 0.3/0.8, so I = 0.375,
  • Łukasiewicz: max(0, 0.8 + c − 1) ≤ 0.3, i.e. c − 0.2 ≤ 0.3 and c ≤ 0.5, so I = 0.500.

Modus ponens check: plug c = I back into T(0.8, c) — min(0.8, 0.3) = 0.3; 0.8 · 0.375 = 0.3; max(0, 0.8 + 0.5 − 1) = 0.3. In all three cases we get exactly the conclusion 0.3: the implication is tuned to hit it.

Residua are not just elegant: thanks to the relation T(a, c) ≤ b ⇔ c ≤ I(a, b) a fuzzy version of modus ponens holds for them — from A with truth a and from “A ⇒ B” with truth c follows B with truth at least T(a, c). This is the foundation of formal fuzzy logics, built in the 1990s by the Czech logician Petr Hájek.

6. IF–THEN rules

In practice you most often meet fuzzy logic in rules that control a machine. We want a fan that is controlled by temperature and humidity. Fan speed (0–100 %) has the terms slow, medium and fast, humidity the terms dry and humid, temperature the terms from the part on fuzzy sets. The rule base:

  • R1: IF temperature is cold OR pleasant, THEN speed is slow.
  • R2: IF temperature is warm AND humidity is dry, THEN speed is medium.
  • R3: IF temperature is warm AND humidity is humid, THEN speed is fast.
  • R4: IF temperature is hot, THEN speed is fast.
Definition — evaluating a rule (Mamdani)

Let X1, …, Xk be the universes of the input variables, Y the universe of the output variable, T a t-norm and S a t-conorm. Let the base contain the rules R1, …, Rm, where the rule Rr (r = 1, …, m) has the form

IF x1 is Ar1 AND … AND xk is Ark, THEN y is Br,

where Arj is a fuzzy set on Xj (a condition on a variable that the rule does not use is μArj ≡ 1; terms joined by “or” form a single fuzzy set with membership S(μ1, μ2)) and Br is a fuzzy set on Y. For a crisp input (x1, …, xk) ∈ X1 × … × Xk:

  1. the firing strength of the rule Rr is the number αr = T(μAr1(x1), …, μArk(xk)) ∈ [0, 1] (T with more arguments is well defined thanks to associativity);
  2. the conclusion of the rule is the fuzzy set B′r on Y obtained from Br either by clipping, μB′r(y) = min(αr, μBr(y)), or by scaling, μB′r(y) = αr · μBr(y), for every y ∈ Y;
  3. the output of the base is the fuzzy set on Y with membership μ(y) = maxr = 1, …, m μB′r(y),   y ∈ Y.

Mamdani’s original choice is T = min, S = max and clipping.

In plain words

A rule holds as much as its condition holds, and pushes its conclusion just as much. A rule whose condition holds to degree 0.67 may push “fast” only up to a height of 0.67. All rules speak at once, and the result is the outline of what pushes in which direction.

Input: 27 °C and 60 % humidity. The temperature is “pleasant” to degree 0.2 and “warm” to 0.83, the humidity “humid” to 0.67 and “dry” not at all. Rule R3 has firing strength α3 = min(0.83, 0.67) = 0.67 (colour as in the formula below):

temperature = 27 °C humidity = 60 % fan speed (%) minimum 0.83 0.67 0.67 product 0.83 0.67 0.56 temperature T (°C) relative humidity (%) fan speed (%) membership μ (0–1)
Rule R3 with the minimum (clipping) and with the product (scaling)

With the minimum, the conclusion “fast” is clipped at height 0.67 and what is left is a flat trapezoid. With the product the rule has strength 0.83 · 0.67 = 0.56 and the whole of “fast” is scaled down — it keeps its shape, only lower. Both approaches are used in practice; the first is Mamdani’s original choice.

The whole rule base at once:

temperature = 27 °C humidity = 60 % fan speed (%) R1 0.20 0.20 R2 0.83 0.00 0 R3 0.83 0.67 0.67 R4 0.00 0 temperature T (°C) relative humidity (%) fan speed (%) membership μ (0–1) result
All fan rules for 27 °C and 60 % humidity

Two rules fired: R1 with strength 0.2 (the temperature is a little “pleasant”) and R3 with strength 0.67. R2 and R4 stay silent. The result is a fuzzy set over fan speed — a low step at “slow” and a high one at “fast”. But the motor needs a single number. How to get it out of this set is the topic of the next part, on fuzzy control.

μ(y) = maxr min(αr, μBr(y))

μ(y)
the resulting fuzzy set over fan speed — how strongly the rule base recommends speed y (the green area in the figure)
αr
the firing strength of rule r — how much its condition holds for today’s input; a rule must not claim more than its premise is worth
μBr(y)
the conclusion of the rule — the shape of a term such as “fast”, which speeds belong to it and how much (the dashed outline in the figure)
min
clipping — the conclusion is cut off at height αr, because a rule whose condition holds to degree 0.67 cannot recommend anything more than to degree 0.67 (the amber area in the figure)
maxr
combining the rules — the rules are alternatives (“R1 or R2 or …”), so a speed is recommended as strongly as the most willing rule recommends it
With the product instead of the minimum, the conclusion is scaled down instead of clipped: αr · μBr(y).
Example — tracing the rule base for 27 °C and 60 %

Step 1 — fuzzification. Temperature 27 °C: “cold” 0 (ends at 14 °C), “pleasant” falls from 23 to 28 °C, so 28 − 27/28 − 23 = 0.2; “warm” 27 − 22/6 = 0.83; “hot” 0 (starts only at 30 °C). Humidity 60 %: “dry” 0 (ends at 50 %), “humid” 60 − 40/30 = 0.67.

Step 2 — firing strengths. “Or” inside a condition is computed by the dual t-conorm, “and” between conditions by the t-norm:

RuleMemberships in the conditionα with minimumα with product
R10.00 or 0.200.200.20
R20.83 and 0.000.000.00
R30.83 and 0.670.670.56
R40.000.000.00

For example R3 with the product: 5/6 · 2/3 = 10/18 ≈ 0.56; R1 with the maximum: max(0, 0.2) = 0.2. (Colours as in the formula of the resulting set above: the firing strength αr.)

Step 3 — clipping and combining. The value of the output set at a few points, μ(y) = max(min(0.2, μslow(y)), min(0.67, μfast(y))) — R2 and R4 have strength 0 and add nothing (colours as in the formula above):

speed y (%)10405060708090
μslow(y)1.000.200.000.000.000.000.00
μfast(y)0.000.000.000.200.601.001.00
μ(y), minimum0.200.200.000.200.600.670.67
μ(y), product0.200.040.000.110.330.560.56

For example at y = 70: “fast” holds there to degree 70 − 55/80 − 55 = 0.6, which is less than the strength 0.67, so clipping changes nothing and μ(70) = 0.6. At y = 90 “fast” holds fully (1) and clipping brings it down to 0.67. Speeds between 45 and 55 % are recommended by no rule.

def sila(podminky, vstup, t_norma=min):
    hodnoty = []
    for promenna, terminy in podminky:          # terms joined by “or”
        hodnoty.append(max(mu[promenna][t](vstup[promenna]) for t in terminy))
    vysledek = 1.0
    for h in hodnoty:                           # conditions joined by “and”
        vysledek = t_norma(vysledek, h)
    return vysledek

def vystup(pravidla, vstup, y):
    return max(min(sila(r.kdyz, vstup), mu_otacky[r.pak](y)) for r in pravidla)

7. Fuzzy logic and today’s AI

  • Logic you can differentiate. T-norms are continuous, so they can be differentiated. Neurosymbolic approaches such as Logic Tensor Networks build a loss function out of them: the network learns not only from examples but also from rules like “every dog is a mammal”, whose truth is computed with fuzzy connectives.
  • Soft constraints. Probabilistic Soft Logic uses Łukasiewicz connectives to write weighted rules — for example for recommendation or for linking records about the same person.
  • Readable decisions. Fuzzy rules are short and easy to understand. Where people have to check the decision-making, they are still used as an explainable alternative to a black box.

8. Summary

  • In fuzzy logic statements have a truth value in [0, 1]; connectives are functions on these values.
  • “And” is a t-norm — minimum, product, Łukasiewicz and others; all of them lie between the drastic t-norm and the minimum.
  • “Or” is the dual t-conorm, “not” is by default 1 − a; De Morgan’s laws always hold, the other laws depend on the choice of t-norm.
  • The residual implication preserves modus ponens; formal fuzzy logics are built on it.
  • IF–THEN rules are evaluated by the strength of the condition, by clipping or scaling the conclusion and by combining with the maximum — for the fan at 27 °C and 60 %, R1 fires with strength 0.2 and R3 with strength 0.67.

Want to get your hands on it? Have an AI agent write the table of laws from this part for other t-norms — say the Hamacher or Frank family — and find out which one comes closest to classical logic.

Do you see it differently? Write to support@coden-app.com.

An Agent on your computer, driven from your phone