Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's odd the page doesn't mention SQL which uses a 3-valued logic. The 3VL page itself does:

https://en.wikipedia.org/wiki/Three-valued_logic#SQL



Hm. Most of the limited amount I ever knew about this I've forgotten atm, but in the face of general misunderstanding I'm going to chance my arm on the theory that I have a >50% chance of making things better rather than worse. Here goes.

Usually, in philosophical logic, you don't use 3VL or any multi-valued logic to deal with something being unknown. If you don't know whether the proposition P is true or false, and so you don't want to assert either that it is true or that it is false, then you do this simply by not asserting or implying P while also not asserting or implying ~P. If you want a logic in which you can actually make the statement "it is unknown whether P or ~P" (or more precisely, a logic in which you can capture the structure of that statement: you could always just define the proposition Q to mean "it is unknown whether P or ~P", but that probably doesn't get you anything useful) then you'd probably use some variation on modal logic https://en.wikipedia.org/wiki/Epistemic_modal_logic , not a 3VL. What logicians actually normally use 3VLs for is to (try to) deal with truth value gaps or gluts. In a logic with truth-value gluts P can be both true and false at the same time. In a logic with truth-value gaps P can be neither true nor false, at the same time. I know right? (Intuitionistic logic is something a bit different again.)

The reason that computer systems like SQL use a third truth-value which sometimes(!) means 'unknown', is, to summarise, because the way those systems handle truth and implication is a garbage fire.


Oh, you'd be in good company, if for (likely) somewhat different reasons. Google up 'C.J. Date' and '3VL' for some expert ranting on the topic.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: