# More Of The Same, With A Twist

### Function Parses and Operators

The previous section ended with the truth table for a generalized logical function.

$$
\begin{array}{c|c}
\left(\textbf{A}^n\right)_\text{CV} & \left(\textbf{A}^n\right)_\alpha \\
\hline 0 & \alpha_0 \\ 1 & \alpha_1 \\
\vdots & \vdots \\
2^n-2 & \alpha_{2^n-2} \\
2^n-1 & \alpha_{2^n-1}
\end{array}
$$

In this example, the output values for $\alpha$ are represented by 2-value variables indexed by the condition values that produce them. I call these variables **parses**. They act like any other two-valued variable, but they are understood to represent a function's output values.

Let's look again at the conditional, $A\land B$, from the previous section, and compare it to the logical function $(A,B)_\alpha$.

$$
\begin{array}{c|c|c|c} A & B & A\land B & (A,B)_\alpha \\
\hline 0 & 0 & 0 & \alpha_\mathtt{0x0} \\
1 & 0 & 0 & \alpha_\mathtt{0x1} \\
0 & 1 & 0 & \alpha_\mathtt{0x2} \\
1 & 1 & 1 & \alpha_\mathtt{0x3}
\end{array}
$$

If $A\land B$ and $(A,B)_\alpha$ are to return the same value, for all condition values of $(A,B)$ $\alpha_\mathtt{0x0}$, $\alpha_\mathtt{0x1}$, and $\alpha_\mathtt{0x2}$ must equal zero and $\alpha_\mathtt{0x3}$ must be one. In this way the condition value $(\alpha_\mathtt{0x0},\alpha_\mathtt{0x1},\alpha_\mathtt{0x2},\alpha_\mathtt{0x3})_\text{CV}=\mathtt{0x8}$ directly implies $\alpha$ is a conjunction.

Coming back to the generalized form of a logical function, $(\textbf{A}^n)_\alpha$, it can be said that any condition value of all $\alpha$'s parses will describe a unique logical function. Since each parse of $\alpha$ represents that function's output, for some condition values, of $(\textbf{A}^n)$, a condition value of $\alpha$'s parses can only produce a unique logical function. In the notation I use, condition values of a function's parses are called **operators**. Much like parses are variables associated with a function, operators are condition values that describe a function.

### Notation

**Parse:** A parse is a two-valued variable that represents the output of a logical function for a given input condition value. Parses are typically written as the function's name followed by a subscript of the condition value that produces it. So, the parse of $(A,B)_\alpha$ where $(A,B)_\text{CV}=\mathtt{0x2}$ is $\alpha_\mathtt{0x2}$.

$$
\left.(A,B)_\alpha\right|_{(A,B)_\text{CV}=\mathtt{0x2}}=\alpha_\mathtt{0x2}
$$

**Domain of Parses:** The domain of a function's parse is very much as it sounds, a domain containing all parses of logical function, in numerical order by condition value. More often than not I will identify a domain of parses by placing the function's name under a vector line, followed by a superscript indicating the number of parses the function has. So, given the function $(A,B)_\alpha$, the domain of $\alpha$'s parses is:

$$
\vec{\alpha}^4=(\alpha_\mathtt{0x0},\alpha_\mathtt{0x1},\alpha_\mathtt{0x2},\alpha_\mathtt{0x3})
$$

**Operator:** An operator is a condition value of a function's domain of parses. Like any condition value, operators can be written as hexadecimal integers. Further, if a logical function has a fixed operator I will write that operator in place of the function's name. In that way, the conjunction above can be written as:

$$
A\land B=(A,B)_\mathtt{0x8}
$$

### Common Logical Functions

**Negation:** Negation is a unary function that returns the opposite value to that of the input variable.

$$
\begin{array}{cc}
\begin{array}{c|c|c}
A & \neg A & (A)_\alpha \\
\hline
0 & 1 & \alpha_\mathtt{0x0} \\
1 & 0 & \alpha_\mathtt{0x1}
\end{array} &
\neg A=(A)_\mathtt{0x1}
\end{array}
$$

**Joint Denial:** Joint denial is a binary function that only returns one when both input variables equal zero.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c}
A & B & A\downarrow B & (A,B)_\alpha \\
\hline
0 & 0 & 1 & \alpha_\mathtt{0x0} \\
1 & 0 & 0 & \alpha_\mathtt{0x1} \\
0 & 1 & 0 & \alpha_\mathtt{0x2} \\
1 & 1 & 0 & \alpha_\mathtt{0x3}
\end{array} &
A\downarrow B=(A,B)_\mathtt{0x1}
\end{array}
$$

**Exclusive Disjunction:** The exclusive disjunction is most commonly called an exclusive OR, or XOR. This binary function returns one when the two input values are different.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c}
A & B & A\oplus B & (A,B)_\alpha \\
\hline
0 & 0 & 0 & \alpha_\mathtt{0x0} \\
1 & 0 & 1 & \alpha_\mathtt{0x1} \\
0 & 1 & 1 & \alpha_\mathtt{0x2} \\
1 & 1 & 0 & \alpha_\mathtt{0x3}
\end{array} &
A\oplus B=(A,B)_\mathtt{0x6}
\end{array}
$$

**Alternative Denial:** The alternative denial, in computer sciences, and electrical engineering, is called a NAND. A NAND is a binary function that returns one for all input condition values, except when both inputs equal to one.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c}
A & B & A|B & (A,B)_\alpha \\
\hline
0 & 0 & 1 & \alpha_\mathtt{0x0} \\
1 & 0 & 1 & \alpha_\mathtt{0x1} \\
0 & 1 & 1 & \alpha_\mathtt{0x2} \\
1 & 1 & 0 & \alpha_\mathtt{0x3}
\end{array} &
A|B=(A,B)_\mathtt{0x7}
\end{array}
$$

