Many-Valued and Fuzzy Logic Explained
Meet logics with more than two truth values, from three-valued tables to fuzzy degrees of truth, with worked numbers and caveats.
Key takeaways
- Classical logic has two truth values, while many-valued logics have three, finitely many, or infinitely many.
- In common three-valued and fuzzy systems, "P or not P" need not be fully true.
- Standard fuzzy operators are minimum for "and", maximum for "or" and one minus the value for "not", though other choices exist.
- A degree of truth measures how well a description fits, which is a different thing from the probability that an event occurs.
A many-valued logic allows statements to take values besides plain true and false. Some add a third value such as "unknown" or "undetermined". Fuzzy logic goes further and lets truth come in degrees, usually any number from 0 (fully false) to 1 (fully true).
These systems are ordinary, precise mathematics. What changes is the set of truth values and the rules for combining them, and as a result some laws you may take for granted stop holding.
Why leave two values behind
Classical logic, described in propositional logic and truth tables, assumes bivalence: every proposition is either true or false. That assumption works well for arithmetic. Several situations strain it.
- Future events. Is "there will be a sea battle tomorrow" already true or false today? Aristotle raised a puzzle of this kind.
- Vagueness. How many grains make a heap? Removing one grain never seems to turn a heap into a non-heap, yet enough removals do.
- Missing information. A database may simply not know whether a customer has a phone.
- Unfinished computation. A test may never return an answer.
Whether any of these really requires new logic is debated. Some philosophers keep two values and say that for vague words there is a sharp boundary we cannot know. The many-valued approach is one serious option among several.
Three values
Jan Łukasiewicz, a Polish logician, introduced a three-valued logic around 1920, motivated partly by future events. Stephen Kleene later studied three-valued tables for computations that might not finish.
Use 1 for true, 0 for false and ½ for the third value. In Kleene's strong tables, and in Łukasiewicz's logic too, negation, "and" and "or" are:
not P = 1 − P
P and Q = the smaller of P and Q
P or Q = the larger of P and Q So "false and unknown" is false: whatever the unknown turns out to be, the conjunction fails. "True or unknown" is true. "True and unknown" remains unknown.
The two systems part ways at "if-then". Reading P → Q as "not P or Q", Kleene gives ½ → ½ the value ½. Łukasiewicz defines P → Q as the smaller of 1 and 1 − P + Q, so ½ → ½ equals 1. That keeps "if P then P" always true.
Laws that fail
Let P have the value ½. Then not P is ½ as well.
| Formula | Classical value | Value when P = ½ |
|---|---|---|
| P or not P | always 1 | ½ |
| P and not P | always 0 | ½ |
| not (not P) | same as P | ½, same as P |
| not (P and Q) vs. not P or not Q | equal | still equal |
The law of excluded middle and the law of non-contradiction are no longer guaranteed to be fully true and fully false. Meanwhile double negation and De Morgan's laws survive with these operators.
A logic must also say which values count as "good enough" for a valid conclusion. These are the designated values. Choosing only 1, or both 1 and ½, gives logics that endorse different arguments from the same tables.
Dropping excluded middle also happens in intuitionistic logic, but for a different reason, and that logic cannot be captured by any finite table of truth values.
The heap paradox with degrees
Degrees of truth give one way to analyze the heap. The argument says that 10,000 grains make a heap, and that if n grains make a heap, so do n − 1. Repeating the second premise leads to the claim that one grain is a heap.
Suppose each conditional "if n grains are a heap, then n − 1 grains are" is not fully true but extremely close to true. In Łukasiewicz logic, let the degree of "heap" fall by 0.0001 with each grain removed, starting at 1. Each conditional then has value 1 − 0.0001 = 0.9999. Every single step looks acceptable.
Yet the small shortfalls add up. After thousands of removals the degree of "this is a heap" has drifted down toward 0. The argument uses premises that are almost true, many times over, to reach a conclusion that is almost entirely false.
The linear fall of 0.0001 per grain is invented for illustration. Critics reply that no particular number is justified, and rival accounts of vagueness explain the paradox differently.
Null values in databases
A practical cousin appears in SQL, the common database language. A missing entry is marked NULL, and comparisons with it yield "unknown". A query keeps only the rows where the condition is true, so unknown rows are left out.
The result can surprise. Asking for rows where age < 30 and then for rows where age ≥ 30 will, between them, skip every row whose age is missing. Excluded middle has quietly failed. The remedy is to test for missing values explicitly.
Fuzzy sets and fuzzy logic
Lotfi Zadeh introduced fuzzy sets in 1965. In an ordinary set, an object is either a member or not, as in basic set theory. In a fuzzy set it has a membership degree between 0 and 1.
Here is a hypothetical definition of "warm" for a room, in degrees Celsius: membership 0 at 15 or below, 1 at 25 or above, rising in a straight line between.
warm(t) = (t − 15) / 10 for 15 ≤ t ≤ 25
warm(17) = 0.2
warm(21) = 0.6
warm(25) = 1 The shape is a design decision. A different engineer might pick other end points, and neither is wrong in the way a measurement can be wrong.
A made-up membership function rising from 15 to 25 degrees Celsius. Hypothetical example: the numbers are made up to show the method, not a quote or an average.
Combining degrees
Suppose a room is warm to degree 0.6 and humid to degree 0.3. With the standard choices:
- warm and humid = min(0.6, 0.3) = 0.3
- warm or humid = max(0.6, 0.3) = 0.6
- not warm = 1 − 0.6 = 0.4
- warm and not warm = min(0.6, 0.4) = 0.4
Minimum is not the only sensible "and". Mathematicians study a whole family called t-norms: operations on [0, 1] that are commutative, associative, increasing in each input and have 1 as an identity.
| t-norm | "and" of a and b | with a = 0.6, b = 0.3 |
|---|---|---|
| Minimum (Gödel) | min(a, b) | 0.3 |
| Product | a × b | 0.18 |
| Łukasiewicz | max(0, a + b − 1) | 0 |
All three agree with classical "and" when the inputs are 0 or 1. They disagree in between, and each leads to its own logic with its own matching "if-then". The study of these systems is often called mathematical fuzzy logic.
Fuzzy control
The best known applications are controllers. A fuzzy controller for a fan might have two rules: if the room is warm, run fast; if the room is not warm, run slowly. Say "fast" is represented by 80 percent power and "slow" by 20 percent, and the output is the average weighted by how strongly each rule applies. At 21 °C:
power = 0.6 × 80 + 0.4 × 20 = 48 + 8 = 56 percent The output changes smoothly with temperature, with no jump at a threshold. Controllers of this kind have been used in appliances and industrial equipment. Many other methods can also give smooth control, so the appeal is often that the rules are easy to state and adjust.
Truth degrees are not probabilities
Saying a glass of water is "full to degree 0.5" describes a glass you can see completely. Saying there is a 0.5 probability that a hidden glass is full describes uncertainty: once you look, it is either full or not.
The arithmetic differs as well. The probability of "A and not A" is always 0, while min(a, 1 − a) can be as large as 0.5. And the probability of "A and B" is not determined by the probabilities of A and B alone, whereas the fuzzy value is computed directly from the two degrees. For the probability side, see what probability means.
Other kinds of extra value
Not every third value means "in between". Some logics use it for both true and false, to reason with conflicting information without letting a single clash imply everything. Such systems are called paraconsistent. Think of two records that disagree about a delivery date: you would like to keep drawing sensible conclusions about the price.
Nuel Belnap proposed a four-valued scheme with a computer's knowledge in mind: told true, told false, told both, or told nothing. In each case the values describe the state of the information, and the connective tables are chosen to suit that reading.
What these logics do not do
Many-valued logics do not make reasoning sloppy: the metamathematics about them is usually carried out with ordinary two-valued proof. They also do not automatically solve vagueness. With degrees, one can still ask where exactly 0.6 comes from, and whether there is a sharp point where a description stops being fully true. Theorists keep arguing about these questions.
Treat the choice of logic like the choice of a model. Say what the values mean, check which familiar laws still hold, and test the conclusions on cases where you already know the sensible answer.