Научная статья на тему 'Some more on the equivalent transformation of nondeterministic finite automata. Part I. notation and the “combining” algorithm'

Some more on the equivalent transformation of nondeterministic finite automata. Part I. notation and the “combining” algorithm Текст научной статьи по специальности «Математика»

CC BY
82
11
i Надоели баннеры? Вы всегда можете отключить рекламу.
Область наук
Ключевые слова
NONDETERMINISTIC FINITE AUTOMATA / REGULAR LANGUAGES / EQUIVALENT TRANSFORMATIONS / COMBINING STATES / THE STARHEIGHT / PROBLEM

Аннотация научной статьи по математике, автор научной работы — Melnikov Boris Feliksovich

This paper can be viewed as a continuation of our following previous papers, where we considered some simple algorithms for combining states of the given nondeterministic finite automaton, the reduction some problems related to the star-height to considering automata, and possible classification of the states and loops of the given automaton. In this paper, we shall describe an algorithm which combines some states of a given nondeterministic finite automaton. However, unlike algorithms published before, we have more stringent requirements for two combined states of the considered automaton. Besides, we obtain (after combining these two states) the automaton, which is not only equivalent to the given one, but also has the value of star-height which is no more than such value for the given automaton. We also consider an example of using the described combining algorithm. In the following parts of this paper, we are going to describe the algorithms for deleting and adding a state. These algorithms will have the same features of transformations, i.e. the values of star-height for the obtained automata will be no more than such value for the given automaton.

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

Текст научной работы на тему «Some more on the equivalent transformation of nondeterministic finite automata. Part I. notation and the “combining” algorithm»

Some more on the equivalent transformation of nondeterministic finite automata. Part I. Notation and the "combining" algorithm

B.F. Melnikov

Abstract—This paper can be viewed as a continuation of our following previous papers, where we considered some simple algorithms for combining states of the given nondeterministic finite automaton, the reduction some problems related to the star-height to considering automata, and possible classification of the states and loops of the given automaton.

In this paper, we shall describe an algorithm which combines some states of a given nondeterministic finite automaton. However, unlike algorithms published before, we have more stringent requirements for two combined states of the considered automaton. Besides, we obtain (after combining these two states) the automaton, which is not only equivalent to the given one, but also has the value of star-height which is no more than such value for the given automaton. We also consider an example of using the described combining algorithm.

In the following parts of this paper, we are going to describe the algorithms for deleting and adding a state. These algorithms will have the same features of transformations, i.e. the values of star-height for the obtained automata will be no more than such value for the given automaton.

Keywords—nondeterministic finite automata, regular languages, equivalent transformations, combining states, the star-height problem.

I. INTRODUCTION AND MOTIVATION

This paper can be viewed as a continuation of our previous papers:

[1]: we considered there some simple algorithms for combining states of the given nondeterministic finite automaton;

[2]: we considered there some applications of such algorithms; in particular, we constructed any automaton for the given regular language using special equivalent transformations of the basis automaton (see [3] etc.) for this language;

[4]: we described there an alternative proof of Kleene's theorem; on the basis of this proof, we reduced some problems related to the star-height to nondeterministic finite automata;

[5]: we considered there some questions of the possible classification of the states and loops of a nondeterministic finite automaton;

[6]: we continued there the classification mentioned in the previous item; we also defined some terms associated with the loops of the transition graph of the basis automaton for the given regular language (i.e. we defined so-called including loops, partially complete loops and

Received February 2, 2019.

Boris F. Melnikov, Russian State Social University & Lomonosov Moscow State University (email: [email protected]).

complete cyclic states) and considered some properties of these objects; after that, we formulated an important hypothesis about them; [7]: we led there the possible application of this theory using the results of some papers, published before in Russian.

In the current paper, we change the process of presentation of the whole material, provide some other proofs and consider more examples.

