rdf

Relative Truth, Three-Valued Logic, and One Reason Why SQL Sucks

The TRUE (FALSE) Ritual

In order to accomodate nulls, the SQL Standard relies on a logic with three values: TRUE, FALSE, and UNKNOWN. With modifications, however, the same thought experiment that shows the underlying confusion behind the notion that all truths are relative also shows the inadequacy of using a TRUE/FALSE/UNKNOWN 3-valued logic to resolve the problems created by nulls. I will elaborate on this thought experiment in this section. Then in the next section, I will show that the TRUE-FALSE-UNKNOWN 3-valued logic not only fails to resolve the problem of nulls, in some circumstances it makes those problems considerably worse -- train-crash-awfully worse -- because it is only covering up, not actually resolving a failure. I will also start suggesting that SQL is perhaps a somewhat blunt instrument of formal thought and really does need to be replaced by something better.

Let's revisit the thought experiment. L., the character1 I introduce here, is standing in the arena of a certain town and is facing two doors, marked A and B. One billion dollars in platinum bars lies behind one of the doors, and a very hungry man-eating tiger is behind the other. No entity in the universe (except perhaps the tiger) knows which is behind which door, nor has any belief about which door is which (let's say that all participants are rational at least to the extent that they refuse to hold which-door-is-which beliefs without any evidence) -- least of all L. Nonetheless, L. is required to utter either the sentence "The treasure is behind door A and the tiger is behind door B," or the converse sentence "The treasure is behind door B, and the tiger is behind door A." Depending upon which door L. says the treasure is behind, a door operator will work a device that will open door A or door B, respectively. L. will then either be richer by one billion dollars, or he will serve as Fancy Feast for the tiger. In the context of discussing truth, the point of the thought experiment is to show that a statement that p can be either true or false in the absence of any belief (and a fortiori any knowledge) that p. This point is, I hope, stunningly obvious, but it blocks at least one route (and perhaps any route) to the claim that all truths are relative.

The door operator is performing a certain action, namely, evaluating the truth value of L.'s statement. (Henceforth I will call the door operator the 'truth-value-evaluating operator' and his action the 'truth-evaluating operation.' {The RDF file linked to above defines the relevant terms. Of course, the file is mainly for the benefit of the machine; but if her browser can deal with the RDF serialized as XML, the human reader might gain some benefit from it as well.] ) If L. gets the billion dollars in platinum, his statement has evaluated to TRUE; if he is eaten by the tiger, his statement has evaluated to FALSE.2 This truth-value-evaluating operation is critically important for the town, and has become a yearly ritual the performance of which stretches back for thousands of years.

For reasons that completely baffle everone (including me, and I am the one concocting this thought experiment), there is some mysterious linkage between L.'s statement and the success or failure of the town's crops that year. The town has been performing this ritual for thousands of years now, and every time L. (or whoever is the possible sacrificial victim that year) says that the tiger is behind door A (alternatively, B) and the tiger is in fact behind door B (alternatively, A) -- in short, L.'s statement happens to be false -- then the crops will succeed. If the tiger happens to be behind door A (alternatively, B) -- in short, L.'s statement happens to be true -- then the crops will fail that year, and townspeople will need to start negotiating contracts for delivery of wheat and corn from Iowa, Nebraska, and Kansas. So as soon as L. utters his statement on the fly, the fact that the tiger is behind door B (A) -- whichever door it happens to be -- and the fact that it is door B (A) that opens together carry a huge weight, and is critically important for the town to know.3

The truth-value evaluating operator's action is something that aims at a certain successful outcome. If the truth value of L.'s statement -- TRUE or FALSE -- comes to light, the action has succeeded. If something happens to keep the truth value of L.'s statement from coming to light -- say, bad wiring in the device which is supposed to open a door, or one of the door's jamming -- the action has failed. Let's say that about one year out of fifteen (the ritual is conducted once a year -- often with a different person of course serving as the official utterer, the reason for the difference possibly being tiger-related attrition, possibly other-related attrition), the truth-value-evaluating action fails.

