# Conversion between Logic and Algebraic Expressions of Boolean Control Networks
## 4 Conversion of Expressions of Boolean Control Networks
### From Logic Expression to Algebraic Expression
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_  
\[\left\{ \begin{array}{rcl}x_{1}(t+1)&=&x_{2}(t)u_{1}(t),\\ x_{2}(t+1)&=&\bar{u}_{2}(t),\\ x_{3}(t+1)&=&x_{1}(t)+x_{2}(t),\\ y_{1}(t)&=&\bar{x}_{3}(t).\end{array} \right. \tag{15}\]  
_Let us give the algebraic expression of such a BCN using Algorithm 1._  
* _For_ \(N_{in}\)_, the truth table of_ \(f_{j}\) _for each_ \(j\in\{1,2,3\}\) _is listed in Table_ 1_._
* _By (_11_),_ \(c_{i}\)__\((i\in\{0,1,\ldots,31\})\) _is presented in the last column of Table_ 1_._
* _By (_12_), the control-depending network transition matrix is_ \[L=\delta_{8}[3,1,7,5,3,1,7,5,7,5,7,5,7,5,7,5,3,1,7,5,3,1,7,5,8,6,8,6,8,6,8,6].\] (16)
* _For_ \(N_{out}\)_, the truth table of_ \(g_{1}\) _is given in Table_ 2_._
* _By (_13_),_ \(\bar{c}_{i}\)__\((i\in\{0,1,\ldots,7\})\) _is presented in the last column of Table_ 2_._
* _By (_14_), the transition matrix from_ \(x(t)\) _to_ \(y(t)\) _is_ \[H=\delta_{2}[2,1,2,1,2,1,2,1].\] (17)  
_Hence, the algebraic expression of BCN (_15_) is_  
\[\left\{ \begin{array}{rcl}x(t+1)&=&L\ltimes x(t)\ltimes u(t),\\ y(t)&=&H\ltimes x(t),\end{array} \right. \tag{18}\]  
_where transition matrices_ \(L\) _and_ \(H\) _are given in (_16_) and (_17_), respectively._  
Figure 1: Boolean control network. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{\(i\)} & \multirow{2}{*}{\(x_{1}\)} & \multirow{2}{*}{\(x_{2}\)} & \multirow{2}{*}{\(x_{3}\)} & \multirow{2}{*}{\(u_{1}\)} & \multirow{2}{*}{\(u_{2}\)} & \multicolumn{2}{c}{\(f_{1}\)} & \multicolumn{2}{c}{\(f_{2}\)} & \multicolumn{2}{c}{\(f_{3}\)} & \multicolumn{2}{c}{\(c_{i}\)} \\ \cline{1-1} \cline{5-10}  & & & & & & \(b_{1i}\) & \(b_{2i}\) & \(b_{3i}\) & \(a_{i}\) \\ \hline  
\hline \hline \end{tabular}
\end{table} 
Table 1: Truth table relative to \(N_{\rm in}\) (The indexed parameters \(a\) and \(b\) given together with other parameters are needed only further for Algorithm 2). \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{\(i\)} & \multirow{2}{*}{\(x_{1}\)} & \multirow{2}{*}{\(x_{2}\)} & \multirow{2}{*}{\(x_{3}\)} & \multicolumn{2}{c}{\(g_{1}\)} & \multicolumn{2}{c}{\(\tilde{c}_{i}\)} \\ \cline{1-1} \cline{5-10}  & & & & \(b_{1i}\) & \(\tilde{c}_{i}\) \\ \hline
2 & 0 & 1 & 0 & 1 & 1 \\
3 & 0 & 1 & 1 & 0 & 0 \\
4 & 1 & 0 & 0 & 1 & 1 \\
5 & 1 & 0 & 1 & 0 & 0 \\
6 & 1 & 1 & 0 & 1 & 1 \\
7 & 1 & 1 & 1 & 0 & 0 \\ \hlineInput: Transition matrix \(L\) (resp. \(H\)). Output: Logic expression of \(N_{\text{in}}\) (resp. \(N_{\text{out}}\)). 1. For \(N_{\text{in}}\), let \(L=\delta_{2^{n}}[l_{1},l_{2},\ldots,l_{2^{m+n}}]\), where \(l_{v}\in\{1,2,\ldots,2^{n}\}\) represents the \(v\)th column of transition matrix \(L\) and \(v\in\{1,2,\ldots,2^{m+n}\}\). Let \(a_{i}\) be defined by \[a_{i}=2^{n}-l_{2^{m+n}-i},\;i=0,1,\ldots,2^{m+n}-1.\] (19) In fact, \(a_{i}\) is constructed by conversely applying (12), which has the same value as \(c_{i}\). 2. Denote by \(b_{ji}\) the \(j\)th bit code of the binary representation of decimal number \(a_{i}\), where \(i\in\{0,1,\ldots,2^{m+n}-1\}\) and \(j\in\{1,2,\ldots,n\}\). In fact, \(b_{ji}\) is obtained by conversely applying (11), which has the same value as \(s_{i}^{(j)}\). 3.