By [4], we reformulated the star-height problem for regular languages in the following way: for the given regular language, we have to construct the equivalent finite automaton having the minimum possible star-height. After that, considering n! bijective functions ("order functions"; the value n is the number of states of this automaton), we construct corresponding regular expressions and choose the expression having the minimum possible star-height. Thus, a possible solution of the star-height problem for regular language is constructing such "minimum" automaton. To build such an automaton, we perform some equivalent transformations; they are described in the papers cited before and in this paper. These description of such transformations is the main subject of this paper.

It follows from the title of this paper (more precisely, its Part I), that we shall describe an algorithm which combines some states of a given nondeterministic finite automaton. However, unlike [1], [2]:

• we have more stringent requirements for the states of the considered automaton;

• on the other hand, we obtain (after combining two states) the automaton, which is:

- not only equivalent to the given one,

- but also has the value of star-height which is no more than such value for the given automaton.

In the remaining parts of the paper, we shall consider the similar features of transformations, but for other algorithms.

This paper has the following structure. In Section II, we describe in detail the notation used in this paper; this notation is almost the same as one used, for example, in [1], [4], [5], [8]. In Section III, we add some designations related with ordering functions used for the states of considered automaton. In Section IV, we add the notation connected with adding / deleting states / edges for the considered automaton.

In Section V, we describe an algorithm which combines two states of the considered automaton. After its using, we obtain new automaton which is equivalent to the given one and also has the value of star-height which is no more than such value for the given automaton. And in Section VI we

consider an example for the combining algorithm described before.

In the following parts of this paper, we are going to describe the algorithms for deleting and adding a state.

II. Preliminaries

In this section, we shall describe in detail the notation used in this paper. This notation is almost the same as one used in [1], [4], [5], [8] etc.

Like most of the cited papers, the "main" automaton under consideration will be denoted by

K = ( Q, E,S,S,F). (1)

We shall consider transition function S of automaton (1) as

S : Q x E ^ V(Q),

but not as

S : Q x (E Uje}) ^V(Q),

The language of this automaton is L = L(K).

We shall write some edge S(q, a) 3 r in the form q —^ r,

s

or, if it does not cause discrepancies, simply in the form q —^ r. Sometimes, we shall consider the transition function S as the set of such edges.

The mirror automaton for the automaton given in (1), i.e.

where

q —> q

sR

(Q, S,^, ),

if and only if q''

•q

will be denoted by KR; note that KR defines the language

LR.

For the considered regular language L, its automaton of canonical form will be denoted by L. Let automata L and LR for the given language L be as follows:

and

L = (Qn, E,JW, {sn},Fn)

LR = (Qp, S,^, {sp},Fp).

0, then both these

We do not consider the language L automata have initial states.

Let us recall definitions of binary relation # and state-marking functions and Relation

# C Qn x Qp

is defined for pairs of states of automata L and LR in the following way: A # X if and only if

^R

(X )).

