Thursday, September 20, 2007

Simple Logic Machines

Babbage's Analytical Engine started me thinking about simple (very simple, since I have no great mechanical imagination) logic machines. For instance, one could have a tool for propositional logic consisting of a rod on which seventeen wheels had been placed, and each of the wheels was engraved on four sides (which we can call, N, E, S, W) with the full truth table. This rod could then be put in a casing in which the wheels associated with v, &, etc., would be identified. The following table gives standard symbol on the left and common name on the right (these would be marked on the casing) and the truth values on the wheels (N, E, S, W in each case):



















pq[TT, TF, FT, FF]
   
&[T, F, F, F]AND
v[T, T, T, F]OR
[T, F, T, T]IF-THEN
[T, F, F, T]IFF/XNOR
¬&[F, T, T, T]NAND
¬v[F, F, F, T]NOR
¬→[F, T, F, F]
¬↔[F, T, T, F]XOR
   
[T, T, T, T]
[F, F, F, F]
   
[T, T, F, T]
[F, F, T, T]
[T, T, F, F]
[T, F, T, F]
[F, T, F, T]
[F, F, T, F]


As I said, this works because it's basically a complete truth table for pq put on a cylinder. Finely done, it need not be bulkier than a big pen (it would make a good gift for philosophy and computer science students). With more than two letters this method becomes unwieldy. Perhaps you could adapt the Jevons Logic Piano for such cases?

One thing I've introduced my intro students to is Lewis Carroll's Game of Logic, which is, in effect, a primitive logic machine for handling categorical syllogisms. It consists of two diagrams, a Triliteral Diagram and a Biliteral Diagram, which are both essentially Venn Diagrams modified into squares and placed on a sort of game board. You then represent premises on the Triliteral Diagram using counters to indicate presence and absence (Carroll used red for presence and grey for absence), transfer information about the quarters of the diagram to the Biliteral Diagram, and read off the possible conclusions. One of the advantage Carroll Diagrams have over the more popular Venn Diagrams is that Venn Diagrams for more than three letters become very unwieldy -- even to get four letters you have to switch from circles to ellipses, and beyond that the geometries get strange and the diagrams hard to read. Carroll Diagrams can be adapted to handle a much larger number of terms; in his Symbolic Logic, Carroll gives an example of an Octoliteral Diagram, which can handle groups of premises with eight terms all told. (And to handle nine terms, you can use two Octoliteral Diagrams; to handle ten terms, you can use four; etc.) The Diagrams are usable at a much greater degree of complexity than you could ever get with Venn Diagrams (which is one reason why we should use Venn Diagrams less often and Carroll's Literal Diagrams more often).

An application of Carroll Diagrams that I don't think has been considered before is propositional logic. It would work exactly the same way; as Englebretsen and others have noted, p → q is logically exactly like 'All x are y' if we make the assumption of a singleton universe. (I.e., 'p → q' should be interpreted as something like, "All the world being such that p is the world being such that q.") p & q is like 'Some p is q'. Disjunction is more complicated but can be handled as well. Of course, we don't need to translate from propositional logic to categorical logic in order to use Carroll Diagrams for the former; it's intuitive enough once one learns how to represent the connectives on the board, although it is sometimes slightly harder to read than in the categorical case. It's very easy to handle hypothetical syllogisms (including modus ponens and modus tollens) and disjunctive syllogisms this way. But you can also handle a number of other introduction and elimination rules. (Incidentally, it is noteworthy, given my recent post on disjunction, that while disjunction introduction is easily represented in a natural way, that representation is different from the way to represent disjunction to make the disjunctive syllogism possible. So this can be taken as an independent confirmation of my argument in that post.)