**Conjunction:** As we have seen, the conjunction (AND) is a binary function that returns one only when both input values are one.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c}
A & B & A\land B & (A,B)_\alpha \\
\hline
0 & 0 & 0 & \alpha_\mathtt{0x0} \\
1 & 0 & 0 & \alpha_\mathtt{0x1} \\
0 & 1 & 0 & \alpha_\mathtt{0x2} \\
1 & 1 & 1 & \alpha_\mathtt{0x3}
\end{array} &
A\land B=(A,B)_\mathtt{0x8}
\end{array}
$$

**Biconditional:** The biconditional is a binary function most commonly thought of as representing logical equivalence. This function returns one only when both input values are the same.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c}
A & B & A\Leftrightarrow B & (A,B)_\alpha \\
\hline
0 & 0 & 1 & \alpha_\mathtt{0x0} \\
1 & 0 & 0 & \alpha_\mathtt{0x1} \\
0 & 1 & 0 & \alpha_\mathtt{0x2} \\
1 & 1 & 1 & \alpha_\mathtt{0x3}
\end{array} &
A\Leftrightarrow B=(A,B)_\mathtt{0x9}
\end{array}
$$

**Conditional:** The conditional is an if...then statement. This is a binary function that returns one for every condition value, except when the first input value is one and the second input value is zero. Essentially, the conditional returns one for every condition value where ``if A then B'' is a true statement.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c}
A & B & A\Rightarrow B & (A,B)_\alpha \\
\hline
0 & 0 & 1 & \alpha_\mathtt{0x0} \\
1 & 0 & 0 & \alpha_\mathtt{0x1} \\
0 & 1 & 1 & \alpha_\mathtt{0x2} \\
1 & 1 & 1 & \alpha_\mathtt{0x3}
\end{array} &
A\Rightarrow B=(A,B)_\mathtt{0xD}
\end{array}
$$

**Disjunction:** A disjunction is an inclusive OR. This binary function returns one so long as at least one of its inputs is one.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c}
A & B & A\vee B & (A,B)_\alpha \\
\hline
0 & 0 & 0 & \alpha_\mathtt{0x0} \\
1 & 0 & 1 & \alpha_\mathtt{0x1} \\
0 & 1 & 1 & \alpha_\mathtt{0x2} \\
1 & 1 & 1 & \alpha_\mathtt{0x3}
\end{array} &
A\vee B=(A,B)_\mathtt{0xE}
\end{array}
$$

**Switch:** The switch is an if...then...else statement. I haven't come across this function in my books, so I named it myself. Similarly to the conditional, a switch returns one for where ever ``if A then B else C'' is true. To do this, whenever the first variable is zero the switch returns the value of the second variable, and when the first variable is one the switch returns the value of the third variable.
$$
\begin{array}{cc}
\begin{array}{c|c|c|c|c}
A & B & C & \begin{array}{l}
\text{if}(A)\{C\}\\\text{else}\{B\}
\end{array} & (A,B,C)_\alpha \\
\hline
0 & 0 & 0 & 0 & \alpha_\mathtt{0x0} \\
1 & 0 & 0 & 0 & \alpha_\mathtt{0x1} \\
0 & 1 & 0 & 1 & \alpha_\mathtt{0x2} \\
1 & 1 & 0 & 0 & \alpha_\mathtt{0x3} \\
0 & 0 & 1 & 0 & \alpha_\mathtt{0x4} \\
1 & 0 & 1 & 1 & \alpha_\mathtt{0x5} \\
0 & 1 & 1 & 1 & \alpha_\mathtt{0x6} \\
1 & 1 & 1 & 1 & \alpha_\mathtt{0x7}
\end{array} &
\begin{array}{l}
\text{if}(A)\{C\}\\\text{else}\{B\}
\end{array}
=(A,B,C)_\mathtt{0xE4}
\end{array}
$$

**Contradiction:** A contradiction is a function, with any number of inputs, that always returns zero.
$$
\begin{array}{cc}
\begin{array}{c|c|c}
(\textbf{A}^n)_\text{CV} & \perp & (\textbf{A}^n)_\alpha \\
\hline
\mathtt{0x0} & 0 & \alpha_\mathtt{0x0} \\
\mathtt{0x1} & 0 & \alpha_\mathtt{0x1} \\
\vdots & \vdots & \vdots \\
2^n-2 & 0 & \alpha_{2^n-2} \\
2^n-1 & 0 & \alpha_{2^n-1}
\end{array} &
\perp=(\textbf{A}^n)_\mathtt{0x0}
\end{array}
$$

**Tautology:** A tautology is a function, with any number of inputs, that always returns one.
$$
\begin{array}{cc}
\begin{array}{c|c|c}
(\textbf{A}^n)_\text{CV} & \top & (\textbf{A}^n)_\alpha \\
\hline
\mathtt{0x0} & 1 & \alpha_\mathtt{0x0} \\
\mathtt{0x1} & 1 & \alpha_\mathtt{0x1} \\
\vdots & \vdots & \vdots \\
2^n-2 & 1 & \alpha_{2^n-2} \\
2^n-1 & 1 & \alpha_{2^n-1}
\end{array} &
\top=(\textbf{A}^n)_{2^{2^n}-1}
\end{array}
$$