Conversion between Logic and Algebraic Expressions of Boolean Control Networks

: The conversion between logic and algebraic expressions of Boolean control networks plays a worthy role in the analysis and design of digital circuits. In this paper, for a single Boolean function, a direct conversion between the minterm canonical form and the structure matrix is provided. For a Boolean control network consisting of systems of Boolean functions, two algorithms are developed to achieve the mutual conversion between the logic and algebraic expressions. The presented algorithms decrease exponentially the complexity of the semi-tensor product based method. Some numerical examples are given to demonstrate the algorithms and to compare our method with the existing ones. and Y.T.; methodology, C.W. and Y.T.; investigation, C.W. and Y.T.; writing—original draft preparation, C.W.; writing—review and editing, Y.T.; supervision, Y.T.; funding acquisition, C.W. and Y.T. All authors have read and agreed to the published version of the manuscript.


Introduction
Boolean control network (BCN) is a logical system pioneered by Kauffman in [1] for initially describing genetic regulatory networks, which provides useful modeling tools for dynamical systems whose state-variables take only two values ('True' or 'False'). With the development of information technologies, BCNs have become an effective way to analyze and design circuits by algebraic means in terms of logic gates, and have served as a fundamental approach to digital circuit design, computer programming, and so on (see, e.g., [2][3][4][5][6][7]). With the development of digital circuit, the research on logic synthesis becomes particularly important. Recently, Rushdi and Ahmad [5] used a novel method for obtaining the parametric general solutions of the 'big' Boolean equation, which cover the most prominent type among basic problems of digital circuit design. Bandyopadhyay et al. [4] analyzed the effects of different graph-based intermediate representations, inclutding binary decision diagram, and-inverter graph and majority inverter graph, and their usability in making efficient circuit realisations. Wang and Tao [3] introduced the Karnaugh maps of logical systems and used in the analysis and design of clocked sequential circuits and in the simplification of multioutput gate circuits.
In addition to the traditional logical expression, there are some representations to describe dynamics and estimate performances of BCNs. For example, logic differential calculus [8] represents a mathematical methodology developed for analysis of Boolean functions, which enables us to consider the existing estimates of system importance, as well as some additional properties, of BCNs from the unique methodological standpoint (see, e.g., [9,10]).
The semi-tensor product (STP) of matrices is developed in [11] to convert a Boolean function into an algebraic function, and to model a BCN by a standard discrete-time linear system. A comparison of different representations of Boolean functions can be found in [12]. Describing a logical dynamic system as a linear system is useful for studying BCNs in a control-theoretic framework. Examples include the controllability and observability [13][14][15][16], periodicity and stability [17][18][19][20][21][22], optimal control [23,24], identification [25], etc. The computation complexity is a series problem in directly calculating the network transition matrix based on STP, which frames a limitation on the application of algebraic state-space approach. It has been calculated in [3] that the complexity of STP based method is O(2 6(m+n) n). Recently, Sarda et al. [26,27] proposed a Khatri-Rao product based method to transform the logical form of a BCN into a discrete time bilinear system, which has a complexity of O(2 m+2n ). In other words, the complexity of the STP based method is 2 5m+4n n times that of the Khatri-Rao product based method. This paper will provide a constructive and straightforward method with a complexity of O(2 m+n n) to convert the logic expression to the algebraic expression of a BCN. More concretely, the complexity of the STP based method presented in [11] is 2 5(m+n) times that of the method given in this paper, and the Khatri-Rao product based method presented in [26,27] is 2 n /n times that of ours.
For a BCN, converting the algebraic expression into the logic expression is an integral part for learning the logical meaning of the algebraic result from the algebraic expression. In [16], a mechanical procedure is provided to retrieve the logical network and logical dynamic equations from the network matrix of a BCN. The conversion formula given in [16] is an implicit equation, which converts the algebraic expression for a Boolean function into an irregular form of the logic expression. This paper will provide an explicit equation to directly convert the algebraic expression to a canonical form of the logic expression.
The remainder of this paper is organized as follows. Section 2 introduces some basic concepts about the logic and algebraic expressions of Boolean functions. Section 3 gives a conversion between the minterm canonical form and the structure matrix of a Boolean function. The algorithms for conversion between the logic and algebraic expressions of a BCN are presented in Section 4. The conclusions and future works are drawn in Section 5.

Preliminaries
This section reviews some basic concepts from Boolean functions and Boolean control networks (see, e.g., [6,7]).
A Boolean function is a function of the form where ∆ = {True, False} is the logical domain and n is the arity of the function. Any logical function with n variables can be expressed as a propositional formula in variables x 1 , x 2 , . . . , x n . For simplicity, the logical disjunction x ∨ y, conjunction x ∧ y and negation ¬x are denoted by x + y, xy andx, respec-tively. A truth table specifies the values of a Boolean function for every possible combination of values of the variables in the function. Label the rows of the truth table of Boolean function (1) by 0, 1, . . . , 2 n − 1, respectively, and denote by s i the function value in the row i of the truth table, where i ∈ {0, 1, . . . , 2 n − 1}.
A minterm of n variables is a product of n literals in which each variable appears exactly once in either true or complemented form, but not both. The minterm which corresponds to the row i of truth table is designated as m i . Boolean function (1) can uniquely be written as a sum of minterms, i.e., f (x 1 , x 2 , . . . , x n ) = m i 1 + m i 2 + · · · + m i k := ∑ m(i 1 , i 2 , . . . , i k ), (2) which is called the minterm canonical form of f . Definition 1 ([11]). For A ∈ R m×n and B ∈ R p×q , the semi-tensor product (STP) of A and B is defined as where α is the least common multiple of n and p, I is the identity matrix, ⊗ and × are the Kronecker product and conventional product of matrices, respectively.
The STP has left-right dual forms. The STP mentioned in this paper is the left one. Using STP, a Boolean function can be converted into an algebraic form. Denote by δ j n the j-th column of identity matrix I n , where j ∈ {1, 2, . . . , n}. Represent the logical values "True" and "False" by respectively. Then, Boolean function (1) can be equivalently represented as For the sake of brevity, a matrix of the form [δ in which M f is called the structure matrix of f .
The STP based method has been presented in ( [11], Theorem IV.6) for obtaining the algebraic expression of BCNs by introducing the swap matrix, dummy matrix and power reducing matrix, which has a very high computational complexity of O(2 6(m+n) n) (see [3], Theorem 1). Resently, Sarda et al. [26,27] proposed a Khatri-Rao product based method to obtain such an algebraic expression. Definition 2 ([28]). For A ∈ R m×p and B ∈ R n×p , the Khatri-Rao product of A and B is defined to be a partitioned matrix of order mn × p as follows: where A r (resp. B r ) (r ∈ {1, 2, . . . , p}) is the r-th column of A (resp. B), and ⊗ is the Kronecker product of matrices. (6), the control-depending network transition matrix is L = * n j=1 M in j , and the transition matrix from x(t) to y(t) is H = * p r=1 M out r , where M in j and M out r are the structure matrices of f j and g r , respectively.

Lemma 3 ([26,27]). For BCN
It is known that at most mnp multiplication operations are requited to compute the Khatri-Rao product of two matrices with sizes of m × p and n × p. Then, at most 2 n 2 m+n = 2 m+2n (resp. 2 p 2 n = 2 n+p ) operations are requited to compute the transition matrix L (resp. H) by using the lemma above. Hence, the computational complexity of Lemma 3 is O(2 m+2n ), which decreases exponentially that of the STP based method. Quantitatively, the complexity of the STP based method is 2 5m+4n n times that of the Khatri-Rao product based method. This paper will provide a method with a much lower complexity.

Conversion of Expressions of Boolean Functions
This section presents a direct conversion between the minterm canonical form and the structure matrix of a Boolean function.

From Logic Expression to Algebraic Expression
There exists a one-to-one correspondence between the truth table and the structure matrix of a Boolean function. (1)

Lemma 4 ([29]). If the truth table of Boolean function
The structure matrix of a Boolean function can be constructed from the minterm canonical form. (2), then the structure matrix of f is

Theorem 1. If the minterm canonical form of Boolean function (1) is shown in
where Proof. The minterms presented in (2) are in one-to-one correspondence with the logical value 1 in the truth The minterm canonical form of f is m 2 (=x 1 x 2x3 ). Then, in (8), Hence, the structure matrix of f is M f = δ 2 [2, 2, 2, 2, 2, 1, 2, 2].
Comparing the above example with ( [29], Example 2.5), the method based on the minterm canonical form can avoid the complex calculations of STP.

From Algebraic Expression to Logic Expression
After studying a logical dynamic system in the algebraic state space, it is necessary to convert the algebraic expression back to the logic expression in order to design digital circuits to implement the desired control functions (see, e.g., [3,5]). For a Boolean function, it is claimed in [16] that 'converting an algebraic form back to logical form is not an easy job', and a 'mechanical procedure' is provided for converting the algebraic expression back to the logic expression as below.
Lemma 5 ([16]). If Boolean function (1) has an algebraic expression as (3), then where M f = (M f 1 | M f 2 ), i.e., the structure matrices of f 1 and f 2 are the first and last half of M f , respectively.
It can be seen that Equation (9) is implicit, which converts the algebraic expression of a Boolean function into an irregular form of the logic expression. In fact, the minterm canonical form of a Boolean function can directly be obtained from the structure matrix.
Proof. Suppose that the truth table of f is (s 0 s 1 . . . s 2 n −1 ) . By Lemma 4, Then, the minterm canonical form of f is (10).

Furthermore, the minimization form of f is
Comparing the above example with ( [16], Example 6), the explicit equation makes the conversion straightforward. Moreover, given the truth table of a Boolean function, it is possible to write the function as various propositional formulas with irregular forms, while the minterm canonical form is unique up to the order of minterms.

Conversion of Expressions of Boolean Control Networks
This section extends the presented approach to Boolean control networks to achieve the mutual conversion between logic and algebraic expressions.

From Logic Expression to Algebraic Expression
A method for computing the next state of BN (4) is provided in [3] based on the algebraic expression as below. The lemma above can be extend to BCNs for converting the logic expression into the algebraic expression.

Theorem 3. For BCN (6), let c i be defined by
where s (j) i is the function value in the row i of the truth table of f j . Then, the transition matrix of N in is In the theorem above, it can be seen that c i is the decimal representation of the n-bit binary number whose jth bit code is s Proof. Let L be the transition matrix of N in and x(t) u(t) = δ 2 n −i 2 n . It can be inferred from (7) and Lemma 6 that This implies that the (i + 1)th column of L from right is δ 2 n −c i 2 n , i.e., L is equal to (12).
The following lemma for constructing the transition matrix of N out can be obtained in almost the same way.
wheres (r) i is the function value in the row i of the truth table of g r . Then, the transition matrix of N out is The following algorithm for converting the logic expression to the algebraic expression of a BCN can then be developed.
Next, let us consider the computational complexity of Algorithm 1 starting from the minterm canonical form. Setp 5. Computec i by Formula (13). Setp 6. The transition matrix from x(t) to y(t) is given in (14).

Theorem 5. Algorithm 1 has a complexity of O(2 m+n n).
Proof. In Step 1 (resp. Step 4), the truth tables of f j (resp. g r ) can be obtained directly from their minterm canonical forms without any calculation. In Step 2, the computation cost of c i is one exponent and n multiplication together with n − 1 addition. Hence, the number of operations of Step 2 is at most 2n × 2 m+n = 2 m+n+1 n.
Step 3 requires 2 m+n subtraction operations to compute the transition matrix L. Hence, the computation cost of N in is 2 m+n+1 n + 2 m+n = 2 m+n (2n + 1). Similarly, the computation cost ofc i is 2p, and hence the number of operations of Step 5 is at most 2p × 2 n = 2 n+1 p.
Step 6 requires 2 n subtraction operations to compute the transition matrix H. Hence, the computation cost of N out is 2 n+1 p + 2 n = 2 n (2p + 1). Therefore, the computational complexity of Algorithm 1 is O(2 m+n n).
The STP based method presented in ( [11], Theorem IV.6) and the Khatri-Rao product based method stated in Lemma 3 convert the logic expression into the algebraic expression of BCN (6) starting from the structure matrices, while Algorithm 1 starting from the minterm canonical form. It can be seen from Theorems 1 and 2 that the conversion between the minterm canonical form and the structure matrix of a logical function does not need any calculation. This implies that Algorithm 1, Lemma 3 and ( [11], Theorem IV.6) can be viewed as starting from the same point. Then, the computational complexity of the STP and Khatri-Rao product based methods are 2 5(m+n) and 2 n /n times that of Algorithm 1, respectively.
Let us illustrate Algorithm 1 with the following example.

Example 3.
For the BCN depicted in Figure 1, the logical dynamic equations are Let us give the algebraic expression of such a BCN using Algorithm 1.
Step 1. For N in , the truth table of f j for each j ∈ {1, 2, 3} is listed in Table 1.
Step 3. By (12), the control-depending network transition matrix is Step 4. For N out , the truth table of g 1 is given in Table 2.
Step 6. By (14), the transition matrix from x(t) to y(t) is Hence, the algebraic expression of BCN (15) is where transition matrices L and H are given in (16) and (17), respectively.  .   Output: Logic expression of N in (resp. N out ).

From Algebraic Expression to Logic Expression
The logical networks N in and N out can be reconstructed from the algebraic expression (7) through conversely applying Algorithm 1.
Let us illustrate the algorithm above with the following example. Step 1. Calculate a i for each i ∈ {0, 1, . . . , 31} by (19), which is presented in the last column of Table 1.
Step 6. LetS Then, the logic expression of N out is Hence, the logic expression of BCN (18) is (15), whose logical network is shown in Figure 1.

Conclusions
This paper provides an elementary method to achieve the mutual conversion between the logic and algebraic expressions of Boolean functions and Boolean control networks, which are converted by developing two algorithms. The presented method has several advantages comparing with the existing works. Firstly, the computational complexity is reduced. The complexity of the STP based method is quantitatively 2 5(m+n) times that of the method given in this paper. Secondly, the conversion formula is explicit and analytical. Thirdly, the algebraic expression is uniquely converted into the minterm canonical form of logic expression. Finally, the conversion algorithm is reversible, which means that both two sides of the problem for mutual conversion between logic and algebraic expressions can be solved by using a uniform approach. These advantages should be also convenient for investigating some control problems of Boolean control networks, such as the stability, controllability and observability, which are worth studying and exploring in the future work.
Author Contributions: Conceptualization, C.W. and Y.T.; methodology, C.W. and Y.T.; investigation, C.W. and Y.T.; writing-original draft preparation, C.W.; writing-review and editing, Y.T.; supervision, Y.T.; funding acquisition, C.W. and Y.T. All authors have read and agreed to the published version of the manuscript.