
ITAT 2013 Proceedings, CEUR Workshop Proceedings Vol. 1003, pp. 94–100 http://ceur-ws.org/Vol-1003, Series ISSN 1613-0073, c 2013 G. Jirásková, M. Palmovský Kleene Closure and State Complexity 1, 2, Galina Jirásková ∗ and Matúš Palmovský † 1 Mathematical Institute, Slovak Academy of Sciences Grešákova 6, 040 01 Košice, Slovakia 2 Institute of Computer Science, Faculty of Science, P.J. Šafárik University Jesenná 5, 040 01 Košice, Slovakia Abstract: We prove that the automaton presented by In this paper we give a proof of Maslov’s result and we Maslov [Soviet Math. Doklady 11, 1373–1375 (1970)] fix an error in his paper [8] by proving that Maslov’s au- meets the upper bound 3/4 2n on the state complexity tomaton meets the upper bound 3/4 2n. Then we show · n 1 n 1 k · of Kleene closure. This fixes a small error in this paper that the upper bounds 2 − + 2 − − are tight for every n that claimed the upper bound 3/4 2n 1. Our main re- and k with 1 k n 1. This is the main result of our · n −1 n 1 k ≤ ≤ − sult shows that the upper bounds 2 − + 2 − − on the paper. The witness automata are defined over a binary al- state complexity of Kleene closure of a language accepted phabet. The size of the alphabet is optimal since the state by an n-state DFA with k final states are tight for every complexity of Kleene closure over a unary alphabet is only k in the binary case. We also present some results of (n 1)2 + 1. our calculations. We consider not only the worst case, In− the second part of our paper we consider not only but we study all possible values that can be obtained as the worst case, but rather study all possible values that can the state complexity of Kleene closure of a regular lan- be obtained as the number of states of the minimal DFA guage accepted by a minimal n-state DFA. Using the lists recognizing the Kleene closure of a regular language rep- of pairwise non-isomorphic binary automata of 2,3,4, and resented by a minimal n-state DFA. The problem is known 5 states, we compute the frequencies of the resulting com- as "the magic number problem" in the literature, and so plexities for Kleene closure, and show that every value in called "magic numbers" are exactly the "holes" in the hi- the rangefrom1 to 3/4 2n occurs at least ones. In the case erarchy that cannot be obtained in such a way. of n = 6,7,8, we change· the strategy, and consider binary The problem was first stated for NFA to DFA conversion automata, in which the first symbol is a circular shift of by Iwama, Kambayashi, and Takaki in [5]. It is known the states, and the second symbol is generated randomly. that in the ternary case, no magic numbers exist, that is, We show that all values from 1 to 3/4 2n are attainable, each value from n to 2n may be obtained as the size of the that is, for every m with 1 m 3/4 2n·, there exists an n- minimal DFA equivalent to a given minimal n-state NFA ≤ ≤ · state binary DFA A such that the state complexity of L(A)∗ [7]. On the other hand, it is known that in the unary case, is exactly m. magic numbersexist [3], but we do not know which values are magic. The binary case is still open. For Kleene closure, the possible resulting vales are in 1 Introduction the range from 1 to 3/4 2n, for an alphabet of at least two symbols, and in the range· from 1 to (n 1)2 + 1 fora Kleene closure is a basic operation on formal languages unary alphabet, and it is known that for a growing− alphabet which is defined as of size 2n, no magic numbers exist [6]. Here we study the binary case. Using the lists of pair- L∗ = w w = v1v2 vk,k 0,vi L for all i . { | ··· ≥ ∈ } wise non-isomorphic automata of 2,3,4, and 5 states, we It is knownthat if L is recognized by an n-state determinis- compute the frequencies of the resulting complexities for tic finite automaton (DFA), then the language L∗ is recog- Kleene closure, and show that every value in the range nized by a DFA of at most 3/4 2n states [8, 13]. The first from 1 to 3/4 2n occurs at least ones. We display our · worst-case example meeting this· upper bound was pre- results in graphs, and compute the average complexity. sented already by Maslov in 1970 [8]. However, he did In the case of n = 6,7,8, we change the strategy, and a small error and did not give any proof in his paper. consider binary automata, in which the first symbol is a Later, Yu, Zhuang, and Salomaa [13] proved that the circular shift of the states, and the second symbol is gen- size of the minimal DFA for Kleene closure depends on erated randomly. We consider an arbitrary number of final the number of final states of a given DFA, and that the states. We show that all values from 1 to 3/4 2n are attain- · upper bound is 2n 1 + 2n 1 k, where k is the number of able, and we show that for every m with 1 m 3/4 2n, − − − ≤ ≤ · final and non-initial states. there exists an n-state binary DFA A such that the state complexity of L(A)∗ is exactly m. ∗Research supported by grants VEGA 2/0183/11, APVV-0035-10. †Research supported by grants VEGA 2/0183/11, APVV-0035-10. Kleene Closure and State Complexity 95 Thus our calculations show, that in the binary case, up by N only from the state q. Then the subset automatoncor- to n = 8, no magic numbers exists. Moreover, for every n, responding to the NFA N does not have equivalent states. the numbers 1, n,and2n 1 +2n 1 k with 1 k n 1 are − − − ≤ ≤ − attainable by the complexity of Kleene closure. The situa- Proof. Let S,T be subsets of states of N, where S = T. tion is completely differentin the case of a unary alphabet, Without loss of generality, there exists a state q such that where two holes of length n exist for every n [2]. q S and q / T. Then the string wq is accepted from S but ∈ ∈ wq is not from T . Hence S and T are not equivalent. 2 Preliminaries For languages K and L the concatenation K L is defined Σ Σ ·k Let be a finite alphabet and ∗ the set of all strings over as K L = uv u K,v L . The language L with k 0 Σ. The empty string is denoted by ε. The length of a string is defined· inductively{ | ∈ by∈L0 }= ε , L1 = L, Li+1 = Li ≥L. w is w . A language is any subset of Σ . We denote the { } · | | ∗ size of a set A by A , and its power-set by 2A. Definition 1. The Kleene closure of a language L is the | | A deterministic finite state automaton is a quintuple language L∗ defined as A = (Q,Σ,δ,s,F), where Q is a finite set of states; Σ is a δ i finite set of input symbols; is the transition function that L∗ = L . takes as arguments a state and an input symbol and returns i[0 a state; s is an element of Q called the initial state; F is ≥ the set of final states (or accepting states), F Q. The ⊆ language accepted or recognized by the DFA A is defined 3 NFA for Kleene Closure as the set L(A)= w Σ∗ δ(s,w) F . A nondeterministic{ ∈ finite| automaton∈ }is a quintuple A = (Q,Σ,δ,s,F), where Q,Σ,s, and F are the same as for a In this section we describe the construction of a nonde- DFA, and δ is the transition function that takes a state in Q terministic automaton recognizing the Kleene closure of a and an input symbol in Σ as arguments and returns a subset given language reprezented by DFA. of Q. The language accepted or recognized by the NFA A Let A = (Q,Σ,δ,s,F) be the minimal DFA accepting is defined as the set L(A)= w Σ∗ δ(s,w) F = /0 . a language L. Construct an NFA A∗ for the language L∗ Two automata are equivalent{ ∈if they| recognize∩ the same} from DFA A as follows: language. A DFA A is minimal if every equivalent DFA has at For each state q in Q and each symbol a in Σ such that • least as many states as A. It is known that every regular δ(q,a) F, add the transition on a from q to s. ∈ language has a unique, up to isomorphism, minimal DFA, Σ δ and that a DFA A = (Q, , ,s,F) is minimal if an only if If s / F, then add a new start state q0 to Q and make • this∈ state accepting. For each symbol a in Σ add the (i) all its states are reachable, that is, for every state q in transition on a Q, where exists a string w in Σ∗ such that δ(s,w)= q; and from q0 to δ(s,a) if δ(s,a) / F, and ∈ (ii) no two distinct states are equivalent; two states p and from q0 to δ(s,a) and from q0 to s if δ(s,a) F.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-