Lawrence J. Thaden
Registered: Jan 2004
Posts: 355 
Three Color Three Variable CAs
The logic engine for these CAs is the three variable equivalent of the two variable logic posted previously. It is an extension of Boolean logic to three values (colors). They are { 1, 0, 1}. It has all the properties of Boolean algebra, and is supported by a general mapping function. The mapping function is used to update the cell by using the rule as the function with three inputs: left neighbor, cell, and right neighbor. It returns the updated value of the cell.
The rule space for this logic is the range 0 through 7625597484986. This is the space referenced in the NKS book on page 60. However this logic allows the updated cell to have any value in the rule space compared to Wolfram’s CAs, which limit possible update values to the three colors.
Here is the mapping function:
map[operation_, operand1_, operand2_, operand3_] : =
FromDigits[Reverse[IntegerDigits[operation, 3, 27]] [[ Dot[MapThread[List, {IntegerDigits[operand3, 3, 27], IntegerDigits[operand2, 3, 27], IntegerDigits[operand1, 3, 27]}], {3 ^0, 3 ^1, 3 ^2}] + 1 ]], 3]
Changes to this mapping function from the one posted previously for three color, two variable CAs are as follows:
(1) Added operand3 for the third variable.
(2) Corrected the order of the operands input to MapThread.
(3) Changed the number of digits from 9 to 27 to accommodate the additional minterms.
(4) Added 3^2 to the Dot product syntax because of the third variable.
All of the expressions from three color, two variable logic are included as a subset in this three color, three variable version. However, the rule numbers for these expressions have changed.
The only “surprise” I encountered was the new minterm.
For an explanation of how to find the expression that goes with a rule number see the attached notebook. In general the notebook gives an introduction to some of the features of three valued logic in three variables. But it is not intended as a formal presentation.
The main value of the notebook to NKS is support for finding the logic expressions for all of the rule numbers in this vast rule space.
Indeed the CellularAutomaton command generates totalistic rule number graphs faster than this code. So it is preferred.
But the value of this notebook extends well beyond NKS to include contributions to traditional work in Boolean logic.
In the notebook I use Richard Philips NiceCaptionedRaster to generate the graphs. However, I notice that it sometimes clips the output from CellularAutomaton so that the label does not show completely, and the graph is left justified. An example of this is included at the end of the notebook.
Please! Feedback is important. Let’s explore the space.
Attachment: three color three variable.nb
This has been downloaded 3080 time(s).
__________________
L. J. Thaden
Report this post to a moderator  IP: Logged