Since the success of the truth-evaluating action is important to the community, some way must be found to deal with failure when it happens. So -- to make the final addition to my thought experiment -- let's say that the town has a Sacred Logician, who claims he has received word from the Heavens that the most suitable logic to use for the ritual is not the standard 2-valued TRUE/FALSE logic, but a 3-valued logic whose truth values are TRUE, FALSE, and UNKNOWN. When the door jams and the truth-value-evaluation operation fails, the Sacred Logician officially declares that the truth-value-evaluation operation has generated the value UNKNOWN. This way the truth-value-evaluating operation can never fail -- its success is guaranteed.

Of course, an assorted group of free-thinkers, skeptics, and heretics in the town protest never failing in this way is like using the following ploy to never fail to hit the bulls-eye in an archery contest: when one's arrow lands ten feet away from the bulls-eye, one simply paints a new bulls-eye around the arrow and declares that he has hit the bulls-eye. Certainly in that way one never fails. But of course this "success" is completely empty; all one has done is define away failure in a way that completely misses the point of the game. The point of the archery contest is to hit the ORIGINAL bulls-eye. The point of the truth-value-evaluating operation is to uncover a fact that one can reliably use to predict whether the crops will fail this year and to take the appropriate action. When the Sacred Logician says that the truth-value-evaluating operation has generated the truth value UNKNOWN, one is still completely in the dark about how things stand in the tiger-behind-doors line of business. If the truth-value-evaluating operation has not uncovered the fact about the tiger, it has failed. We don't yet have a truth value for L.'s statement.

To state the point in a slightly different way, continue the free-thinkers, skeptics, and heretics, the point of the truth-value-evaluating operation is to uncover a truth value. Before the operation starts, L.'s statement has the status UNKNOWN for the townspeople. When the truth-value-evaluating operation is attempted and the relevant door jams, L.'s statement still has the status UNKNOWN for the townspeople. How, then, can the operation be said to have uncovered anything, much less a truth value?

Some of the more scholastically inclined among the free-thinkers, skeptics, and heretics make a distinction between truth values and knowledge values: when we discover that a person does not know that, say, the tiger is behind door B, we discover something about that person. We find out that his brain is virgin territory with regard to tigers and which doors they are lurking behind. But when we uncover the truth value of a statement about the tiger and the doors, we uncover a fact about the tiger and the doors. So if we have not uncovered a fact about the tigers and the doors, we have not uncovered the truth value of the tiger-and-door statement. So yes, our truth-value-evaluating operation can fail. So no, UNKNOWN is not a truth value.4 Rather than trying to shove it in with the truth values TRUE (FALSE), we should recognize it as one of a pair of knowledge values: KNOWN (UNKNOWN).

What is more, say the free-thinkers, skeptics, and heretics, we already know that L.'s statement p is either true or false even though he has no belief that p, and a fortiori no knowledge that p. Since the statement already has a truth value (albeit one that is presently uncovered), why add one more to it? That a statement can have more than a single truth value at any given time is highly counter-intuitive. If we want to maintain the TRUE-FALSE-UNKNOWN 3-valued logic but also maintain that a statement can have only a single truth value at a time, we would have to say (very counter-intuitively!) that the statement can be true only when known to be true, and false only when known to be false. Since knowing that p is a species of belief (let's say for the moment that knowledge consists in true beliefs that are caused by the interaction of our brains with a sufficiently reliable channel of information), we would have to deny that L's statement is either true or false before the relevant door is opened. And to deny this is to demolish at least one refutation of the silly claim that all truths are relative. The refutation of the 'all truths are relative' claim works by teasing apart two orthogonal concepts, truth and belief, which the relativist L. had mushed together. Now the Sacred Logician wants to mush them together one more time.

That proper subset of Greek scholars among the epistemologists who constitute a proper subset of the free-thinkers, skeptics, and heretics put it this way: we need to distinguish between the doxastic/epistemic (belief and knowledge) realm and the aletheic (truth) realm. Episteme and Doxa are related: to know that p, it is necessary that p be true; so beliefs that count as knowledge constitute a proper subset of beliefs in general. The concept of knowledge depends upon the concept of truth. The converse, however, is not true; as the thought experiment shows, to be true that p does not depend upon the belief that p, and therefore does not depend upon knowing that p. To evaluate the truth value of L.'s statement is to know that fact that makes that statement true (false); but the statement can be true (false) without the truth-value-evaluating operation ever taking place.

