|
In one respect, boolean logic is popular because of bits. If we had ternary processors, ternary logic would be more popular. In another respect, boolean logic is popular because it's easy to reason about. The truth tables are relatively small in size and quantity. Not the case with ternary. Ternary is probably way better at modeling the real world, but the complexity could make code hard to understand. Maybe that can be solved. That said, boolean logic is more expressive than I think the blog post gives it credit for because it's usually only a part of the code. Like, it gets used a lot in SQL, where you're reasoning about with several columns. So, yeah, it's binary thinking on each dimension, but there are N dimensions. The alternative presented is intuitionist logic, which is practically what in the computing world? Where is it used? Or where could or should it be used? I guess it can be represented in lamba calculus... |
The Curry-Howard correspondence[1] tells us that every function is a proof (in the intuitionistic sense) of the proposition represented by its return type, given the axioms ("context" in the article) represented by its arguments.
This fact is leveraged heavily by proof assistants (as mentioned in the article), but is generally useful in any statically-typed programming language.
[1]: https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon...