GO-V.ORG
As seen in

Algebraic normal form

Algebraic normal form (ANF) is a representation of functions in boolean algebra. Formulas written in ANF are also known as ring sum normal form (RSNF or RNF), Zhegalkin polynomials ( ), or Positive Polarity (or parity) Reed–Muller expansions (PPRM). These terms describe a way of writing propositional logic formulas in one of three sub-forms: * The entire formula is purely true or false: ** 1 ** 0 * One or more variables are combined into a term by AND ( \and ), then one or more terms are combined by XOR ( \oplus ) together into ANF. Negations are not permitted: a \oplus b \oplus \left(a \and b\right) \oplus \left(a \and b \and c\right) * The previous subform with a purely true term: 1... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

Algebraic normal form (ANF) is a representation of functions in boolean algebra. Formulas written in ANF are also known as ring sum normal form (RSNF or RNF), Zhegalkin polynomials ( ), or Positive Polarity (or parity) Reed–Muller expansions (PPRM). These terms describe a way of writing propositional logic formulas in one of three sub-forms: The entire formula is purely true or false: 1 0 One or more variables are combined into a term by AND ( \and ), then one or more terms are combined by XOR ( \oplus ) together into ANF. Negations are not permitted: a \oplus b \oplus \left(a \and b\right) \oplus \left(a \and b \and c\right) The previous subform with a purely true term: 1 \oplus a \oplus b \oplus \left(a \and b\right) \oplus \left(a \and b \and c\right) Introduced by the Russian mathematician Ivan Ivanovich Zhegalkin in 1927, they are the polynomial ring over the integers modulo 2. The resulting degeneracies of modular arithmetic result in Zhegalkin polynomials being simpler than ordinary polynomials, requiring neither coefficients nor exponents. Coefficients are redundant because 1 is the only nonzero coefficient. Exponents are redundant because in arithmetic mod 2, x 2 = x. Hence a polynomial such as 3x 2 y 5 z is congruent to, and can therefore be rewritten as, xyz. f(x)=0 f(x)=1 f(x)=x f(x)=1 \oplus x To represent a function with multiple arguments one can use the following equality: f(x_1,x_2,\ldots,x_n) = g(x_2,\ldots,x_n) \oplus x_1 h(x_2,\ldots,x_n) , where g(x_2,\ldots,x_n) = f(0,x_2,\ldots,x_n) h(x_2,\ldots,x_n) = f(0,x_2,\ldots,x_n) \oplus f(1,x_2,\ldots,x_n) Indeed, if x_1=0 then x_1 h = 0 and so f(0,\ldots) = f(0,\ldots) if x_1=1 then x_1 h = h and so f(1,\ldots) = f(0,\ldots) \oplus f(0,\ldots) \oplus f(1,\ldots) Since both g and h have fewer arguments than f it follows that using this process recursively we will finish with functions with one variable. For example, let us construct ANF of f(x,y)= x \lor y (logical or): f(x,y) = f(0,y) \oplus x(f(0,y) \oplus f(1,y)) since f(0,y)=0 \lor y = y and f(1,y)=1 \lor y = 1 it follows that f(x,y) = y \oplus x (y \oplus 1) by distribution, we get the final ANF: f(x,y) = y \oplus x y \oplus x = x \oplus y \oplus x y Given the Boolean function f(A,B,C) = \bar A \bar B \bar C + \bar A B \bar C + A \bar B \bar C + A B C , express it as a Zhegalkin polynomial. This function can be expressed as a column vector \vec f = \begin{pmatrix} 1 \\ 0 \\ 1 \\ 0 \\ 1 \\ 0 \\ 0 \\ 1 \end{pmatrix} . This vector should be the output of left-multiplying a vector of undetermined coefficients \vec c = \begin{pmatrix} c_0 \\ c_1 \\ c_2 \\ c_3 \\ c_4 \\ c_5 \\ c_6 \\ c_7 \end{pmatrix} by an 8x8 logical matrix which represents the possible values that all the possible conjunctions of A, B, C can take. These possible values are given in the following truth table: The information in the above truth table can be encoded in the following logical matrix: S_3 = \begin{pmatrix} 1&0&0&0&0&0&0&0 \\ 1&1&0&0&0&0&0&0 \\ 1&0&1&0&0&0&0&0 \\ 1&1&1&1&0&0&0&0 \\ 1&0&0&0&1&0&0&0 \\ 1&1&0&0&1&1&0&0 \\ 1&0&1&0&1&0&1&0 \\ 1&1&1&1&1&1&1&1 \end{pmatrix} where the 'S' here stands for "Sierpiński", as in Sierpiński triangle, and the subscript 3 gives the exponents of its size: 2^3 \times 2^3 . It can be proven through mathematical induction and block-matrix multiplication that any such "Sierpiński matrix" S_n is its own inverse. Then the linear system is S_3 \vec c = \vec f which can be solved for \vec c : \vec c = S_3^{-1} \vec f = S_3 \vec f = \begin{pmatrix} 1&0&0&0&0&0&0&0 \\ 1&1&0&0&0&0&0&0 \\ 1&0&1&0&0&0&0&0 \\ 1&1&1&1&0&0&0&0 \\ 1&0&0&0&1&0&0&0 \\ 1&1&0&0&1&1&0&0 \\ 1&0&1&0&1&0&1&0 \\ 1&1&1&1&1&1&1&1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \\ 1 \\ 0 \\ 1 \\ 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \\ 1 \oplus 1 \\ 1 \oplus 1 \\ 1 \oplus 1 \\ 1 \oplus 1 \\ 1 \oplus 1 \oplus 1 \\ 1 \oplus 1 \oplus 1 \oplus 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \end{pmatrix}, and the Zhegalkin polynomial corresponding to \vec c is 1 \oplus C \oplus AB . Let c_0, \dots , c_{2^n-1} be the outputs of a truth table for the function P of n variables, such that the index of the c_i 's corresponds to the binary indexing of the minterms. Define a function ζ recursively by: \zeta(c_i) := c_i \zeta(c_0, \dots , c_k) := \zeta(c_0, \dots , c_{k - 1}) \oplus \zeta(c_1, \dots , c_k). Note that \zeta(c_0, \dots , c_m) = \bigoplus_{k = 0}^m {m \choose k}_2 c_k where {m \choose k}_2 is the binomial coefficient reduced modulo 2. Then g_i = \zeta(c_0, \dots , c_i) is the i th coefficient of a Zhegalkin polynomial whose literals in the i th monomial are the same as the literals in the i th minterm, except that the negative literals are removed (or replaced by 1). The ζ-transformation is its own inverse, so the same kind of table can be used to compute the coefficients c_0, \dots , c_{2^n-1} given the coefficients g_0, \dots , g_{2^n-1} . Just let c_i = \zeta(g_0, \dots , g_i). In terms of the table in the figure, copy the outputs of the truth table (in the column labeled P) into the leftmost column of the triangular table. Then successively compute columns from left to right by applying XOR to each pair of vertically adjacent cells in order to fill the cell immediately to the right of the top cell of each pair. When the entire triangular table is filled in then the top row reads out the coefficients of a linear combination which, when simplified (removing the zeroes), yields the Zhegalkin polynomial. To go from a Zhegalkin polynomial to a truth-table, it is possible to fill out the top row of the triangular table with the coefficients of the Zhegalkin polynomial (putting in zeroes for any combinations of positive literals not in the polynomial). Then successively compute rows from top to bottom by applying XOR to each pair of horizontally adjacent cells in order to fill the cell immediately to the bottom of the leftmost cell of each pair. When the entire triangular table is filled then the leftmost column of it can be copied to column P of the truth table. As an aside, this method of calculation corresponds to the method of operation of the elementary cellular automaton called Rule 102. For example, start such a cellular automaton with eight cells set up with the outputs of the truth table (or the coefficients of the canonical disjunctive normal form) of the Boolean expression: 10101001. Then run the cellular automaton for seven more generations while keeping a record of the state of the leftmost cell. The history of this cell then turns out to be: 11000010, which shows the coefficients of the corresponding Zhegalkin polynomial. a_5 = f_0 \oplus f_1 \oplus f_4 \oplus f_5 = f(0,0,0) \oplus f(0,0,1) \oplus f(1,0,0) \oplus f(1,0,1) Since there are no variables with the constant term, a_0 = f_0. For a term which includes all variables, the sum includes all values of the function: a_{N - 1} = f_0 \oplus f_1 \oplus f_2 \oplus \dots \oplus f_{N-2} \oplus f_{N-1} Let us graphically represent the coefficients of the Zhegalkin polynomial as sums modulo 2 of values of functions at certain points. To do this, we construct a square table, where each column represents the value of the function at one of the points, and the row is the coefficient of the Zhegalkin polynomial. The point at the intersection of some column and row means that the value of the function at this point is included in the sum for the given coefficient of the polynomial (see figure). We call this table T_N , where N is the number of variables of the function. There is a pattern that allows you to get a table for a function of N variables, having a table for a function of N-1 variables. The new table T_N + 1 is arranged as a 2 × 2 matrix of T_N tables, and the right upper block of the matrix is cleared. Consider the columns of a table T_N as corresponding to elements of a Boolean lattice of size 2^N . For each column f_M express number M as a binary number M_2 , then f_M \le f_K if and only if M_2 \vee K_2 = K_2 , where \vee denotes bitwise OR. If the rows of table T_N are numbered, from top to bottom, with the numbers from 0 to 2^N - 1 , then the tabular content of row number R is the ideal generated by element f_R of the lattice. Note incidentally that the overall pattern of a table T_N is that of a logical matrix Sierpiński triangle. Also, the pattern corresponds to an elementary cellular automaton called Rule 60, starting with the leftmost cell set to 1 and all other cells cleared. If the cell in question is 1, add the corresponding term to the Zhegalkin polynomial, then invert all cells in the Karnaugh map where this term is 1 (or belonging to the ideal generated by this term, in a Boolean lattice of monomials) and go to the next cell. For example, if, when examining cell 110, a one appears in it, then the term AB is added to the Zhegalkin polynomial and all cells of the Karnaugh map are inverted, for which A = 1 and B = 1. If unit is in cell 000, then a term 1 is added to the Zhegalkin polynomial and the entire Karnaugh map is inverted. The transformation process can be considered complete when, after the next inversion, all cells of the Karnaugh map become zero, or a don't care condition. The Möbius inversion formula relates the coefficients of a Boolean sum-of-minterms expression and a Zhegalkin polynomial. This is the partial order version of the Möbius formula, not the number theoretic. The Möbius inversion formula for partial orders is: g(x) = \sum_{y:y\le x} f(y) \leftrightarrow f(x) = \sum_{y:y\le x} g(y) \mu(y,x), where \mu(y,x) = (-1)^ , |x| being the Hamming distance of x from 0. Since -1 \equiv 1 in the Zhegalkin algebra, the Möbius function collapses to being the constant 1. The set of divisors of a given number x is also the order ideal generated by that number: \langle x \rangle . Since summation is modulo 2, the formula can be restated as g(x) = \bigoplus_{y:y\in \langle x\rangle} f(y) \leftrightarrow f(x) = \bigoplus_{y:y\in \langle x\rangle} g(y) Then \begin{align} g(000) &= f(000) \\[1ex] g(001) &= f(000) \oplus f(001) \\[1ex] g(010) &= f(000) \oplus f(010) \\[1ex] g(011) &= f(000) \oplus f(001) \oplus f(010) \oplus f(011) \\[1ex] g(100) &= f(000) \oplus f(100) \\[1ex] g(101) &= f(000) \oplus f(001) \oplus f(100) \oplus(101) \\[1ex] g(110) &= f(000) \oplus f(010) \oplus f(100) \oplus f(110) \\[1ex] g(111) &= f(000) \oplus f(001) \oplus f(010) \oplus f(011) \oplus f(100) \oplus f(101) \oplus f(110) \oplus f(111) \end{align} The above system of equations can be solved for f, and the result can be summarized as being obtainable by exchanging g and f throughout the above system. The table below shows the binary numbers along with their associated Zhegalkin monomials and Boolean minterms: The Zhegalkin monomials are naturally ordered by divisibility, whereas the Boolean minterms do not so naturally order themselves; each one represents an exclusive eighth of the three-variable Venn diagram. The ordering of the monomials transfers to the bit strings as follows: given a_1 a_2 a_3 and b_1 b_2 b_3 , a pair of bit triplets, then a_1 a_2 a_3 \le b_1 b_2 b_3 \leftrightarrow a_1 \le b_1 \wedge a_2 \le b_2 \wedge a_3 \le b_3 . The correspondence between a three-variable Boolean sum-of-minterms and a Zhegalkin polynomial is then: \begin{align} &f(000) \bar A \bar B \bar C \vee f(001) \bar A \bar B C \vee f(010) \bar A B \bar C \vee f(011) \bar A B C \vee f(100) A \bar B \bar C \vee f(101) A \bar B C \vee f(110) A B \bar C \vee f(111) A B C \\[1ex] &\qquad \equiv g(000) \oplus g(001) C \oplus g(010) B \oplus g(011) BC \oplus g(100) A \oplus g(101) AC \oplus g(110) AB \oplus g(111) ABC. \end{align} The system of equations above may be summarized as a logical matrix equation: \begin{pmatrix} g(000) \\ g(001) \\ g(010) \\ g(011) \\ g(100) \\ g(101) \\ g(110) \\ g(111) \end{pmatrix} = \begin{pmatrix} 1 && 0 && 0 && 0 && 0 && 0 && 0 && 0 \\ 1 && 1 && 0 && 0 && 0 && 0 && 0 && 0 \\ 1 && 0 && 1 && 0 && 0 && 0 && 0 && 0 \\ 1 && 1 && 1 && 1 && 0 && 0 && 0 && 0 \\ 1 && 0 && 0 && 0 && 1 && 0 && 0 && 0 \\ 1 && 1 && 0 && 0 && 1 && 1 && 0 && 0 \\ 1 && 0 && 1 && 0 && 1 && 0 && 1 && 0 \\ 1 && 1 && 1 && 1 && 1 && 1 && 1 && 1 \end{pmatrix} \begin{pmatrix} f(000) \\ f(001) \\ f(010) \\ f(011) \\ f(100) \\ f(101) \\ f(110) \\ f(111) \end{pmatrix} which N. J. Wildberger calls a Boole–Möbius transformation. Below is shown the "XOR spreadsheet" form of the transformation, going in the direction of g to f: ==See also== Boolean function Logical graph Negation normal form Conjunctive normal form Disjunctive normal form Karnaugh map Boolean ring Karnaugh map Irving Stoy Reed David Eugene Muller Reed–Muller code Boolean domain Boolean-valued function Zhegalkin algebra == Further reading== (288 pages) (NB. Translation: Springer-Verlag, 1985.[https://archive.org/details/algebraiclogic0000gind]) (188 pages) (188 pages) ru:Полином Жегалкина

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Algebraic normal form". 1786380625. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1368722504

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·