Professional Documents
Culture Documents
FITEE.2000608
FITEE.2000608
Abstract: Motivated by the inconvenience or even inability to explain the mathematics of the state space optimization of finite
state machines (FSMs) in most existing results, we consider the problem by viewing FSMs as logical dynamic systems. Borrowing
ideas from the concept of equilibrium points of dynamic systems in control theory, the concepts of t-equivalent states and t-source
equivalent states are introduced. Based on the state transition dynamic equations of FSMs proposed in recent years, several
mathematical formulations of t-equivalent states and t-source equivalent states are proposed. These can be analogized to the
necessary and sufficient conditions of equilibrium points of dynamic systems in control theory and thus give a mathematical
explanation of the optimization problem. Using these mathematical formulations, two methods are designed to find all the
t-equivalent states and t-source equivalent states of FSMs. Further, two ways of reducing the state space of FSMs are found. These
can be implemented without computers but with only pen and paper in a mathematical manner. In addition, an open question is
raised which can further improve these methods into unattended ones. Finally, the correctness and effectiveness of the proposed
methods are verified by a practical language model.
Key words: Finite state machines; Finite-valued systems; Logical systems; Logical networks; Semi-tensor product of matrices;
Space optimization
https://doi.org/10.1631/FITEE.2000608 CLC number: TP13
equivalences of nondeterministic lattice multiset (Xu and Hong, 2012; Yan et al., 2015). In Xu and
FSMs and deterministic ones. Based on the equiva- Hong (2012) and Yan et al. (2015), the dynamics of an
lences, they further proposed effective algorithms to FSM is formulated as Eqs. (1) and (2), respectively:
produce a minimal substitution of a given lattice
multiset FSM. For Mealy and Moore FSMs, Solov’ev x (t 1) Fu(t ) x (t ),
(2011, 2017) used two methods to study the state (1)
y (t ) Hu(t ) x (t ),
space optimization of Mealy FSMs by merging in-
ternal states and using output variables of state as- and
signment based on structural models of FSMs. It was
shown that the methods can reduce the area of FSM x (t 1) T t x0 u(t ),
implementation for all families of field programmable (2)
y (t ) K x0 u(t ),
t
X Y = X i yi ,
n
nondeterministic one. i 1
The main contributions of this paper are as fol- p
Y T X T
lows. Taking the concept of equilibrium points in
yi ( X i )T n ,
control theory, the concepts of t-equivalent states and i 1
2.2 Finite state machines the new state f(x, e1), M transfers to state f(f(x, e1), e2),
and so on.
Definition 2 (FSMs) (Yan et al., 2019a) An FSM is
a five-tuple M=(X, E, f, x0, XF), where X and E denote 2.3 Problem description
two finite sets of states and input symbols, respec-
An FSM is originally a concept in the field of
tively, f is a state transition function from X×E to X, x0
computer science, where the state evolution is ex-
is an initial state at which M begins to run, and XF is a
pressed by diagrams, tables, or discrete functions.
set of final states indicating that M accepts an input
These kinds of representations are simple and intui-
string if M reads the input string and stops at one state
tive, and provide the basis for designing algorithms to
of XF. Fig. 1a is an example, where X={x1, x2, x3, x4,
accomplish various kinds of particular functionalities.
x5, x6}, E={0, 1}, x0=x1, XF={x6}.
However, they are not easy for studying the state
1
evolution of FSMs mathematically, i.e., not like in-
vestigating the dynamics of linear and nonlinear sys-
0
0
x2 x4
0 tems by manipulating their dynamic equations.
In recent years the state transition dynamics of
x1 1 x6 0, 1
1 an FSM is formulated as a dynamic equation (4) (Yan
1 0 0
et al., 2015), called the state transition dynamic
x3 x5
equation, with which one can analyze the dynamics of
1
FSMs like using dynamic equations to investigate the
(a) behaviors of dynamic systems in the area of control
1 theory:
0
0
x2 x4
0 x (t 1) T t x0 u(t ). (4)
1
x1 0, 1 x6 0, 1
0 In Eq. (4) both the states x(t) and x0 and input
1
x3 string u(t) are vectors. Specifically, for FSM M=(X, E,
(b) f, x0, XF), where X={x1, x2, …, xn} and E={e1, e2, …,
Fig. 1 The original finite state machine (a) and merged em}, state xi is identified with ni , and input symbol ej
finite state machine (b) with mj ; ni and mj are called the vector forms of
state xi and input symbol ej, respectively, where pq is
FSMs are of two kinds, deterministic and non-
deterministic. An FSM M is said to be deterministic if the column vector corresponding to the qth column of
|f(x, e)|≤1 holds for each xX and eE, where |f(x, e)| the p×p unit matrix Ip. For an input string
denotes the number of states to which M is moved by u(t)=e1e2…et, its vector form is tj 1 mj . This repre-
input e from state x; otherwise, M is called an NFSM. sentation is referred to as the vectorization of M. This
Since NFSMs are equivalent to DFSMs, and DFSMs is intended to introduce the STP of matrices to model
are used widely in practice, the FSMs considered in the dynamics of M as a dynamic equation. In this
this study are limited to DFSMs. study the vector forms of state xi and input symbol ej
The dynamical evolution that FSM M reads an are used interchangeably with xi and ej for the con-
input string e=e1e2…etE* at state xX is defined as venience of use.
The aim of this paper is to find, based on the
f (e, x) f ( f ( f ( f ( x, e1 ), e2 )), et ), (3) dynamic equation (4), the simplest substitutions of
FSMs by following the style of control theory. A
where E* denotes the set of finite strings on E={e1, simplest substitution of an FSM is an FSM that
e2, …, em}. The meaning of Eq. (3) is that M starts in achieves the same function with the minimum num-
state x and makes a transition to state f(x, e1)X if ber of states, for example, generation of the same
event e1 occurs at state x. Next, if an event e2 occurs at language. For this purpose, we propose the concepts
1602 Yue et al. / Front Inform Technol Electron Eng 2021 22(12):1598-1609
of t-string set between states, t-equivalent states and Remark 3 (1) Since f ( xi1 , ) x j1 and f ( xi2 , )
t-source equivalent states; we explore some mathe-
x j2 , the t-equivalence of states xi1 and xi2 implies
matics of t-equivalent states, and further design sev-
eral algebraic methods to find the simplest substitu- that x j1 x j2 in Definition 4. (2) Clearly, as a special
tions of FSMs. In addition, an open question is posed, case, state xi is t-equivalent to itself. (3) The
by which the proposed optimization method can be t-equivalence of states satisfies the following three
further optimized to an unattended one. properties: reflexivity, symmetry, and transitivity;
The following are the notations used in this therefore, it is an equivalence relation on the set of
paper: ni , the column vector corresponding to the ith states X. (4) If states xi1 , xi2 , , xis are t-equivalent,
column of the unit matrix In; Coli(A), the ith column of
they have exactly the same functions. In other words,
matrix A; |w|, the length of string w, i.e., the number
they exhibit exactly the same behaviors in the dy-
of symbols contained in w; α_β, the connection of
namic evolutions of FSMs. (5) To reduce the state
strings α and β; S1−S2, the subtraction of sets S1 and S2,
space of FSMs, it is sufficient to find the equivalent
i.e., S1−S2={x|xS1, xS2}; , the empty set. states and merge them to one.
For the convenience of description in the sequel,
we introduce a partition of matrices.
3 Main results r-column equipartition of matrices: let M be a
matrix of size p×qr. The r-column equipartition of M
In this section we present the main results of this refers to the following partition that divides M into r
paper in two parts. The first part includes the theo- equally sized blocks:
retical results containing the concepts and mathe-
matical formulations of t-equivalent states and
M [Blk1 ( M ), , Blk i ( M ), , Blk r ( M )],
t-source equivalent states, which are the basis of de-
signing the methods of reducing FSMs presented in where
the second part. Blk i ( M ) [Col( i 1) q 1 ( M ),Col(i 1) q 2 ( M ),
3.1 Theories ,Coliq ( M )], i 1, 2,..., r.
Definition 4 (t-equivalent states and t-different states) where Blki(M) (i=1, 2, …, r) is the ith block of
States xi1 and xi2 are called t-equivalent states if the r-column equipartition of M.
following Eq. (5) holds for any St ( xi1 x j1 ) Theorem 1 (Equivalent condition of states) Let
Eq. (7) be the state transition dynamic equation of
St ( xi2 x j2 ) : FSM M=(X, E, f, x0, XF), where X={x1, x2, …, xn} and
f ( xi1 , ) f ( xi2 , ). (5) E={e1, e2, …, em}:
Otherwise, they are called t-different states; that is, x (t 1) T t xi u(t ) . (7)
there is an St ( xi1 x j1 ) St ( xi2 x j2 ) such that Then xi1 and xi2 are t-equivalent if and only if
Note that the vector forms of xi1 and xi2 are ni1 block of Blk i1 (T t ) is different from the lth block of
and ni2 , respectively. Substituting the vector forms Blk i2 (T t ) , i.e.,
into Eq. (9) yields
Blk i1 (T t ) Blk i2 (T t ).
T T .
t i1
n
t i2
n (10)
This contradicts the known condition
Combining Eq. (6) with Eq. (10), we have that
Blk i1 (T t ) Blk i2 (T t ). The proof of sufficiency is
Blk i1 (T t ) Blk i2 (T t ). The arbitrariness of ω
completed.
guarantees that Blk i1 (T t ) Blk i2 (T t ). The necessity Corollary 1 For the FSM described in Theorem 1, if
is proved. states xi1 and xi2 are t-equivalent, they are
(Sufficiency) The known condition is (t+k)-equivalent (k≥1).
Blk i1 (T t ) Blk i2 (T t ). We prove the sufficiency by Proof Since states xi1 and xi2 are t-equivalent, it
contradiction. Assume xi1 and xi2 are not t-equivalent. follows from Theorem 1 and Definition 4 that the
By Definition 4, there exists an St ( xi1 x j1 ) following Eq. (16) holds for any St ( xi1 x j1 )
Using Eq. (7), we know that the left side of in- By Proposition 1, we know that Eq. (16) is
equality (11) is equivalent to
and the right side of inequality (11) is For any input symbol eE, we consider the
T t xi2 . (13) string _ e St 1 ( xi1 x j1 ) St 1 ( xi2 x j2 ).
Multiplying both sides of Eq. (17) by T on the
left and by ω_e on the right (for convenience, in the
Substituting the vector forms of xi1 and xi2 , i1
n
following we use ω_e to denote the vector form of the
and ni2 , into expressions (12) and (13), respectively, string ω_e), we obtain
1604 Yue et al. / Front Inform Technol Electron Eng 2021 22(12):1598-1609
The following Method 2 is to find the t-source Step 1: use Method 1 to obtain the set of
equivalent states of FSMs: 1-equivalent states, X1. If X1 does not exist, M is a
Method 2 (Finding t-source equivalent states) Let simplest FSM and the method terminates; otherwise,
x(t+1)=Ttxiu(t) be the state transition dynamic equa- go to step 2.
tion of FSM M=(X, E, f, x0, XF), where X={x1, x2, …, Step 2: merge the states in X1. Denote the re-
xn}. The following steps yield the set of t-source sulting FSM by Mnew.
equivalent states of M: Step 3: set M=Mnew and go to step 1.
Step 1: use Method 1 to obtain the set of Remark 6 In Method 4, the iterative merging of the
t-equivalent states of M, Xt. 1-equivalent states is used to avoid the appearance of
Step 2: use Method 1 to obtain the set of Tt and prevent the heavy burden on computer
(t−1)-equivalent states of M, Xt−1. memory.
Step 3: obtain the set of t-source equivalent 3.3 Complexity analysis
states of M, Xot=Xt−Xt−1.
In this subsection we analyze the computational
Next we consider how to reduce the state space
complexity of the presented minimization method
of FSM; we start with a preparation of regulating an
(Method 4) from the two aspects of time complexity
operation of merging states into one state.
and space complexity. Method 4 is an improved ver-
Merging of states of FSMs: let X be the state set
sion of Method 3; Method 3 is conducted based on
of an FSM M, where X={x1, x2, …, xn}. Let
Methods 1 and 2. Therefore, we need only to discuss
X {xi1 , xi2 , , xis } be a subset of X. The merging of the complexities of Methods 1–3. Consider an FSM
states refers to the process of merging states in X′ into M=(X, E, f, x0, XF), where X={x1, x2, …, xn} and E={e1,
one and moving the related “edges” accordingly in the e2, …, em}.
state transition diagram of M. We use an example, as Time complexity: Methods 1 and 2 have no
shown in Fig. 1, to illustrate it, where X={x1, x2, x3, x4, circulation iteration, and thus the time complexity is
x5, x6}, X ={x2 , x5 }. O(1). In Method 3, if M itself is the simplest FSM, the
Method 3 (State minimization of FSMs) Let M be method comes to an end without iteration. Suppose M
an FSM, where the state set is X={x1, x2, …, xn}. Take is not the simplest one. The number of t-source
the following steps and we can obtain the simplest equivalent states is n−1 in the worst situation, and for
substitution of M: this reason the case of Xot= occurs, thus causing
Step 1: set t=1 and Box=. Method 3 to iterate n−1 times. Therefore, the method
Step 2: use Method 2 to obtain the set of t-source iterates n−1 times at most. The time complexity is
equivalent states of M, denoted by Xot. If there are no O(n).
t-source equivalent states, let Xot=. For Method 4, since the number of states of an
FMS is at least one, the number of iterations of the
Step 3: set Box=BoxXot.
method is no larger than n−1. Therefore, the time
Step 4: check whether Xot is empty or not. If yes,
complexity is of polynomial time O(n).
go to step 5; otherwise, set t=t+1, and go to step 2.
Space complexity: in Method 1, matrix Tt of size
Step 5: merge the states in each boxBox. The
n×m n and matrices Blki(Tt), i=1, 2, …, n, need to be
t
resulting FSM is the simplest substitution of M.
stored in step 1. The sum of the sizes of these n ma-
Remark 5 The dimension of Tt is n×mtn, which
trices is n×mtn. Thus, step 1 requires a total of 2n2mt
shows that the size of Tt increases exponentially with
storage units. The set K needs to be stored in step 2;
m and t. Thus, Tt is very large when m or t is large.
the number of elements of K is the combinatorial
This causes a heavy burden on the memory of com-
puters during the use of Method 3 to reduce FSMs number C2n n(n 1) in the worst case. The set Xt in
(Note that Tt appears in Method 1, Method 1 is used in step 3 has also n(n−1) elements at most. Therefore,
Method 2, and Method 2 is used in Method 3). To the space complexity of Method 1 is O(n2mt). Method
avoid this situation, Method 3 can be further 2 uses Method 1 to find the t-source equivalent states
improved. of M, and no additional storage is required. The space
Method 4 (Improvement of Method 3) complexity of Method 2 is also O(n2mt). The storage
1606 Yue et al. / Front Inform Technol Electron Eng 2021 22(12):1598-1609
Corollary 1 Corollary 3
Step 7.2: run step 2 of Method 1. There are no
identical blocks in {Blki(T)|i=1, 2, 3}. Then M has no
1-equivalent states. Method 1 is terminated. X1 does
Method 1 not exist, and M is a simplest FSM. Method 4 stops.
It is easy to verify that the reduced FSM (Fig. 5)
Method 2 has the same functions as the original FSM (Fig. 2).
Both recognize the language on alphabet {0, 1} in
Method 3 which there is no substring “00.” This shows the
correctness and effectiveness of the results of this
Method 4
paper.
0, 1
Methods
0
x2 x3
0
Fig. 3 Logical relations among the main results of this
paper x1 1 0
1
Blk1 (T ) 4 [2, 4], Blk 2 (T ) 4 [3, 4],
Fig. 5 Finite state machine produced by merging
Blk 3 (T ) 4 [3,3], Blk 4 (T ) 4 [2, 4]. 2-equivalent states x1 and x4
system science to reconsider the problem of state Gao N, Han XG, Chen ZQ, et al., 2017. A novel matrix
space optimization of FSMs. Two general kinds of approach to observability analysis of finite automata. Int J
Syst Sci, 48(16):3558-3568.
equivalent states of FSMs, t-equivalent states and
García P, López D, de Parga MV, 2014. Efficient deterministic
t-source equivalent states, are proposed by following finite automata split-minimization derived from
the notion of the equilibrium points of dynamic sys- Brzozowski’s algorithm. Int J Found Comput Sci, 25(6):
tems in control theory. Further we explore some 679-696. https://doi.org/10.1142/s0129054114500282
mathematics of these two kinds of equivalent states, Gören S, Ferguson FJ, 2002. Chesmin: a heuristic for state
including properties and a necessary and sufficient reduction in incompletely specified finite state machines.
Proc Design, Automation and Test in Europe Conf and
condition of t-equivalent states, and the relation be-
Exhibition, p.248-254.
tween the t-equivalent and (t+1)-equivalent states. https://doi.org/10.1109/DATE.2002.998280.
Based on these results, several algebraic methods are Gören S, Ferguson FJ, 2007. On state reduction of
developed to find all the t-equivalent states and to incompletely specified finite state machines. Comput
reduce FSMs. The idea and methods proposed in this Electr Eng, 33(1):58-69.
paper may provide a new angle and means to analyze https://doi.org/10.1016/j.compeleceng.2006.06.001
Grzes TN, Solov’ev VV, 2015. Minimization of power
and synthesize FSMs mathematically.
consumption of finite state machines by splitting their
internal states. J Comput Syst Sci Int, 54(3):367-374.
Contributors https://doi.org/10.1134/s1064230715030090
Jumei YUE raised the research questions and the ideas to Han XG, Chen ZQ, 2018. A matrix-based approach to
solve them. Yongyi YAN and Zengqiang CHEN guided Jumei verifying stability and synthesizing optimal stabilizing
YUE and He DENG to carry out the research in the whole controllers for finite-state automata. J Franklin Inst,
process. Jumei YUE drafted the manuscript. He DENG helped 355(17):8642-8663.
organize the manuscript. Yongyi YAN and Zengqiang CHEN https://doi.org/10.1016/j.jfranklin.2018.09.009
revised and finalized the paper. Han XG, Chen ZQ, Liu ZX, et al., 2018. The detection and
stabilisation of limit cycle for deterministic finite
Acknowledgements automata. Int J Contr, 91(4):874-886.
The authors would like to express their sincere thanks for https://doi.org/10.1080/00207179.2017.1295319
the advice given by Assistant Prof. Xiangru XU and Prof. He YS, Yu ZH, Jian L, et al., 2019. Fault correction of
Yiguang HONG. algorithm implementation for intelligentized robotic
multipass welding process based on finite state machines.
Compliance with ethics guidelines Robot Comput-Int Manuf, 59:28-35.
Jumei YUE, Yongyi YAN, Zengqiang CHEN, and He https://doi.org/10.1016/j.rcim.2019.03.002
DENG declare that they have no conflict of interest. Kamble SD, Thakur NV, Bajaj PR, 2018. Fractal coding based
video compression using weighted finite automata. Int J
Amb Comput Intell, 9(1):115-133.
https://doi.org/10.4018/IJACI.2018010107
References
Klimowicz AS, Solov’ev VV, 2013. Minimization of
Chen WY, 2007. The Theory of Finite Automata. University of
incompletely specified Mealy finite-state machines by
Electronic Science and Technology of China Press,
merging two internal states. J Comput Syst Sci Int, 52(3):
Chengdu, China (in Chinese).
400-409. https://doi.org/10.1134/s106423071303009x
Cheng DZ, Qi HS, Zhao Y, 2012. An Introduction to Li YM, Pedrycz W, 2007. Minimization of lattice finite
Semi-tensor Product of Matrices and Its Applications. automata and its application to the decomposition of
World Scientific, Singapore. lattice languages. Fuzzy Sets Syst, 158(13):1423-1436.
Chu D, Spinney RE, 2018. A thermodynamically consistent https://doi.org/10.1016/j.fss.2007.03.003
model of finite-state machines. Interf Focus, 8(6): Liu DS, Huang ZP, Zhang YM, et al., 2016. Efficient
20180037. https://doi.org/10.1098/rsfs.2018.0037 deterministic finite automata minimization based on
Dahmoune M, El Abdalaoui EH, Ziadi D, 2014. On the backward depth information. PLoS ONE, 11(11):
transition reduction problem for finite automata. Fundam e0165864. https://doi.org/10.1371/journal.pone.0165864
Inform, 132(1):79-94. Lu JQ, Li HT, Liu Y, et al., 2017. Survey on semi-tensor
https://doi.org/10.3233/fi-2014-1033 product method with its applications in logical networks
de Parga MV, García P, López D, 2013. A polynomial double and other finite-valued systems. IET Contr Theory Appl,
reversal minimization algorithm for deterministic finite 11(13):2040-2047.
automata. Theor Comput Sci, 487:17-22. Martinek P, 2018. Some notes to minimization of multiset
https://doi.org/10.1016/j.tcs.2013.03.005 finite automata. AIP Conf Proc, 1978(1):470019.
Yue et al. / Front Inform Technol Electron Eng 2021 22(12):1598-1609 1609