by adrian_b · 6mo ago · 0 comments
The innovation brought by George Boole to logic was that he replaced the traditional logical values "true" and "false" with the numbers "1" and "0" and he identified the traditional logical operations with special cases of arithmetic operations.
This allowed him to view certain forms of logical reasoning as solvable by a kind of mechanical computation. Because of this, his work had an important influence on the development of automatic computers.
The modern fashion in computing science of calling a data type with the values "true" and "false" as "Boolean" is a misnomer that has nothing to do with George Boole, and which has its origin in the ALGOL 60 report and in its preliminary variants, which misused the term "Boolean". The IBM FORTRAN IV language did better than ALGOL 60, by calling the data type with "true" and "false" values as "logical", not "Boolean", but unfortunately most later languages used the ALGOL 60 term, not the FORTRAN IV term.
An example of a programming language with true Boolean logic is APL, where the logical truth values are the numbers "1" and "0" (which is very handy in expressing conditional operations on arrays), while all the programming languages that use "true" and "false" do not use Boolean logic, despite claiming to do so.
I agree with TFA that for dealing with most practical situations binary logic is insufficient and ternary logic is the minimal tool, if not using even more complex kinds of logic, like modal logic or probabilistic logic.
So Bash could be considered the red-headed, left-handed sibling to APL?
In APL and similar languages, applying a relational operator to a combination of vectors, matrices or other kinds of arrays will produce an array of "0" or "1" values, which can then be used in various kinds of array multiplications to select a part of the elements of an array for some kind of operation, e.g. a reduction operation.
This is just a reuse of the notation for arithmetic operations, useful to minimize the number of distinct operator symbols, because a good compiler will not do multiplications by "1" or "0", but it will use SIMD masked operations or blend instructions or conditional move instructions in order to get the same result.