Full Text
UDC 519.95
MATHEMATICS
A. A. LETICHEVSKII
EQUIVALENCE OF AUTOMATA WITH A FINAL STATE RELATIVE TO A FREE SEMIGROUP WITH RIGHT ZERO
(Presented by Academician V. M. Glushkov on 23 February 1968)
The equivalence of automata with a final state relative to a class of automata was considered in the works \((^1,^2)\). This concept makes it possible to investigate various strong forms of equivalence of algorithms. Here we shall consider the equivalence of \(X\)—\(Y\)-automata with a final state relative to the class \(\mathfrak{F}(G, X^G)\), where \(G\) is a free semigroup with identity \(e\), right zero \(\vartheta\), and a system of free generators \(Z\), regarded as a \(Y\)-automaton with initial state \(e\), where \(Y = Z \cup \{\vartheta\}\). In other words, \(G\) is a semigroup all of whose relations reduce to the identities \(g\vartheta=\vartheta\), \(ge=eg=g\), and \(G\) is regarded as a \(Y\)-automaton with transition function \(\delta_G(g,y)=gy\). If the automata \(A_1\) and \(A_2\) are equivalent relative to the class of automata \(\mathfrak{F}(G, X^G)\), then we shall say that they are equivalent relative to \(G\). The main result is that the problem of equivalence of finite automata with a final state relative to the semigroup \(G\) is decidable.
Let us indicate one possible application of this result. Let \(B\) be an operational automaton \((^3)\) with input alphabet \(Y = Z \cup \{\vartheta\}\) and output alphabet \(X\). Each element \(y \in Y\) determines some transformation of the set \(B\) into itself. Suppose moreover that \(\vartheta\) always takes the operational automaton into one and the same state \(b_0\). Two controlling automata are equivalent relative to the semigroup \(G\) if and only if they determine one and the same transformation of the set of states of any operational device of the indicated type.
The semigroup \(G\) is the union of its disjoint subsemigroups \(F_Z\) and \(G(\vartheta)\), where \(F_Z\) is the subsemigroup generated by the set \(Z\) and the identity, and \(G(\vartheta)\) is the set of elements of the form \(\vartheta g\) \((g \in G)\). Each of these two semigroups we shall regard as a \(Z\)-automaton, taking as the initial state of the first automaton the element \(e\), and as the initial state of the second automaton the element \(\vartheta\). Both automata are free \(Z\)-automata.
If \(\mu_1: F_Z \to X\), and \(\mu_2: G(\vartheta) \to X\), then by \(\mu_1+\mu_2\) we shall denote the mapping \(\mu: G \to X\) equal to \(\mu_1\) on \(F_Z\) and to \(\mu_2\) on \(G(\vartheta)\). If \(L_1 \subset X^{F_Z}\), and \(L_2 \subset X^{G(\vartheta)}\), then by \(L_1+L_2\) we shall denote the set of all \(\mu=\mu_1+\mu_2\), where \(\mu_1 \in L_1\), \(\mu_2 \in L_2\).
If \(A\) is an \(X\)—\(Y\)-automaton with a final state and \(Y' \subset Y\), then one may speak of applying the automaton \(A\) to a \(Y'\)-automaton \(B\), regarding \(\delta_A(a,x)\) as undefined whenever \(\lambda_A(a,x)\notin Y'\). In other words, \(A(B)=A'(B)\), where \(A'\) is an \(X\)—\(Y'\)-automaton obtained from \(A\) by regarding \(\delta_A(a,x)\) and \(\lambda_A(a,x)\) as undefined if \(\lambda_A(a,x)\notin Y'\). On the basis of this definition, one may likewise consider equivalence of \(X\)—\(Y\)-automata relative to a \(Y'\)-automaton and to the set of its output functions, if \(Y'\subset Y\).
Let \(a\) and \(b\) be states of an \(X\)–\(Y\)-automaton \(A\) with final state, and let \(x \in X\). Introduce the notation:
\[
M_{a,x}^{A}=\{\mu \in X^{F_Z}\mid S_A(F_{Z,\mu})=(p,q)(r,s),\ a_A^0p=a,\ \mu(q)=x\};
\]
\[
M_a^A=\bigcup_{x\in X} M_{a,x}^A;
\]
\[
L_{a,b,x}^{A}=\{\mu \in X^{G(\vartheta)}\mid S_{A(a)}(G_\mu(\vartheta))=(p,q)(r,s),\ ap=b,\ \mu(\vartheta q)=x\};
\]
\[
L_{a,b}^{A}=\bigcup_{x\in X} L_{a,b,x}^{A};
\]
\[
M_0^A=M_{a_A^*}^{A}+X^{G(\vartheta)}.
\]
Here \(F_{Z,\mu}\bigl(G_\mu(\vartheta)\bigr)\) is the automaton \(F_Z\bigl(G(\vartheta)\bigr)\) with output function \(\mu\); the words \((r,s)\) may also be infinite.
Let \(\Gamma_A\) be the set of all sequences of pairs
\[
\gamma=((a_1,x_1),\ldots,(a_k,x_k))
\]
such that \(a_i\in A\), \(x_i\in X\), all the states \(a_i x_i\) are distinct, and
\[
\lambda_A(a_i,x_i)=\vartheta \qquad (i=1,\ldots,k).
\]
For any sequence
\[
\gamma=((a_1,x_1),\ldots,(a_k,x_k))\in\Gamma_A
\]
denote
\[
L_\gamma^A=L_{a_1,x_1,a_2,x_2}^A\cap\cdots\cap L_{a_{k-1},x_{k-1},a_k,x_k}^A\cap L_{a_kx_k,a_A^*}^A
\]
and
\[
M_1^A=\bigcup_{\gamma\in\Gamma_A}\left(M_{a_1,x_1}^A+L_\gamma^A\right)
\qquad
(\gamma=((a_1,x_1),\ldots)).
\]
Lemma 1. The automaton \(A\) is applicable to \(G_\mu\) if and only if
\[
\mu\in M_0^A\cup M_1^A .
\]
Moreover, if \(\mu=\mu_1+\mu_2\), where \(\mu_1\in X^{F_Z}\), \(\mu_2\in X^{G(\vartheta)}\), \(\mu\in M_0^A\), then
\[
\overline{A(G_\mu)}=A(F_{Z,\mu_1});
\]
whereas if \(\mu\in M_1^A\), \(\mu_1\in M_{a_1,x_1}^A\), \(\mu_2\in L_\gamma^A\)
\[
(\gamma=((a_1,x_1),\ldots,(a_k,x_k))),
\]
then
\[
\overline{A(G_\mu)}=\vartheta\bigl(A(a_kx_k)(G_{\mu_2}(\vartheta))\bigr).
\]
As a consequence of this lemma we obtain the following criterion for equivalence of automata.
Theorem 1. \(X\)–\(Y\)-automata \(A'\) and \(A''\) with final state are equivalent with respect to \(G\) if and only if
\[
M_0^{A'}=M_0^{A''},\qquad M_1^{A'}=M_1^{A''},
\]
the automata \(A'\) and \(A''\) are equivalent with respect to the free \(Z\)-automaton \(F_Z\) and the set of functions \(M_{a_{A'}^*}^{A'}\), and, for any \(\gamma'\in\Gamma_{A'}\) and \(\gamma''\in\Gamma_{A''}\), if
\[
M_{a_1',x_1'}^{A'}\cap M_{a_1'',x_1''}^{A''}\ne\varnothing,
\]
\[
\bigl(\gamma'=((a_1',x_1'),\ldots,(a_{k'}',x_{k'}')), \quad
\gamma''=((a_1'',x_1''),\ldots,(a_{k''}'',x_{k''}''))\bigr),
\]
then the automata \(A'(a_{k'}'x_{k'}')\) and \(A''(a_{k''}''x_{k''}'')\) are equivalent with respect to the free \(Z\)-automaton \(G(\vartheta)\) and the set of output functions
\[
L_{\gamma'}\cap L_{\gamma''}.
\]
If \(R\) is an event in the alphabet \(X\times Z\), then by \(W_R\) we shall denote the set
\[
\bigcup_{(p,q)\in R} W_{p,q}
\]
(\(W_{p,q}\) is understood in the sense of the set of mappings of the free \(Z\)-automaton). Each of the sets
\[
M_{a,x}^A,\quad M_a^A,\quad L_{a,b,x}^A,\quad L_{a,b}^A
\]
can be specified in the form \(W_R\), where \(R\) is a regular event. For example,
\[
M_{a,x}^A=W_R,
\]
where
\[
R=\{(px,qz)\in (X\times Z)^*\mid a_A^0p=a,\ \lambda_A(a,p)=q\}
=R_{a_A^0,a}\left(\bigcup_{z\in Z}(x,z)\right)\cap (X\times Z)^*,
\]
where
\[
R_{a,b}=\{(p,q)\mid \lambda_A(a,p)=q\}
\]
is representable in the \(X\times Y\)-automaton \(A\) by the state \(b\) with initial state \(a\). Therefore the question of the equalities
\[
M_0^{A'}=M_0^{A''},\qquad M_1^{A'}=M_1^{A''}
\]
and of the nonemptiness
\[
M_{a_1',x_1'}^{A'}\cap M_{a_1'',x_1''}^{A''}\ne\varnothing
\]
reduces to the question of comparing finite intersections of sets of the form \(W_R\), where \(R\) is a regular event.
To solve this question, introduce the following closure operation \(\overline{R}\) in the set of events in the alphabet \(X\times Z\):
\[
(p,q)\in\overline{R}\Longleftrightarrow W_{p,q}=W_R.
\]
It is not difficult to see that \(W_{R_1}=W_{R_2}\) if and only if \(\overline{R}_1=\overline{R}_2\) (indeed, moreover, \(W_{R_1}\subset W_{R_2}\) if and only if \(\overline{R}_1\subset\overline{R}_2\)).
Therefore the question of equality of two sets of the form \(W_R\) is decidable effectively if the closures of regular events are regular.
Lemma 2. The closure \(\overline{R}\) of an event \(R\) is the smallest set satisfying the conditions:
- \(R \subset \overline{R}\).
- If \((px,qz)\in \overline{R}\), then \((px,qz')\in \overline{R}\) for any \(z'\in Z\).
- If for each \(x\in X\) there is a \(z\in Z\) such that \((px,qz)\in \overline{R}\), then \((p,q)\in \overline{R}\).
- If \((p,q)\in \overline{R}\), then \((p,q)(r,s)\in R\).
An immediate consequence of Lemma 2 is
Lemma 3. The closure of a regular event is regular.
For comparing intersections of sets of the form \(W_R\), a new construction is required. Let \(R_1,\ldots,R_n\) be events in the alphabet \(X\times Z\). Consider the event \(\xi(R_1,\ldots,R_n)\) in the alphabet \((X\times Z)^n\), assuming that
\[ ((p_1,q_1),\ldots,(p_n,q_n))\in \xi(R_1,\ldots,R_n) \Longleftrightarrow W_{\sigma((p_1,q_1),\ldots,(p_n,q_n))}\subset \subset W_{R_1}\cap\cdots\cap W_{R_n}. \]
Here, just as in the case \(n=1\), we identify a collection of \(n\) pairs of words of equal length with a word in the alphabet of collections of \(n\) pairs of symbols,
\[ \sigma((p_1,q_1),\ldots,(p_n,q_n)) = \sigma(p_1,q_1)\cap\cdots\cap \sigma(p_n,q_n). \]
It is not difficult to show that
\[ W_{R_1}\cap\cdots\cap W_{R_n} = W_{R'_1}\cap\cdots\cap W_{R'_n} \Longleftrightarrow \xi(R_1,\ldots,R_n)=\xi(R'_1,\ldots,R'_n). \]
Thus everything has been reduced to constructing the event \(\xi(R_1,\ldots,R_n)\) from given regular events \(R_1,\ldots,R_n\). This construction is not difficult to carry out with the help of the following lemma.
Lemma 4. If
\[ W_{\sigma((p_1,q_1),\ldots,(p_n,q_n))}\ne \varnothing, \]
then
\[ W_{\sigma((p_1,q_1),\ldots,(p_n,q_n))} \subset W_{R_1}\cap\cdots\cap W_{R_n} \]
if and only if for each \(i=1,\ldots,n\) there is a \(j=1,\ldots,n\) such that
\[ W_{p_j,q_j}\subset W_{R_i}\quad(\text{i.e. }(p_j,q_j)\in \overline{R}_i). \]
Checking the conditions of Theorem 1 also requires checking the equivalence of the automata \(A'\) and \(A''\) relative to the free \(Z\)-automata \(F_Z\) and \(G(\vartheta)\). This is the strict equivalence of automata relative to a set of output functions \((^1)\). In order that the checking of such equivalence be effective, it is sufficient that the corresponding sets of admissible pairs of words, i.e. the sets of admissible pairs of words for the case when the set of output functions is a finite intersection of events of the form \(W_R\) with regular \(R\), be regular. This is indeed so, since the following lemma holds.
Lemma 5.
\[ W_{p,q}R_1\cap\cdots\cap W_R\ne \varnothing \]
if and only if there exist words
\[ (r,s),(p_1,q_1),\ldots,(p_n,q_n) \]
such that
\[ ((p,q)(r,s),(p_1,q_1),\ldots,(p_n,q_n)) \in \xi((p,q),R_1,\ldots,R_n). \]
Thus, checking the criterion of Theorem 1 can be performed effectively, and therefore the following is true.
Theorem 2. There exists an algorithm which, for any two finite \(X\)—\(Y\)-automata with terminal state, determines whether or not they are equivalent relative to the semigroup \(G\).
The result of Theorem 2 admits some generalizations, in particular to free semigroups with several right zeros.
Institute of Cybernetics
Academy of Sciences of the Ukrainian SSR
Received
21 II 1968
CITED LITERATURE
\(^1\) A. A. Letichevskii, Kibernetika, No. 4 (1966). \(^2\) A. A. Letichevskii, Kibernetika, No. 1 (1967). \(^3\) V. M. Glushkov, Kibernetika, No. 5 (1965).