(3wv e L) (u e £~(A), State-marking function

<Pk : Q ^ V(Qn)

is defined in the following way:

^n(q) 3 9 if and only if Ln(q) n4n(3) = 0. And state-marking function

^r : Q ^ V(Qp)

is defined similarly for automata KR (the mirror automaton for K) and LR.

The definition for basis automaton for the given regular language L could be found in [3] etc. In this paper, it will be denoted by

BA(L) = (Q, ).

Binary relation # defined in the above manner forms also the set of so-called pseudo-grids: namely, each of them is a pair (P, R) (where P C Qn and R C Qp), such that for each pair of states p e P and r e R condition p#r holds. Each of such pseudo-grids corresponds to the state of any particular automaton for the given language. Moreover, the necessary condition for defining the given language by a finite automaton is that the subset of pseudo-grids corresponding to the set of states of considered automaton cover all the items of the relation #.

And if for some pseudo-grid (P, R) we can not extend neither set P nor the set R in order to not violate the definition of a pseudo-grid, then we call such a pseudo-grid by a grid. In fact, we use pseudo-grids in this paper.

Thus, we can assume that by considering some given regular language L, we simultaneously introduce the notation for the related language:

• two canonical automata (i.e., L and LR), and also their states, their transition functions etc.;

• binary relation # defined on pairs of states of automata L and LR;

• state-marking functions and

• equivalent basis automaton B4(L);

• equivalent automaton COM(L).1

If the transition graph of automaton (1) includes a path from q' e Q to q" e Q, we shall write V(q', q"). If

V(q', q'') and V(q'',q'),

then we shall write W (q', q''). We shall complete these definitions in the next section.

For the further, also the papers [5], [6] are important. We considered there some questions of the possible classification of the states and loops of a nondeterministic finite automaton. For this, we consider the basis finite automaton for the given regular language ([1] etc.) 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; that is (1) in our notation. On the basis of this, we define corresponding paths and loops of two mentioned automata and the questions of their classification.

We also described the following objects there. For each state of the basis automaton, we consider the states of (1) 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. (See in [5], [6] the more detailed classification of states and loops.)

1 Directly, automaton COM(L) is not used in this paper. However, the "minimum" automaton considered in this paper can be defined as the sub-automaton of COM(L).

In the end of the section, we shall describe the procedure of combining two states (see this notation in [1, Sect. 2]). According to the name of the part of the paper, this designation is one of the main.

Definition 1: For the automaton (1) and some its states € Q, let us denote by Jqiq2(K) automaton, which transition graph is obtained from the transition graph of automaton K in the following way2:

• for each vertex r € Q, we change the sets of edges of the type y(qi,r) for the sets 7(qi,r) U 7(92, r);

• for each vertex r € Q we change the sets of edges of the type y(r, q1) for the sets 7(r, q1) U 7(r, q2);3

• q2 is deleted, together with all the corresponding elements of the function 7.

In the obtained automaton, the vertex q1 is an initial (a final) vertex if and only if at last one of two vertices q1, q2 was an initial (a final) one for automaton K. □

III. Notations associated

WITH THE ORDER FUNCTION

In this section, we add some designations related with ordering functions used for the states of considered automaton. For the further, like [4], we shall use the order function t for the given automaton (1) of the type

t : Q ^ R+.

Using such functions, we defined in [4] the star-height of the finite automaton. We shall not repeat it in this paper (it is long), although we shall use it below. We shall suppose below, that the set Q is the following:

where

Q = {qi,q2,.. },

t(qi) < tte) < ... < t(q„).

max(p, r) =

|p, if t (p) > t (r) I r, if t(p) < t(r),

We set

Aq = { q' is a state of a path of Aq(q, q) and q' = q } . If Aq(p, r) = 0, then we shall write Vq (p, r) (otherwise

Vq (P,r)).

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

If Vq(p, r) and Vq(r,p), then we shall write Wq(p, r). □ Definition 3: Let us define the following sets Qm = { 9i,92,..., 9m-1 }

and

Tm {

and also their subsets

<3m = { 9 € Qm | ^(9) = ^(9m) }

and

Tm = { 9 € Tm | ^(q) = ^(9m) } . Let us define also the following sets of pairs:

^ m = U ^(9i).

qe<3m

A state is called important state, if the following condition holds:

(3(A,X) G #(qm)) ((A,X) G #m

We shall also write, e.g., p < r meaning t(p) < t(r), use "max" meaning

IV. Additional notation

We also shall use the following notation. It is connected with adding /deleting states/edges for the considered automaton.

Definition 4: For a state 9 € Q, let us define automaton K-q, Obtained from automaton (1) by deleting the state 9.5 For the edge r ^ t (this edge may be contained or may not be contained in the given transition function ¿), let us define automaton

K+(r —+ t) ,

obtained from automaton (1) by adding this edge. 6

etc. Let us fix K and t . Using these agreements and some value m € {1,..., n}, let us define the following sets, which complete the definitions of the previous section.

Definition 2: For some states q,p, r € Q, where p > 9 and r > q, let us consider some simple path from p to r,4 whose sequence of vertices is

fe 91,92,...,qs,r)

such that

s > 0 and (Vi € {1, ...,s})(9i >9). We shall denote the set of all such paths by Aq(p, r).

2 We consider this definition for the transition graph (having vertices marked by inputs and outputs), but not for elements of the 5-tuple (1). However, this definition is strict. If necessary, it can be reformulated for the objects of (1).

3 Thus, for each of 4 opportunities q',q" € {91,92}, each edge 7(9', 9'') D a becomes the loop 7(91, q1) D a.

4 We allow p = r. In this case, i.e., if p = r, it is a simple loop.

Definition 5: Let automaton (1) be given, besides, L(K) = L; then automaton

K' = ( Q', £,£',S',F')

will be called a quasi-subset of automaton K, if for some function w : Q' ^ Q the following conditions hold:

• for each state 9' € Q':

- if 9' € S', then w(q') € S;

- if 9' € F', then w(q') € F;7

• for each pair of states 9', r' € Q' and letter a € E:

- if q' —^ r', then w(q') —^ w(r'). □

Let us remark, that if an automaton is a subset of another one (i.e., it can be obtained by removing some states and edges), then it can be considered as its quasi-subset.

Proposition 1: Let automaton K' be a quasi-subset of automaton K. Then L(K') C L(K). □

5 We shall not formulate the strict definition of automata K-q (for various states 9), i.e. we shall not define their initial and final states and the transition functions: these definitions are obvious.

6 This designation will be used in the next parts of this paper.

7 It means that the state 9' can be an initial (a final) state, if the same property has the state ¡¿(9'). Similarly for the next item.

V. THE COMBINING ALGORITHM

In this section, we shall describe an algorithm which combines two states of the considered automaton. After its using, we obtain new automaton which is equivalent to the given one and also has the value of star-height which is no more than such value for the given automaton.

Thus, for the states of the given automaton (1) we shall use notation of Section III. Let also the order function t and the number m be given.

Theorem 1: Let q e Tm. Let also

Wqm (qm,q) (2)

or

V?m(qm,q) & V,m(q,qm). (3)

Consider automaton

K' = Jqmq (K).

Then

L(K') = L(K) and SH(K',t) <SH(K,t).

Proof. The first equality is a consequence of the theorem [1, Th. 1].

Let us prove the second fact. First, we note the following. According to the definitions given in [1], using notation Jqmq, we mean that the state q is deleted (and the state qm is kept). Besides, because the inequality t(qm) < t(q) holds (according to the agreements entered before, i.e. q e Tm), then after such deleting, we shall consider that state of two ones (q and qm), for which the value t is less.

For the first subcase (i.e. (2)), condition q e Aqm holds, then Aq C Aqm. Therefore by [4, Sect. III], we do not increase the star-height of the considered automaton when combining Jqmq.

For the second subcase (i.e. (3)), condition Aq n Aqm = 0 holds. Then, also combining the states q and qm, we obtain for the resulting automaton K' = Jqm q: for each pair consisting of states qi e Aq and q2 e Aqm, the following condition holds8:

Wqm (qm,q)

(otherwise, for the given automaton K one of the conditions would be met: Vqm (q1, q2) or Vqm (q2, q1)); therefore, we also do not increase the value of star-height of the considered automaton. □

Thus, having considered this case, as a result of the described transformations, we reduce the number of its states and do not increase its star-height. (In other words, the "combining" algorithm does not "complicate " the considered automaton.)

VI. An example of the combining algorithm

In this section, we shall consider an example for the combining algorithm described before. All the examples that we consider in this part of the paper and are supposed to be considered in the following parts are made on the basis of the basis automaton for the language of the regular expression

(a + a6 + 6a)*.

8 Automaton K' does not contain the state q; but in spite of this, we can consider the set of states Aq selected before.

More precisely, we shall consider a modified basis automaton, for which we "doubled" 3 states; we already considered it in [5, Fig. 9].

a la

A i i*- If * - fl*.

ï J

a S y 1Ï?a iaÏ v-P 1 ^

.a \a

Figure 1. The given automaton (for the language (a + ab + ba)*)

Certainly, dealing with the basis automata (and even automata obtained from them by "doubling" states) we cannot consider the complex examples: for instance, all the sets ^ and # for such examples will consist of 1 element only. However, as can be understood from the consideration of the example below, more complex examples are unlikely to be considered in the length of the article.

The next figure shows a possible function t:

Figure 2. The previous automaton and an order function for it

a

b

i.e.,

т(B l) = l, т(A l) =2, .. Owing to previous notation,

B l = qi, A l = q2,

Y

т ( X l) =9.

B

X l = q9.

Tab. 2

states of automaton SH(K, т )

to} 0

{q8,q9} 0

{q7,q8,q9} 0

{q6,q7,q8,q9} 1

fe^ ...,q9} 2

{q4,q5,...,q9} 2

fe^ ...,q9} 3

te^ ...,q9} 4

{qi,q2,...,q9} s

For this automaton and this function, we obtain the following values of star-height. This value is counted for the automaton including the specified states only and order function t given before. Let us especially remark, that this is SH(K, t) (for different automata K), but not SH(K).

Tab. 1

states of automaton SH(K, т )

to} 0

{q8 ,q9} 0

{q7,q8,q9} 0

{q6,q7 ,q8,q9} 1

iq4,q6,q7,q8,q9} 1

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

iq3,q4,q6 ,q7,q8,q9} 2

{q2 ,q3,q4,q6,q7,q8 ,q9} 3

{qi,q2,q3,q4 ,q6,q7,q8,q9} 4

(we defined SH(0*) = 0, see [4] etc.).

Remark once again, that we consider not the star-height of the considered automata, and certainly not star-height of its languages9, but values SH(K, t).

Then let m =1, then q1 = B 1 and q = q5 = B 2 (i.e., we shall combine these states). After combining, we obtain the following automaton:

Figure 3. The previous automaton after combining 91 = ^ 1 and 95 = ^ 2

For the last automaton, let us obtain the similar table for the values SH(K, t ) (we can use the same function t, despite the automaton does not contain the state q5):

9 As we know, the star-height of the language (a + ab + ba)* is equal to 1. We also can prove, that the star-height of each language of 9 automata considered before is no more than 1.

Certainly, the value SH(K, т ) does not increase compared to the same value for Tab. 1.

ON THE FOLLOWING PARTS OF THIS PAPER

As we said in Introduction, we are going to describe the algorithms for deleting and adding a state in the following parts of this paper. It is important to note the following: from our point of view, even the "adding" algorithm does not "complicate" the considered automaton; the details will be described later.

REFERENCES

[1] 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.

[2] Melnikov B., and Sayfullina M. On some algorithms for the equivalent transformation of nondeterministic finite automata. Izvestiya of Higher Educational Institutions. Mathematics. 2009, no. 4, pp. 67-72. (in Russian, https://elibrary.ru/item.asp?id=1174 9888)

[3] Melnikov B., and MelnikovaA. Some properties of the basis finite automaton. The Korean Journal of Computational and Applied Mathematics (Journal of Applied Mathematics and Computing). 2002, vol. 9, no. 1. pp. 13S-1S0.

[4] 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-S. (http://injoit.org/index.php/j1/article/view/5 81)

[5] 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. (http://injoit.org/index.php/j1/article/view/613)

[6] Melnikov B., and MelnikovaA. An approach to the classification of the loops of finite automata. Part II: The classification of the states based on the loops. International Journal of Open Information Technologies. 2018, vol.6, no. 11, pp. 1-6. (http://injoit.org/index.php/j1/article/view/620)

[7] Melnikov B. On the star-height of a regular language. Part IV: The detailed description of the algorithm of equivalent transformation. Heuristic algorithms and distributed calculations. 2014, vol.1, no. S, pp. S7-7S. (in Russian, https://elibrary.ru/item.asp?id=23033967)

[8] Melnikov B. Extended nondeterministic finite automata. Fundamenta Informaticae. 2010, vol. 104, no.3, pp.2SS-26S.

Boris Feliksovich MELNIKOV, Professor of Russian State Social University

(http://www.rgsu.net/),

Professor of Lomonosov Moscow State University

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

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