The proper subset comprising the assembling-toys-out-of-small-plastic-components-meant-to-snap-together-into-a-close-fit enthusiasts in the above subset put it this way: trying to add UNKNOWN to the truth values TRUE and FALSE is like trying to snap into place a plastic part that yes, does look kind of similar to the parts one is trying to fit it into, but no, it really, truly does not fit and no amount of forcing will ever make that particular assembly an especially happy one.

Finally, say some of the more computer-science/computer-arts-oriented free-thinkers etc., rather than trying to cover up, trying to define away, the failure of the truth-value-evaluating operation by pretending we have generated a third truth value, UNKNOWN, we should simply acknowledge the failure by flashing an error message on a screen as if it were a computer program. Maybe we can fix the error and maybe we cannot; but even if we cannot, we at least have the information that we are fucked (that is, we do not know whether we need to start negotiating grain prices), and that information is more ... adaptive ... let's say, than pretending a failure did not occur.5

The Sacred Logician is not pleased. After he exiles a few of these free-thinkers, burns a few others at the stake, and accuses others of siding with the terrorists, these voices fall silent.6

However, there is still a problem. UNKNOWN means the town still does not know whether the crops will succeed or not. No one knows whether or not to start negotiating grain prices or whether to count on the crop succeeding. Nonetheless, the town still has to DO something.

The Sacred Logician has another bright idea. When the truth-value-evaluation operation fails ... er, I mean (glancing quickly behind my back after having said that) ... generates the truth value UNKNOWN ... then depending on some factor completely independent of the truth or falsity of L.'s statement -- say, how high the sun happens to be in the sky, or what the price of salt is in the marketplace happens to be at the moment, or the fact that UNKNOWN is a negative just like FALSE so most of the time we'll treat UNKNOWN as having the same effect as FALSE -- the Sacred Logician holds up a picture of L. being eaten by the tiger to signal that UNKNOWN here has the effect of FALSE, or holds up a picture of L. receiving a number of gleaming platinum bars to signal that UNKNOWN now has the effect of TRUE. How UNKNOWN gets interpreted may seem a bit ad hoc to the community, but at least they now have a method of deciding which eventuality to prepare for (crops succeeding, or crops failing); they won't be like Buridan's mule, starving to death because it has no way of choosing one pile of hay rather than the exactly-similar other pile to eat.

Of course, the ritual is less than 100% reliable in predicting the success or failure of the year's crop. Every now and then, the community experiences a terrible failure because the ritual failed to produce the correct prediction when the generated truth value was UNKNOWN. Nonetheless, the solution to the door jamming problem seemed to work well enough most of the time. "The poor will always be with us," solemnly intones the Sacred Logician. " Just so, door jams will always be with us. We cannot be theoretical purists and pretend we can ever eliminate door jams from our ritual. Rather, we must be pragmatists who recognize we will never find a solution that works 100%."




Next



And yes, L. is indeed a character.
Myself, I am rooting for the tiger, but of course I am only saying this out of pure envy.
Object to my Fantasy/Science-Fiction like thought experiments? Lighten up! Read this, this, and this in Carol Berg's wonderful Rai-Kirah series; and certainly read Philip Pullman's trilogy His Dark Materials. Then complain, if you want to.
Compare with C.J. Date, Logic And Databases: The Roots of Relational Theory, p. 102.
This is not to say that all greater-than-2-valued logics are incoherent. Perhaps a logic based on degrees of membership in a set may be valid, though I suspect that such a logic would not resolve the problem that nulls pose for SQL.
One can observe one of these free-thinkers etc. ceaselessly beating his head against his work table at work on the fifth floor of a certain building in a certain downtown. This person has clearly gone insane. However, it is unclear whether he has gone insane because of the Sacred Logician's persecutions, or because he sits too close to L.