At the University of Kansas in 1976, basic Boolean logic in the CS/Engineering department was "Yes", "No", and "Don't Care". You'd get dinged in your projects if you didn't properly allow for the "Don't Care" conditions.
One use case is comparing values. Suppose you have an 8-bit value, and you want to do something if bits 7, 6 and 3 are true, and bit 5 is false. Which is clearer and easier to understand:
x & x & !x & x
(x & 11101000) == 11001000
x == 110?1???
In modern logic design, boolean logic can have 4 values, false, true, and two kinds of "I don't know," typically denoted by the enumerated values 0, 1, X and Z. X means "I can't figure out what the value is," either because variable was never initialized, or the state is (possibly) invalid, e.g., the logic is powered-down or a timing error occurred that could put a device into a metastable state, or because one of the devices inputs is unknown. Z is essentially a special kind of unknown that means "no device is driving this signal," which turns into an X when it goes through any kind of logic gate. Zs (and the resulting Xs) are expected and often necessary on any kind of half-duplex bi-directional bus (where one device asks another for data, and the other device sends the data back on the same wires) or removable device. (It is possible to avoid the Z case by pulling the wires to a valid logic level, but at the expense of higher power, which is not acceptable in a lot of applications.)
Yes for instance, if the reset pin on a J-K-flip-flop is pulled low and the set pin is kept high, then the state of the j,k and CP inputs really does not matter, as the state of the output (Q and not-Q) are solely determined by the reset and set pins
Why have a boolean if you didn't care what it was?
It's important because fully specifying the output for all possible inputs (including illegal ones) can add cost to a project.
Take, for example, a project to design an encoder for rendering decimal digits on a 7-segment LCD (a common homework assignment in beginning digital design classes.) You'll probably start by writing up a truth table that lists all the possible values of the input wires (0..15, because you need 4 wires to represent the numbers 0..9) on separate rows, and a column for each of the display's 7 segments. For each column for rows 0..9, the value can be true (meaning the segment is lit) or false (meaning it is not lit.) But what about rows 10..15? For those, the output columns should be "don't care". The circuit you produce is going to generate some output for those values, but since they're illegal inputs, you don't care about the output.
When you generate the Boolean equations (and the logic-gate circuits) for driving each segment, you can assume either true or false for the don't-care values and should pick the one that minimizes the number of operators (and therefore gates) that will be used. The result will be a circuit that is simpler than what you would get had you specified values for all of the illegal inputs.
This, BTW, is why some early microprocessors had undocumented instructions. These were often the result of don't-care conditions in the processor's design. Usually, these instructions were useless (repeating some other instruction's behavior or crashing or otherwise taking no useful action), but there were occasionally some useful ones. Of course, because they were not part of the design, future optimizations/revisions of the chip would sometimes eliminate or change the behavior of these instructions, so use in software was usually a bad idea.
Tri-state (and multi-state) logics - of which there are several - can be quite useful, but they are quite different from Boolean logic. Boolean logic in multiple variables can always be substituted for multi-state logics (or any other finite discrete value domain, for that matter), but not fuzzy logics, which are continuous, or quantum logics, which can have superposition. There are definitely cases where having a single inferential value be multi-state is useful, such as in relational calculus, however, and multi-state values are often valuable for encoding information being transmitted across a medium with multiple phases (such as the use of simultaneous amplitude, frequency and phase encodings to increase the effective bandwidth of an optical fiber).
Yeah obvious nonsense. No-one would ever put a third value in a boolean field, like NULL.
Well, if you're dealing with some kind of cascading properties, then any property may be in an "unconfigured" state in addition to a specific value (which could be Boolean). The precise meaning of "unconfigured" would depend on the application - it might mean that a default value (constant or computed) should be used, or that a value should be inherited from a parent object, or it could have some other application-specific meaning.
Whether you would call "unconfigured" a separate value for the property (e.g. a so-called 3-state "boolean") or an independent property is really a meaningless discussion. There are many possible ways to represent the concept in code, all of which (should) have the same effect at the user interface level.
Z is essentially a special kind of unknown that means "no device is driving this signal," which turns into an X when it goes through any kind of logic gate.
It's useful because when you're describing the behaviour of a device that's driving a bus line, you can either force the bus low or force it high, but you can also leave it alone (by switching the transistors that drive it either way off), and when you've got several places that can drive the same place, you only want one of them to drive the bus at a time. (Two things driving it in the same direction wouldn't be too bad I suppose, but two in the opposite directions Would Be Bad, as it would let the magic smoke out, so it's easier to just think in terms of explicitly producing Z.)
Boolean logic is useful in other ways, however, as it was one of the key components of finally working out which were the sound syllogisms, and which were ill-founded. This went a long way towards setting much of what had classically been considered to be philosophy on a surer footing, and in the process it became a field of mathematics. The philosophers went off in a huff to ponder the meanings of intelligence and reality, and promptly achieved nothing much of consequence for a century or more. :smiling_imp: