Научная статья на тему 'An approach to the classification of the loops of finite automata. Part II: the classification of the states based on the loops'

An approach to the classification of the loops of finite automata. Part II: the classification of the states based on the loops Текст научной статьи по специальности «Математика»

CC BY
141
22
i Надоели баннеры? Вы всегда можете отключить рекламу.
Область наук
Ключевые слова
NONDETERMINISTIC FINITE AUTOMATA / BASIS AUTOMATON / TRANSITION GRAPH / PATH / LOOP / ALGORITHMS FOR EQUIVALENT / TRANSFORMATION / UNIVERSAL AUTOMATON

Аннотация научной статьи по математике, автор научной работы — Melnikov B.F., Melnikova A.A.

In this paper, we considered questions of the possible classification of the states and loops of a nondeterministic finite automaton. For the development of algorithms for equivalent transformation of nondeterministic finite automata, we consider the basis finite automaton for the given regular language and the paths and loops of its transition graph. We also consider the paths and loops of the transition graph of another nondeterministic automaton that defines the same language. On the basis of this, we define corresponding paths and loops of two mentioned automata and the questions of their classification. This classification gives, for example, the possibilities for describing some heuristic algorithms for minimization of nondeterministic automata. For the last thing, we describe the following objects. For each state of the basis automaton, we consider the states of the given automaton corresponding to this state of the basis automaton, and give their classification as a function of the loops passing through the same state of the basis automaton. Their subset is the set of so-called including loops, on the basis of which we determine so-called partially complete loops. For any chosen vertex of the basic automaton, we call the vertices of the considered nondeterministic automaton, through which all possible partially complete loops pass, by complete cyclic states. At the end of the paper, we formulate the hypothesis that if for any state of the considered nondeterministic automaton, there exists at least one corresponding state of the basis automaton, such that the first one is a complete cyclic state for the second one, then all the corresponding states of the basis automaton are such ones. In the presented Part II of the paper, we are considering issues of a special classification of states of any nondeterministic finite automaton. This classification is based on the application of developed in the first part of this paper classification of the loops.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «An approach to the classification of the loops of finite automata. Part II: the classification of the states based on the loops»

An approach to the classification of the loops of finite automata. Part II: The classification of the states based on the loops

B. F. Melnikov, A. A. Melnikova

Abstract—In this paper, we considered questions of the possible classification of the states and loops of a nondeterministic finite automaton.

For the development of algorithms for equivalent transformation of nondeterministic finite automata, we consider the basis finite automaton for the given regular language and the paths and loops of its transition graph. We also consider the paths and loops of the transition graph of another nondeterministic automaton that defines the same language. On the basis of this, we define corresponding paths and loops of two mentioned automata and the questions of their classification. This classification gives, for example, the possibilities for describing some heuristic algorithms for minimization of nondeterministic automata.

For the last thing, we describe the following objects. For each state of the basis automaton, we consider the states of the given automaton corresponding to this state of the basis automaton, and give their classification as a function of the loops passing through the same state of the basis automaton. Their subset is the set of so-called including loops, on the basis of which we determine so-called partially complete loops. For any chosen vertex of the basic automaton, we call the vertices of the considered nondeterministic automaton, through which all possible partially complete loops pass, by complete cyclic states.

At the end of the paper, we formulate the hypothesis that if for any state of the considered nondeterministic automaton, there exists at least one corresponding state of the basis automaton, such that the first one is a complete cyclic state for the second one, then all the corresponding states of the basis automaton are such ones.

In the presented Part II of the paper, we are considering issues of a special classification of states of any nondeterministic finite automaton. This classification is based on the application of developed in the first part of this paper classification of the loops.

Keywords—nondeterministic finite automata, basis automaton, transition graph, path, loop, algorithms for equivalent transformation, universal automaton.

This paper is a continuation of [1] (i.e., Part I). We consider the issues of a special classification of states of any nondeterministic finite automaton. This classification is based on the application of developed in Part I of this paper classification of the loops.

We continue the numeration of sections, definitions, figures, equations, etc. For the convenience of reading, we shall also repeat some figures and tables given already in [1], [2].

Received September 5, 2018.

Boris F. Melnikov, Russian State Social University (email: bf-melnikov@ yandex.ru).

Aleksandra A. Melnikova, National Research Nuclear University "MEPhl" (email: [email protected]).

For the designations of automata and its states on the figures, see the agreement of [3, Page3]. (We used this agreement also in all previous papers.)

VII. Sets ^(q), grids and pseudo-grids Definition 2: For each state q e Q, we shall denote

*(«) = <p%(q) x pT (q). □

In fact, this definition also defines a pseudo-grid; definitions and examples of pseudo-grids and grids were given in [4, Section 3]. Let us continue to consider regular language

(a + ab + ba)*. (9)

(i.e., [1, Eq. (5)]). We continue to consider two the following automata for this language:

• the canonical automaton of Fig. 12 (i.e., [1, Fig. 4]):

• automaton of Fig. 13 (i.e., [1, Fig. 6]):

We shall also consider a new automaton for the same language (9):

• automaton of Fig. 14, see below; for the considered language L, it is the universal automaton (see [5], [6], etc.), or automaton COM(L) (see [7], [8], etc.).

Fig. 14

As we said in [1], this language coincides with its mirror image, therefore the canonical automaton for its mirror image can be obtained replacing A, B and C for X, Y and Z respectively. Also like [1], [9], we marked values of state-marking functions for each state of the both non-canonical automata in abbreviated form: e.g., for automaton on Fig. 14, we have

<pout(qti) = {X, Y, Z}.

(Like before, these values can be obtained by the simple algorithms of [4, Section3].)

Continuing the calculations, we obtain that the following facts hold:

• state q1 of the first automaton and all three states of the second automaton form grids;

• states q2 and q3 of the first automaton form pseudo-grids.

Fig. 15

VIII. Corresponding loops and x-cyclic states Definition 3: Let for some states

q g Q, A g Qn and X g Qp

be

(A,X) G *(q).

Let there exist a X -loop of automaton BA(L) having corresponding long loop of automaton

K = (Q, V,6,S,F)

[1, Eq. (1)], passing q; moreover, let states

and q

A X

be corresponding in these loops. Then we shall call q by

A

x'

cyclic state.

For the last definition, there are very important two the following remarks.

• We do not require that this X -loop is simple.

• ^(q) may contain not only the pair (A, X). Therefore in the considered loops, q may also correspond to another state.

Let us consider some examples. For the same language (9), let us first consider its automaton BA(L), Fig. 15; this is automaton of [1, Fig. 5]. Let us also consider the "modified basis automaton" having a long loop (2-loop), Fig. 16; this is automaton of [1, Fig. 11]. It is simply to obtain, that the state-marking functions of automaton on Fig. 16 are also shown on that figure; e.g.,

out( B1) = Y,

Fig. 16

For the transition graph of automaton on Fig. 16, we have no loop corresponding to the loop

B X

A Y

B Y

B X

etc.

of BA(L). However, the last automaton includes corresponding long loop; that is

B , b A 1 a B 2 a B 2 b A 2 a B . a B . X 1 t y 1 t Y 2 t X 2 * Y 2 * Y 1 * X 1 •

E.g., A2 is A-cyclic state.

a

Thus, we think that Definition 3 is simple. Then in following examples, we shall not specify cyclic states.

In more complicated examples, there exist possibilities, when, informally speaking, properties of the both considered examples hold. For example:

• the considered automaton cannot be obtained from the basis one by "duplicating" its loops;

• for a loop of the basis automaton, there exists corresponding n-loop, but only for n > 1.

For this thing, let us consider the following examples (Fig. 17 and 18). These automata accept the same language. (As before, we show the values of state-marking functions.) Consider simple loop

A a B b A Y X Y

of automaton BA(L). Automaton on Fig. 17.

Fig. 17

has corresponding 2-loop

qi

•q2

•qi

•q-i

■qi

... has the same corresponding loop (11), and also corresponding 1-loop

q1

•q2

•q i.

But there exists examples, when (A, X ) g ^(q), but q is not X-cyclic state. Let us consider the following modification of automaton on Fig. 17 (i.e., Fig. 17'):

(10)

Fig. 17'

(For this automaton, we added a new final state f and the only edge

a r

q2 —>f;

all the other states and edges are the same. We can simply obtain, that

pin(f ) = {B} and pout(f ) = {X }.

The automaton defines the same language.)

Let us remark, that values of pin and pout for all the other states do not change. We show these values for states q2 and f only; it is important to remark, that value pout(q2) changes. Thus,

out(q2) 3 Y

(11)

(and has no corresponding 1-loops). And automaton on Fig. 18 (on this figure, we marked the added edges by the bold font) . . .

for obtained automaton, then

(B, Y) e ^(q2). But it is simple to prove, that q2 is not ^ - cyclic state.

IX. Once more about Waterloo language:

LONG LOOPS OF ITS BASIS AUTOMATON

Let us consider also so-called automaton Waterloo, [10]. The figures and tables of this section are given by [2]; about related problems, see also [5], [11], [12].

The given automaton is usually defined by the following transition graph, Fig. 19:

a №

a, b

Fig. 18

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Fig. 19

b

In this section, we shall denote its language by L. For it1, the following tables describe the equivalent basis automaton BA(L)...

Tab. 4

BA(L) a b

- A#Y E#X, E#P -

- A#Q E#W -

B#Y F #X,F #P -

B#V F #Z,F #R -

C#U G#S B#Y,B#V

C #V G#Z, G#R -

D#W C #U H #Z,H #S

D#P C #V -

- E#X - -

E#W C #U H #Z,H #S

E #P C #V -

- F#X - -

F #Z B#Y -

F #P B#V -

F #R - D#W, D#P

G#Z A#Y -

G#R - D#W, D#P

G#S A#Q -

H #Z A#Y -

H #S A#Q -

... and the equivalent universal automaton COM (L):

Tab. 5

COM(L) a b

1 6, 7, 8,14 -

2 8,14 -

3 8, 9,10,13,14 -

4 10,13 -

5 10,11,12,13 2, 3,4

6 4, 5 12,13

7 4, 5 12,13

8 4 -

9 2, 3,4 6,14

10 2 6,14

11 1, 2 6,14

12 1, 2 -

13 2 -

14 4 -

See details, e.g., in [2]; and in [1, Sect.II], we gave the agreement about of the states of basis automata, i.e., of their notation in the tables.

on the basis of these tables, we make the following constructions. Let us consider the loop

C a G b D a C V R P ^ V

of the basis automaton. For the specified automata and loop, there exist the following different corresponding 1-loops

5 —11 A 6 —5 and 4 —^ 10 14 —4,

and also corresponding 2-loop

■ a r\ b ~ a ^ a ^ b . a .

4 —> 10 —> 6 —> 5 —> 11 —> 14 —> 4 • Let us remark, that the last loop is simple.

1 And also for 10 states of the canonical automaton of language LR: X (the initial state), Y, Z, U, V, W, P, Q, R, S.

We usually denote such an automaton by LR. But we shall not use automaton LR in this paper (we shall use its states only).

The states of automaton COM(L) are the numbers from 1 to 14.

X. rf-PROPER LOOPS Definition 4: Let some

a C Qn, ft C Qp and ^ = a x ft.

Let us consider a loop v of automaton BA(L). Let there exist a corresponding long loop v of automaton

K = (Q, E, 5, S, F)

[1, Eq. (1)] containing a state q, such that

*(q) =

Then we shall call v by rf--proper loop.

For it, all such its states q (i.e., the states of the considered type) are called (v, rf)-proper states. □

The following remark is very important, it is illustrated by the examples considered below. Usually, state q is a priori given, and ^ = ^(q). If so, then we allow both the cases

q' = q and q' = q.

Therefore, e.g., an ^(q)-proper loop may contain and may not contain q.

As we said before, automaton on Fig. 17 has corresponding 2-loop for loop (10). But, certainly, (10) is

a {b}x{x, z}-proper A -loop (for this automaton). Similarly, for automaton on Fig. 18, loop (10) is a {B}x{x,z}-proper a -loop.

Also, for automaton on Fig. 18, the same loop is a {b}x{x, Y, z}-proper A -loop

and

A

a {A,b}x{x,y}-proper a-loop.

XI. (X , q)-PARTIALLY COMPLETE LOOPS

The examples of the previous section lead to the need to consider the following definition.

Definition 5: Let:

• q be X - cyclic state;

• v be some ^(q)-proper X -loop of BA(L) (remark that, therefore, q is a (v, ^(q))-proper state);

• there exists corresponding long q-loop v of automaton (1), which contains no other (v, ^(q))-proper state.2

Then we shall call v by , q)-partially complete loop. □

Let us continue to consider previous examples. For both automata (on Fig. 17 and Fig. 18), we consider state qi as A-cyclic state and loop (10).

Both automata on Fig. 17 and 17' have the only corresponding long q1-loop, i.e., (11); besides, (11) contains another state (i.e., q'), which is also

((10), ^(q^)-proper state. Then for these automata, loop (10) is not (A, q0 -partially complete loop.

And automaton on Fig. 18 has another corresponding long q'-loop, i.e.,

ab

qi —> q2 —> qi •

2 Here, we use not the terminology that we have introduced, but the usual terms of the graph theory. Then q-loop is simply a loop which includes state q. Notice that we do not require, that this long q-loop is 1-loop. (See Part I of this paper about n-loops for n > 1.)

The last loop contains no other

((10), ^(qi))-proper states

(qi only), therefore it is a (A, qO-partially complete loop. Quite similarly, the considered loop (10):

• is not (X, q2) -partially complete loop for automaton on Fig. 17;

• and is (B ,q2) -partially complete loop for automaton on Fig. 18.

However,

• it is also a (A, q2) -partially complete loop for automaton on Fig. 17', because for this automaton, ^(q2) =

*(q2).

corresponds, for example, to

XII.

Definition 6: Let:

A

X

- CYCLIC STATES

q be A - cyclic state; each

^(q)-proper A -loop of automaton BA(L) be (A ,q)-partially complete loop.

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Then we shall call q by complete A-cyclic state

x

B X

A Y

B Y

B X

or, rather, XB

A Y

B Y

B X

A Y

B Y

B X

q2 —> qi

And the loop

q1

b a / a /

• qi —> q3 —> q- —> q2

B a B b A b c a A a B X Z ^ X ^ Y ^ Y X

abbaa

q2 —> q2 —> qi —> q3 —> q- —> qi

corresponds, for example, to

I a 1 b

q2 —> q2 —> qi-

Thus, both the considered loops are

[B}x{X,Y,Z}-proper A -loops,

because:

• the considered corresponding loops of automaton on Fig. 20 do not contain q2;

• besides, q2 is the only other state of this automaton, such that ^(q2) = ^(q2).

However, there is simple to prove, that the loop

B b A a B X * Y * X

(12)

The automata of previous subsections gives only some simple examples of complete cyclic states. E.g., for automaton on Fig. 17, we obtain complete cyclic states only for q3: otherwise (i.e., for another q = q3 and some selected state A of the equivalent basis automaton), we can specify a loop which is not (A, q)-partially complete; then each q = q3 is not (A, q)- cyclic complete. Generally, for considered automata, there are complete states only if there are no other states with the same value

Let us consider the last example, i.e., automaton on Fig. 20 (compare Fig. 18):

is not [B}x{X,Y,Z}-proper. Then state q2 is not complete

X

- cyclic one.

Fig. 20

This automaton also defines the same language (9). Then, like all the examples considered before, we can use the above automata 64(L) and COM (L), and also their loops.

For the last automaton of Fig. 20, let us consider the loops corresponding to simple X -loops (or their powers) of automaton BA(L), where X corresponds to q2. The loop

XIII. SETS <»(q) AND AN IMPORTANT HYPOTHESIS

The examples of the previous section lead to the need to consider the following definition.

Definition 7:

#(q) = { (A, X) e ^(q) I q is complete A -cyclic state }.

For each of the considered examples, the set ,&(q) is either empty or equal to ^(q). But, as we said before, we cannot give interesting examples (i.e., when for the considered language ^(q) = ^(q)). The informal explanation of this fact is the following.

• Automaton BA(L) for this language has the only strongly connected component (see [13], [14], etc.).

• Let us suppose, that there exists a pair of states (A, q) for which q is complete (A, q) - cyclic, then there exists a loop of BA(L) which is not complete (A, q)-cyclic. Let this loop be z>.

• Then (owing to the only strongly connected component) we can consider > as a part of some A -loop for any state A, where A may be absent in >. (Because we consider not only simple loops, see before.)

Thus, automata BA(L) have (in our examples) the only strongly connected components. We shall not consider other examples (i.e., automata BA(L) having 2 or more strongly connected components) because such examples are heavy. Omitting the detailed explanation, we already considered the language L, for which automaton BA(L) has 4 strongly connected components; this was the language defined by automaton of [1, Fig. 1] (or [4, Fig. 1]). However, each of the other automata usually considered by us (i.e., automata

L, LR (L«)R, COM(L)

for its language L) has 1 strongly connected component only. This is easily verified from the tables of [1], [4].

A

Let us formulate the above of this section in the form of the following hypothesis.

Hypothesis 1: For each state of any nondeterministic finite automaton

K = (Q, E, 5, S, F)

[1, Eq. (1)], one of the following two equalities holds:

• either #(q) = 0;

• or #(q) = ^(q). □

XIV. Conclusion. Possible directions

FOR THE FURTHER RESEARCH

Thus, we have considered a possible approach to classification states and loops of a nondeterministic finite automaton. Let us note once again that, that unlike [9] devoted to an approach to the classification of languages, in this paper we have considered various nondeterministic finite automata defining some given language. We believe that the description of such relationship (correspondence) between the loops of an nondeterministic automaton and the loops of the equivalent basis automaton makes it possible to solve both "purely theoretical", and "purely practical" problems of the formal languages theory.

About "purely practical" problems, we have written in our previous publications, in particular, in papers cited in this one; moreover, some of them ([2], [7], [8]) are devoted directly to the practical application of the developed algorithms. We have in the first place the description of heuristic minimization algorithms by several different criteria. We think also, that many questions of the formal languages theory can be considered "located between theoretical and practical problems".

We also are going to continue our previous publications (see also [15]) to describe the alternative approach to solving the star-height problem.3 Very briefly, it can be described as follows.

After defining the star height for an automaton, considering all the possible orders of its states and making regular expressions for each order in the usual way, we show, that we can construct corresponding automaton for each regular expression, and therefore we can do this thing for a hypothetical regular expression defining the given regular language and having minimum possible star-height. Thus, there exists the minimum possible value of star-height for some hypothetical automaton defining the given regular language; let this automaton be K. We consider not only K, but also the concrete order t of its states defined in [15], corresponding to the regular expression having minimum possible star-height.

Considering the states of K in the order t, we obtain for the next state one of the three following things. Either each its loop has equivalent one which does not pass the considered state. or there exists some other state, which has the smaller value of the order t and defines the same loops. Or we can add some edges to obtain one of previous cases.

Using a finite sequence of such steps, we obtain the automaton, which is equivalent to the given one; moreover, we can a priory limit the number of states of such "minimum"

3 These two papers, as well as Part II presented here, may seem unrelated to each other. However, in their sections titled "Motivation", we briefly described this relationship.

automaton, using the knowledge of the given language only. Thus, this sequence of steps gives the nondeterministic finite automaton having a priori limited number of states, defining the given regular language and having the minimum possible star-height.

References

[1] Melnikov B. and Melnikova A. An approach to the classification of the loops of finite automata. Part I: Long corresponding loops. International Journal of Open Information Technologies. 2018, vol. 6, no. 9, pp. 9-14.

[2] Melnikov B. and Tsyganov A. The state minimization problem for nondeterministic finite automata: The parallel implementation of the truncated branch and bound method. Proceedings of the International Symposium on Parallel Architectures, Algorithms and Programming, PAAP-2012. Taipei, Taiwan. 2012, pp. 194-201.

[3] Melnikov B. and Melnikova A. Pseudo-automata for generalized regular expressions. International Journal of Open Information Technologies. 2018, vol. 6, no. 1, pp. 1-8.

[4] Melnikov B. Once more on the edge-minimization of nondeterministic finite automata and the connected problems. Fundamenta Informaticae. 2010, vol. 104, no. 3, pp. 267-283.

[5] PolakL. Minimalizations of NFA Using the Universal Automaton. International Journal of Foundations of Computer Science. 2004, vol. 16, no. 5, pp. 457-504.

[6] Lombardy S. and Sakarovitch J. The Universal Automaton. Logic and Automata, Texts in Logic and Games, Amsterdam Univ. Press. 2008, vol. 2, pp. 457-504.

[7] Dolgov V. and Melnikov B. Postroenie universal'nogo konechnogo avtomata. I... [The construction of a universal finite automaton. Part I: From theory to practical algorithms]. Vestnik of Voronezh State University. 2013, no. 2, pp. 173-181. (in Russian, https://elibrary.ru/item.asp?id=2 02 67 92 4)

[8] Dolgov V. and Melnikov B. Postroenie universal'nogo konechnogo avtomata. II... [The construction of a universal finite automaton. Part II: Examples of work of algorithms]. Vestnik of Voronezh State University. 2014, no. 1, pp. 78-85. (in Russian, https://elibrary.ru/item.asp?id=21445963)

[9] Melnikov B. The complete finite automaton. International Journal of Open Information Technologies. 2017, vol.5, no. 10, pp.9-17.

[10] Kameda T. and Weiner P. On the state minimization of nondeterministic finite automata. IEEE Transactions on Computers. 1970, vol.C-19, no. 7, pp. 617-627.

[11] Jiang T. and Ravikumar B. Minimal NFA problems are hard. SIAM Journal on Computing. 1993, vol.22, no.6, pp. 1117-1141.

[12] Yo-Sub Han. State elimination heuristics for short regular expressions. Fundamenta Informaticae. 2013, vol. 128, pp. 445-462.

[13] Harary F. Graph Theory. Addison Wesley (Boston), 1969, 274 p.

[14] Gera R., Hedetniemi S., and Larson C., editors. Graph Theory: Favorite Conjectures and Open Problems — 1. Springer, 2016, 291 p.

[15] Melnikov B. The star-height of a finite automaton and some related questions. International Journal of Open Information Technologies. 2018, vol.6, no.7, pp. 1-5.

Boris Feliksovich MELNIKOV, Professor of Russian State Social University

(http://www.rgsu.net/), email: [email protected], mathnet.ru: personid=27967, elibrary.ru: authorid=15715, scopus.com: authorId=55954 04 030 0.

Aleksandra Aleksandrovna MELNIKOVA,

Associated Professor (Docent)

of National Research Nuclear University "MEPhI"

(https://mephi.ru/),

email: [email protected],

elibrary.ru: authorid=14 3351.

i Надоели баннеры? Вы всегда можете отключить рекламу.