Complementing Büchi Automata with a Subset-tuple Construction

Size: px
Start display at page:

Download "Complementing Büchi Automata with a Subset-tuple Construction"

Transcription

1 DEPARTEMENT D INFORMATIQUE DEPARTEMENT FÜR INFORMATIK Bd de Pérolles 90 CH-1700 Friourg WORKING PAPER Complementing Büchi Automt with Suset-tuple Construction J. Allred & U. Ultes-Nitsche Internl working pper no Mrch 2015

2 Complementing Büchi Automt with Suset-tuple Construction Joel Allred Deprtment of Informtics University of Friourg, Switzerlnd E-Mil: Ulrich Ultes-Nitsche Deprtment of Informtics University of Friourg, Switzerlnd E-Mil: Astrct Complementtion of Büchi utomt is well known for eing difficult. In the worst cse, stte-spce growth of (0.76n) n is unvoidle. Recent studies suggest tht simpler lgorithms perform etter thn more involved ones on prcticl cses. In this pper, we present simple direct lgorithm for complementing Büchi utomt. It involves structured suset construction (using tuples of susets of sttes) tht produces deterministic utomton. This construction leds to complementtion procedure tht resemles the strightforwrd complementtion lgorithm for deterministic Büchi utomt, the ltter lgorithm ctully eing specil cse of our construction. I. INTRODUCTION Checking ω-lnguge continment is importnt in liner-time temporl verifiction. For ω-lnguges B nd P, testing B P is done lgorithmiclly y testing B P =, where P is the complement of P. If P is regulr nd represented y Büchi-utomton, Büchi-utomton representing P cn e constructed effectively. In the worst cse, the utomton for P hs (0.76n) n mny sttes [1], where n is the numer of sttes of the utomton for P. Complementtion of Büchi utomt is difficult ecuse in generl, Büchi utomt cnnot e mde deterministic. Complementtion of deterministic Büchi utomton A is, however, quite simple: construct copy of A, remove ll ccepting sttes in the copy, mke the remining sttes in the copy ccepting sttes, mke ll sttes in A non-ccepting, nd finlly llow nondeterministiclly moving from A to corresponding sttes in its copy. So the complement utomton to deterministic Büchi utomton consists of two deterministic utomt (let s cll them n upper nd lower utomton, if we ssume tht one is drwn elow the other) with trnsitions from upper to the lower utomton ut no trnsitions ck from the lower to the upper one. We dpt this construction to nondeterministic utomt y constructing deterministic version of given utomton tht then Büchi-ccepts different ω-lnguge ut cn still e used in construction similr to the one for deterministic Büchi-utomt to produce complement utomton. It results gin in n utomton consisting siclly of two deterministic utomt tht re then comined y llowing to move nondeterministiclly from the upper to the lower one ut not vice vers. The run nlysis tht we developed independently s some similrities with the nlysis y Fogrty, Kupfermn, Vrdi, nd Wilke [2] who elegntly trnslte the slice-sed pproch in [3] to rnk-sed pproch. Insted of unifiying interim constructions, we directly construct complement utomton using the sole nlysis of the runs of the originl utomton, in similr wy deterministic Büchi utomt re complemented. When developing our construction, the key notion will e tht of greedy ccepting run tht we use in this pper. In short, greedy run is run tht lwys ims t reching n ccepting stte s quickly s possile. Our construction will consider only greedy runs. By doing so, visits of sets of ccepting sttes in runs of the constructed utomton llow fithfully to identify whether or not they cn lso occur in (greedy) run of the given utomton. To consider only greedy runs in deterministic version of given Büchi-utomton, we siclly conduct suset construction to which we dd sufficient structure to identify greedy runs: the sttes in the construction re tuples of sets of sttes of the given utomton, sets of non-ccepting sttes nd sets of ccepting sttes re never mixed (to void losing too much informtion [4]). From the so constructed deterministic utomton, y identifying prticulr property of stte sets occurring in the stteset tuples (they re either continued or discontinued), we cn construct nondeterministic one ccepting the complement ω-lnguge of the given Büchi utomton in similr wy s for deterministic Büchi utomt. The usul complementtion procedure for deterministic Büchi utomt (Section 3 in [5]) will e specil cse of our construction. II. PRELIMINARIES Let Σ e n lphet (set of finite crdinlity). The set of ll ω-words (infinitely long words) over Σ is designted y Σ ω. Susets of Σ ω re clled ω-lnguges over Σ. Büchi utomton A = (Q, Σ, δ, q in, F ) consists of finite set Q of sttes, input lphet Σ, trnsition function δ : Q Σ 2 Q, initil stte q in Q, nd set F Q of ccepting sttes.

3 δ is extended in the usul wy to finite words (insted of only single symols) nd sets of stte (insted of only single sttes). Let x = x(0)x(1)x(2) Σ ω. A run r of A on x is sequence r(0)r(1)r(2) of sttes such tht r(0) = q in nd r(i + 1) δ(r(i), x(i)), for ll i 0. Runs on finite words re defined similrly. Let ω(r) e the set of ll sttes tht recur infinitely often in r. Run r is ccepting if nd only if ω(r) F. Automton A Büchi-ccepts x if nd only if there exists n ccepting run of A on x [6], [7]. The set of ll ω-words ccepted y A is the ω-lnguge tht A ccepts. If, for ll q Q nd Σ, δ(q, ) is singleton set or the empty set, then A is clled deterministic. Otherwise it is clled nondeterministic. For ω-lnguges, the lnguge clsses ccepted y deterministic nd nondeterministic utomt differ: There exist ω-lnguges tht cn only e represented y nondeterministic finite utomt [6], [7]. We cll (finite) run r = r(0)r(1)r(2) r(n) on some finite word greedy if it lwys tries to rech, on its wy to r(n), ccepting sttes s quickly s possile. To define greediness formlly, let α : Q {0, 1} e function tht ssigns 1 to stte if nd only if it is ccepting. α cn e extended in the usul wy to function α : Q {0, 1} on sequences of sttes y its stepwise ppliction. We interpret words over {0, 1} s inry numers with the most significnt it to the left. We define tht r = r(0)r(1)r(2) r(n) on finite word w is greedy if nd only if there does not exist finite run r = r(0)r (1)r (2) r (n 1)r(n) on w (note tht r nd r coincide in their first nd lst stte) such tht α(r) < α(r ). The definition of greediness cn e extended to infinite runs r y defining tht infinite run r is greedy if nd only if ll of its finite prefixes re greedy. It is to e noted tht the notion of greediness similr to lexicogrphiclly mximl runs, s presented in [2]. A. Definitions III. THE SUBSET-TUPLE CONSTRUCTION Let A = (Q, Σ, δ, q in, F ) e Büchi utomton. We construct n interim deterministic Büchi-utomton A = (Q, Σ, δ, ({q in }), ) from which we will lter derive the complement utomton of A. The stte set of A contins non-empty disjoint sets of A-sttes: 1 1 By A-sttes we refer to the sttes of utomton A. Q = Q m=1 { (S1,..., S m ) (2 Q \ { }) m ( 1 j < k m : S j S k = ) }. A does not hve ccepting sttes s A s cceptnce condition will not influence the construction of the complement utomton. We will use some other oservtion out runs of A to define the cceptnce condition when finlly constructing the complement utomton. We define trnsition function δ : Q Σ Q susequently. Let p Q nd let m = p. Let p (j) e the jth component of p (note tht p (j) is set of A-sttes). For Σ, we define the -successor of the jth component of p to e m σ(p, j, ) = δ(p (j), ) \ δ(p (k), ). k=j+1 σ(p, j, ) contins ll A-sttes tht re -successors of A- sttes in p (j) nd not lredy contined in σ(p, k, ), for k > j. From this definition, we get immeditely tht sets σ(p, j, ) nd σ(p, k, ) re disjoint. The definition of σ(p, j, ) gurntees tht if n A-stte could occur in multiple components of tuple, we will keep it only in the rightmost component. Note tht even though δ(p (j), ) my not e empty, σ(p, j, ) still cn e empty. We prtition ech set σ(p, j, ) into non-ccepting A-sttes nd ccepting A-sttes: σ n (p, j, ) = σ(p, j, ) (Q \ F ), σ (p, j, ) = σ(p, j, ) F. As we just prtitioned the sets σ(p, j, ), the resulting sets re still pirwise disjoint. We put σ (p, j, ) to the right of σ n (p, j, ) nd remove ll empty sets. We define the trnsition function of A : δ (p, ) = q, where q is otined y removing ll empty sets in ( σn (p, 1, ), σ (p, 1, ),..., σ n (p, m, ), σ (p, m, ) ) ut otherwise keeping the order of the non-empty components. Lemm 1. For ll rechle sttes p Q in A nd ll 1 j < k p, p (j) nd p (k) re nonempty nd disjoint. B. Exmple We tke the utomton in Figure 1 s n exmple. Automton A in Figure 1 Büchi-ccepts ll ω-words over {} tht contin finitely mny occurrences of symol.

4 q in q 1 q 2 ({q in }) ({q in }, {q 1 }) ({q in }, {q 1 }, {q 2 }) Fig. 1. Büchi utomton A ccepting {} {} ω. Fig. 4. Initil frgment of A. From A, we construct A stepwise. The initil stte of A is the 1-tuple tht contins A-stte set {q in } (see Figure 2). ({q in }) Fig. 2. Initil frgment of A. With respect to A s trnsition reltion, we get σ(({q in }), 1, ) = δ({q in }, ) = {q in, q 1 }, σ(({q in }), 1, ) = δ({q in }, ) = {q in, q 1 }. Becuse {q in, q 1 } contins non-ccepting A-stte q in s well s ccepting A-stte q 1, {q in, q 1 } is prtitioned into two sets: σ n (({q in }), 1, ) = σ n (({q in }), 1, ) = {q in }, σ (({q in }), 1, ) = σ (({q in }), 1, ) = {q 1 }, nd we get ({q in }, {q 1 }) s the successor of ({q in }) when A reds or (see Figure 3). ({q in }) ({q in }, {q 1 }) Fig. 3. Initil frgment of A. In the next step, we clculte for symol : nd σ(({q in }, {q 1 }), 2, ) = δ({q 1 }, ) = {q 2 } σ(({q in }, {q 1 }), 1, ) = δ({q in }, ) \ δ({q 1 }, ) = {q in, q 1 } \ {q 2 } = {q in, q 1 }. As in the previous step, {q in, q 1 } is prtitioned into the two sets {q in } nd {q 1 }, nd we get ({q in }, {q 1 }, {q 2 }) s the -successor of ({q in }, {q 1 }). Similrly, for symol, we clculte nd σ(({q in }, {q 1 }), 2, ) = δ({q 1 }, ) = {q 1 } σ(({q in }, {q 1 }), 1, ) = δ({q in }, ) \ δ({q 1 }, ) = {q in, q 1 } \ {q 1 } = {q in }. No sets need to e prtitioned nd we get ({q in }, {q 1 }) s the -successor of ({q in }, {q 1 }). (see Figure 4). Now we clculte for symol : nd σ(({q in }, {q 1 }, {q 2 }), 3, ) = δ({q 2 }, ) = {q 2 }, σ(({q in }, {q 1 }, {q 2 }), 2, ) = δ({q 1 }, ) \ δ({q 2 }, ) σ(({q in }, {q 1 }, {q 2 }), 1, ) = {q 2 } \ {q 2 } =, = δ({q in }, ) \ (δ({q 1 }, ) δ({q 2 }, )) = {q in, q 1 } \ {q 2 } = {q in, q 1 }. As previously, {q in, q 1 } is prtitioned into the two sets {q in } nd {q 1 }, the empty set is removed, nd we get ({q in }, {q 1 }, {q 2 }) s the -successor of ({q in }, {q 1 }, {q 2 }). Similrly, for symol, we clculte nd σ(({q in }, {q 1 }, {q 2 }), 3, ) = δ({q 2 }, ) = {q 2 }, σ(({q in }, {q 1 }, {q 2 }), 2, ) = δ({q 1 }, ) \ δ({q 2 }, ) σ(({q in }, {q 1 }, {q 2 }), 1, ) = {q 1 } \ {q 2 } = {q 1 }. = δ({q in }, ) \ (δ({q 1 }, ) δ({q 2 }, )) = {q in, q 1 } \ {q 1, q 2 } = {q in }. No sets need to e prtitioned nd we get ({q in }, {q 1 }, {q 2 }) s the -successor of ({q in }, {q 1 }, {q 2 }), completing the construction (see Figure 5). ({q in }) ({q in }, {q 1 }) ({q in }, {q 1 }, {q 2 }) Fig. 5. Interim utomton A to Büchi utomton A of Figure 1. C. Additionl Nottion As pointed out in the previous section, it is importnt to identify for trnsitions in A which component in successor

5 stte results from which component in the predecessor stte. In ddition, it will e importnt to identify which component will eventully hve no successor component ny more (the component disppers eventully, it is discontinued). Let e symol in Σ. Let p nd q e two A -sttes such tht δ (p, ) = q. Let 1 j p nd 1 k q. If q (k) σ(p, j, ), then we write p (j) q (k), indicting tht p s -successor q contins component k ecuse p contins component j. We extend this definition to finite words w = l Σ in the usul wy: q 0(j 0 ) w q l+1(j l+1 ) if nd only if there exist sttes q 1, q 2,..., q l nd indices j 1, j 2,..., j l such tht for ll i, 0 i l, we hve q i (j i) i q i+1 (j i+1). If we tke the exmple from Figure 5, we hve, for instnce, ({q in }, {q 1 }, {q 2 })(1) ({q in }, {q 1 }, {q 2 })(2), ecuse when reding in stte ({q in }, {q 1 }, {q 2 }), the successor stte tht is lso ({q in }, {q 1 }, {q 2 }) contins {q 1 } ecuse {q 1 } σ(({q in }, {q 1 }, {q 2 }), 1, ). If we chnge however the symol, then ({q in }, {q 1 }, {q 2 })(2) ({q in }, {q 1 }, {q 2 })(2), ecuse when reding in stte ({q in }, {q 1 }, {q 2 }), the successor stte tht is lso ({q in }, {q 1 }, {q 2 }) contins {q 1 } ecuse {q 1 } σ(({q in }, {q 1 }, {q 2 }), 2, ). For the reminder of this pper, we lwys ssume tht A is complete. This cn e chieved, for instnce, y mking A complete efore constructing A. It gurntees tht for ech ω-word x, unique (A is deterministic) run of A on x does lwys exist. Let x = x(0)x(1)x(2)... Σ ω. Let r = r (0)r (1)r (2)... e the run of A on x. Let i 0 nd let 1 j r (i). We write r (i)(j) to indicte tht either there does not exist k such tht r (i)(j) x(i) r (i + 1)(k), or for ech k such tht r (i)(j) x(i) r (i + 1)(k) we hve r (i + 1)(k). The nottion r (i)(j) is used to indicte tht in the run r of A on x, component j of stte r (i) will dispper. Either it disppers immeditely (it does not hve n x(i)-successor) or it disppers eventully (ll its x(i)-successors will dispper). We will sy tht the component is discontinued in A s run on x. Conversely, we write r (i)(j) if nd only if r (i)(j) does not hold (we then sy tht r (i)(j) is continued in A s run on x). In ddition, we write r (i)(j) F if nd only if r (i)(j) nd q (i)(j) F, nd r (i) F if nd only if there exists j such tht r (i)(j) F. If r (i)(j), then r (i)(j) hs n x(i)-successor r (i + 1)(k) such tht r (i + 1)(k), ecuse otherwise r (i)(j) would hold. Therefore, nd ecuse of the pirwise disjointness of components in A -sttes (Lemm 1), the numer of continued components cnnot decrese from one stte to the next in A s run on x: Lemm 2. Let k e the numer of different components r (i)(j) of stte r (i) such tht r (i)(j), nd let l e the numer of different components r (i + 1)(j) of stte r (i + 1) such tht r (i + 1)(j). Then k l. As n exmple, let y =.... The run r of the utomton in Figure 5 on ω-word y is then: ({q in })({q in }, {q 1 })({q in }, {q 1 }, {q 2 })({q in }, {q 1 }, {q 2 })... In this run, we now lel ll components of A -sttes either with or, depending on whether they re continued or not: ({q in } )({q in }, {q 1 } )({q in }, {q 1 }, {q 2 } ) ({q in }, {q 1 }, {q 2 } )({q in }, {q 1 }, {q 2 } )... As we could see in the construction of the utomton in Figure 5, ({q in }, {q 1 }, {q 2 })(2) does not hve successor (i.e. the successor set is the empty set) when reding symol, ecuse σ(({q in }, {q 1 }, {q 2 }), 2, ) = δ({q 1 }, ) \ δ({q 2 }, ) = {q 2 } \ {q 2 } =. Therefore ({q in }, {q 1 }, {q 2 })(2) is lelled with in the run, s the run is on n ω-word tht contins infinitely mny times symol, nd ({q in }, {q 1 }, {q 2 })(2) never persists. The sitution chnges entirely, when we consider ω-word z =... (two s followed y exclusively s). Run r of A on z is gin: ({q in })({q in }, {q 1 })({q in }, {q 1 }, {q 2 })({q in }, {q 1 }, {q 2 })... However, lelling ll components of A -sttes either with or, depending on whether they re continued or not, leds now to: ({q in } )({q in }, {q 1 } )({q in }, {q 1 }, {q 2 } ) ({q in }, {q 1 }, {q 2 } )({q in }, {q 1 }, {q 2 } )...

6 Now ({q in }, {q 1 }, {q 2 })(2) is lwys lelled with ecuse the sence of symol in z results in ({q in }, {q 1 }, {q 2 })(2) lwys hving successor: σ(({q in }, {q 1 }, {q 2 }), 2, ) = δ({q 1 }, ) \ δ({q 2 }, ) = {q 1 } \ {q 2 } = {q 1 }. Becuse q 1 is n ccepting A-stte, the run cn even e lelled s: ({q in } )({q in }, {q 1 } F )({q in }, {q 1 } F, {q 2 } ) ({q in }, {q 1 } F, {q 2 } )({q in }, {q 1 } F, {q 2 } )... With our new nottion, we will show in the next section tht run r of A on ω-word x will contin infinitely mny sttes with component lels F if nd only if the originl utomton A Büchi-ccepts x. D. Some Properties of the Construction Let q Q. We will write q to designte q i=1 q (i), i.e. the set of ll A-sttes tht occur in q. From the definition of the trnsition function δ we get immeditely: Lemm 3. δ( q, ) = δ (q, ). For the reminder of this section, let Σ, let w Σ, let x Σ ω, nd let r e the run of A on x. Lemm 4. δ({q in }, w) = δ (q in, w). Proof. We prove the lemm y n induction on the length w of w. If w = 0, then A reches {q in } = q in y reding w. If w > 0, then w = v with v Σ nd Σ. Assuming δ({q in }, v) = δ (q in, v) we get: δ({q in }, w) = δ(δ({q in }, v), ) = δ( δ (q in, v), ) = δ (δ (q in, v), ) = δ (q in, w), where the second equlity holds y induction, nd the third pplies Lemm 3. Lemm 5. If there re infinitely mny j such tht r (j) contins continued set of ccepting sttes (written: r (j) F ), then A ccepts x. Proof. From Lemm 2 we know tht the numer of continued components cnnot decrese when moving forwrd in run. Becuse ech stte in A cn hve t most m components, where m is the numer of sttes in A, the numer of continued components must remin constnt fter some position k in run r. Let this numer e l where 1 l m. So fter position k in r, ech stte will contin l continued components, nd therefore ech continued component will hve exctly one continued component s its successor when reding the respective symol. So fter position k, we cn identify l sequences of consecutive continued components in r. Becuse there re infinitely mny continued components in r tht re sets of ccepting A-sttes, t lest one of these l sequences of consecutive continued components must contin infinitely mny continued components tht re sets of ccepting A-sttes (ecuse l is finite). Therefore there must e sequences i 1, i 2, i 3... of run positions nd j 1, j 2, j 3... of component indices such tht, for ll n 1 nd w n = x(i n )... x(i n+1 1): nd r (i n )(j n ) F r (i n )(j n ) wn r (i n+1 )(j n+1 ). Then there exists to ech A-stte q n+1 r (i n+1 )(j n+1 ) n A-stte q n r (i n )(j n ) such tht q n+1 δ(q n, w n ). Applying Koenig s Lemm [8], there exists sequence p 1, p 2, p 3,... of A-sttes such tht p n+1 δ(p n, w n ) nd p 1 δ ( q in, x(0)... x(i 1 1) ). Therefore there exists run r of A on x tht contins the sttes p n. Becuse ll p n re ccepting A-sttes, r is n ccepting run nd A ccepts x. Lemm 6. If A ccepts x, then there re infinitely mny i such tht r (i) contins continued set of ccepting sttes (written: r (i) F ). Proof. Let r e greedy ccepting run of A on x nd let r e the run of A on x. We cn then prove (see elow) tht there exists sequence j 0, j 1, j 2... of component indices, 1 j 0, j 1, j 2... m, such tht for ll i 0: nd r(i) r (i)(j i ) r (i)(j i ) x(i) r (i + 1)(j i+1 ). Therefore ll r (i)(j i ) re continued. In ddition, ecuse r is ccepting, infinitely mny r(i) re ccepting nd so re infinitely mny r (i)(j i ), ecuse they contin r(i) nd re therefore sets of ccepting A-sttes. Then infinitely mny r (i)(j i ) re continued nd ccepting, proving the lemm. Wht we still need to prove to complete the proof of the lemm is tht r(i) r (i)(j i ) nd r (i)(j i ) x(i) r (i + 1)(j i+1 ). We prove this fct y contrdiction: we ssume it is not true nd prove tht then r cnnot e greedy. Becuse of Lemm 4, there is lwys component r (i)(j i ) in A -stte r (i) tht contins r(i). If the sttement is not true, then the sequence j 0, j 1, j 2,... of component indices such tht r(i) r (i)(j i ) must contin position k 0 such tht r (k)(j k ) x(k) r (k + 1)(j k+1 ).

7 Let k e the smllest such position. According to the definition of A s trnsition function δ, there must e j k > j k such tht r (k)(j k) x(k) r (k + 1)(j k+1 ). Then there is sequence j 0, j 1, j 2,..., j k of component positions such tht, for ll 1 n k 1 such tht r (n)(j n) x(n) r (n + 1)(j n+1). j 0, j 1, j 2,..., j k nd j 0, j 1, j 2,..., j k will coincide in few first indices. 2 Let l e the first position t which j 0, j 1, j 2,..., j k nd j 0, j 1, j 2,..., j k strt to differ. Becuse j k > j k, lso j l > j l. So we hve nd r (l 1)(j l 1 ) x(l 1) r (l)(j l ), r (l 1)(j l 1 ) x(l 1) j l > j l. r (l)(j l), From the definition of A s trnsition function δ we get tht r (l)(j l ) contins non-ccepting A-sttes, ut r (l)(j l ) contins ccepting A-sttes. Let r(0) r(1)... r(k + 1) e the run of A on x(0)x(1)... x(k) such tht for ll 1 n k + 1 nd r(n) r (n)(j n) r(k + 1) = r(k + 1). Then r(0) r(1)... r(k + 1) nd r(0)r(1)... r(k + 1) re runs of A on x(0)x(1)... x(k), nd r(0) r(1)... r(k + 1) visits n ccepting stte erlier thn r(0)r(1)... r(k + 1) does. So r(0)r(1)... r(k + 1) cnnot e greedy, nd consequently r cnnot e greedy s r(0)r(1)... r(k + 1) is prefix of r, contrdicting the choice of r nd completing the proof of the lemm. Putting Lemms 5 nd 6 together, we otin: Corollry 1. A ccepts x if nd only if r contins infinitely mny A -sttes tht contin continued sets of ccepting A- sttes. To complete this section, let us riefly look t the size of the construction: we clculte the numer of sttes in A. These sttes re n-tuples of disjoint sets of A-sttes, where n rnges from 1 to m nd m is the numer of sttes of A. 2 They coincide t lest in j 0 = j 0 = 1, ecuse r (0) is the initil stte of A tht contins single component (contining the initil stte of A). The numer of wys of prtitioning set of n lelled ojects into k non-empty unlelled susets cn e written s Stirling numer of the second kind [9] : { } n = 1 k k! k ( ) k ( 1) k j j n. j j=0 The numer of wys to prtition set of n lelled ojects into non-empty unlelled susets of ny size is the Bell numer [10] n { } n B n =. k k=0 Since we consider here tuples nd not just prtitions, we must multiply ech term y the numer of possile orderings, giving us the ordered Bell numer [11]: n { } n (n) = k!. k k=0 Now, the ordered Bell numer represents the numer of tuples of non-empty components one cn crete using ll n elements. In the construction presented ove, ll elements my not e used. We hve to sum up the ordered ell numers for ech suset of Q. The numer of tuples (wek-orderings) over m elements, which we write # tuples (m), is thus the sum of the ordered Bell numers (n) with n rnging from 1 to m, multiplied y the numer of wys of choosing n elements over m: ( ) m # tuples (m) = (n). n n=1 The following recurrence reltion [12]: m 1 n=0 ( ) m (m n) = 2(m) 1 n leds to much simpler expression of the size of A : ( ) m # tuples (m) = (n) n n=1 ( ) ( ) m m = (n) (0) n 0 n=0 }{{} =1 ( ) m = (n) 1 m n n=0 ( ) m = (m n) 1 n n=0 m 1 ( ) ( ) m m = (m n) + (m m) 1 n m n=0 }{{} =0 = 2(m) 1

8 The ordered Bell numers cn e pproximted y [13]: (m) m! 2(ln 2) m+1 nd thus the size of the upper prt is symptoticlly [14]: # tuples (m) (m) (0.53m) m. IV. THE COMPLEMENTATION CONSTRUCTION A. Additionl Indices With the use of colouring of the tuple components, we cn now extend the utomton A descried in Section III, to uild n utomton A c complement to A. In the process, we crete n upper (non-ccepting) utomton  nd lower (ccepting) utomton Ǎ nd put them together into utomton A c. This colouring tkes the form of n index tht cn tke integer vlues in [ 1, 2]. The mening of the colours will e presented further down. Wheres stte q of A is written (S 1, S 2,..., S m ), stte q of Â, Ǎ or A c is written s q = ( (S 1, c 1 ), (S 2, c 2 ),..., (S m, c m ) ), where S j 2 Q \ { } nd c j [ 1, 2], 1 j m. B. Upper (Non-ccepting) Prt The upper prt  represents the initil prt of A c nd contins no ccepting sttes. The denomintion upper comes from the fct tht the uthors generlly picture the ccepting prt of the complement under the non-ccepting one. The structure is inspired y the complementtion construction for deterministic Büchi utomt, where the non-ccepting prt is simply non-ccepting copy of the originl utomton representing everything tht cn hppen in finite prefix of n ω-word. Accepting runs of A c then jump to the lower (ccepting) prt. In the upper utomton  = ( ˆQ, Σ, ˆδ, ˆq in, ˆF ) we simply ppend colour 1 to ll components of ech Â-stte. Sttes (written (S 1, S 2,..., S m )) of the interim utomton A re thus rewritten ( (S 1, 1), (S 2, 1),... (S m, 1) ) in Â. The trnsition function should e rewritten ccordingly s follows. Let Σ, p := (S 1,..., S m ) Q, q := (S 1,..., S m ) Q. If δ (p, ) = q where δ is s in Section III, then for ˆδ is defined y: ˆp := ( (S 1, 1),..., (S m, 1) ) ˆQ nd ˆq := ( (S 1, 1),..., (S m, 1)) ˆQ, As for the other elements: ˆδ(ˆp, ) := ˆq. ˆq in := ( ({q in }, 1) ) F := Only Â-sttes will hve components with colour 1. C. Lower (Accepting) Prt The lower utomton Ǎ := ( ˇQ, Σ, ˇδ, ˇq in, ˇF ) cn e defined in similr fshion, ut with vlues 0, 1, 2 for the colouring indices nd non-empty ccepting set ˇF. The set of ccepting sttes F c is then defined ccording to the colouring of the components of the sttes. In nutshell, for n ω-word x Σ ω we wnt the run r c of A c on x to e ccepting if nd only if ech greedy run r of the originl utomton A on x either: eventully stops visiting sttes of F, or is discontinued (i.e. is finite or ecomes non-greedy). Trnslted to Ǎ (where ny finite ehviour hs lredy een tken cre of in Â, these constrints ecome: the run does not visit sttes of F, or it is discontinued (i.e. is finite or ecomes non-greedy). We now give some insight into the mening of the colours. Let i e the point where run r c jumps to the lower prt, i.e. i i r c (i) Ǎ. The colours of the components of the sttes of Ǎ hold some informtion on wht hppens in the greedy runs of A, fter i. Colour c = 0: If tuple component (S j, c j ) is 0-coloured in r c (i), i.e. (S j, 0) r c (i), for n i i, then for ech stte q in S j, the greedy run r of A s.t. r(i) = q hs not yet visited n ccepting A-stte since i. An Ǎ-stte contining only 0-coloured components cn e set ccepting, ecuse ll greedy runs of A tht my hve visited n ccepting A- stte etween i nd i hve disppered. Colour c = 2: If tuple component (S j, c j ) is 2-coloured in r c (i), i.e. (S j, 2) r c (i), for n i i, then for ech stte q in S j, the greedy run r of A s.t. r(i) = q hs visited n ccepting A-stte since i. A c -sttes contining 2- coloured components re kept non-ccepting, ecuse tht greedy run r hs visited ccepting A-sttes nd hs not yet disppered. If it never disppers, then r c only visits non-ccepting sttes nd it is correct to reject r c in A c. Colour c = 1: If tuple component (S j, c j ) is 1-coloured in r c (i), i.e. (S j, 1) r c (i), for n i i, then for ech stte q in S j, the greedy run r of A s.t. r(i) = q hs visited n ccepting A-stte since i, ut there lso exist 2-coloured components tht hve not yet disppered. We sy tht

9 1-coloured components re on hold, mening tht for the moment, we wit until the 2-coloured components hve disppered. When this hppens, 1-coloured components ecome 2-coloured in the following stte. A c -sttes tht contin only 0-coloured or 1-coloured components re set ccepting, ecuse ll greedy runs of A tht hve visited n ccepting A-stte etween i nd i hve disppered. If this hppens infinitely often, then no greedy run of A cn visit infinitely mny ccepting A-sttes, nd it is correct to ccept r c in A c. We define Ǎ formlly. First, let us write the set of possile sttes: ˇQ := Q m=1 {( (S1, c 1 ),..., (S m, c m ) ) (2 Q \ { } [0, 2]) m 1 j < k m, S j S k = }. The trnsition function ˇδ is defined s follows: ˇδ : ˇQ Σ ˇQ As erlier, we extend the trnsition function δ of Section III to define ˇδ. Let ˇp := ( (S 1, c 1 ),..., (S m, c m ) ) ˇQ e stte of Ǎ. Let p := (S 1,..., S m ) e the corresponding stte of A otined y removing the c j s. Let Σ nd let q = (S 1,..., S m ) e the unique stte of A s.t. δ (p, ) = q. We now define the vlues of the indices c j of the -successor of ˇp: 1 j m, let 1 j pred m e (unique) s.t. ˇp(j pred ) ˇq(j ), c j := 0 if c j pred = 0 if 1 j m : c j 2 then S j F c j := 2 otherwise c j := 0 if c j pred = 0 S j if 1 j m : c j = 2 then F c j := 2 if c j pred = 2 c j := 1 otherwise For ˇq := ( (S 1, c 1)..., (S m, c m )) we define: ˇδ(ˇp, ) := ˇq. The initil stte cn e defined s : ˇq in := ( ({q in }, 0) ). The set ˇF of ccepting sttes holds ll sttes tht do not contin 2-coloured component : ˇF := {( S1, c 1 ),..., (S m, c m ) ) ˇQ 1 j m, c j < 2}. D. The Complement Automton Applying the construction elow, we cn join utomt  nd Ǎ to uild new utomton A c representing lnguge which is complement to the lnguge of the originl utomton A. The set of sttes Q c is the union of the sets of sttes of oth utomt nd the nondeterministic trnsition function δ c is the union of the functions of the two utomt plus some extr trnsitions which unidirectionlly link the upper utomton to the lower one. As mentioned erlier, the ccepting sttes re only locted in the lower deterministic prt of A c. We crete the utomton A c = (Q c, Σ, δ c, q c, F c ) complement to A y joining utomt  nd Ǎ in the following wy: Q c = ˆQ ˇQ Let p = ( (S 1, c 1 ),..., (S m, c m ) ) Q c nd Σ. The nondeterministic trnsition function δ c : Q c Σ 2 Qc is defined s follows 3 : δ c (p, ) := ˆδ(p, ) ˇδ ( ((S1, 0),..., (S m, 0) ), ) if p Â, δ c (p, ) := ˇδ(p, ) otherwise q c := ˆq in F c := ˇF In order to prove the lnguge equivlence etween L(A) nd the complement of L(A c ), we first show the left-to-right direction, i.e. if n ω-word x is ccepted y A then it will not e ccepted y A c, i.e. ll runs of A c on x will e rejected. Lemm 7. Let x = x(0)x(1)x(2)... L(A). Then: run r c of A c on x, r c is non-ccepting. Proof. Let r e the unique run of A on x. Let r c e run of A c on x. We show tht r c cnnot e ccepting. Consider two cses: 1) r c Â, i.e. the run remins in the upper prt. Then r c never visits n ccepting stte nd is thus non-ccepting. 2) r c Ǎ, i.e. l : r(l) ˇQ. Since x L(A) Lemm 6 gives us: i l : r(i ) F, so j : 1 j r (i ) s.t. r (i )(j ) F. Thus, the definition of the trnsition function δ c (stemming from ˇδ) ensures tht r c (i )(j ) is 1 or 2-coloured. We consider those two cses: ) r c (i )(j ) is 2-coloured: The trnsition function δ c gives us tht there exists sequence of components (S i, c i )(S i +1, c i +1) (2 Q [ 1, 2]) ω s.t. (S i, c i ) = r c (i )(j ) i i, (S i, c i ) r c (i) i i, (S i, c i ) x(i) (S i+1, c i+1 ) 3 Trnsitions from the upper to the lower prt re s if originting from entirely 0-coloured sttes.

10 i i, c i = 2 (the colour cnnot decrese). Since ech stte in r c (i) for i i contins 2- coloured component, none of these sttes cn e ccepting nd r c is thus non-ccepting run. ) r c (i )(j ) is 1-coloured: Agin we consider the sequence of components strting t r c (i )(j ): (S i, c i )(S i +1, c i +1) (2 Q [ 1, 2]) ω s.t. (S i, c i ) = r c (i )(j ) i i, (S i, c i ) r c (i) i i, (S i, c i ) x(i) (S i+1, c i+1 ) Additionlly, the definition of δ c ensures tht the colour c cnnot decrese, so i i, c i 1. There re now two possiilities, either the colour eventully turns to 2, either it remins 1 forever: i) k > i : c k = 2: Since r(i ) is continued, nd the colour cnnot decrese, we hve i k, (S i, 2) r(i) nd thus r(i) / F c. It follows tht r c is non-ccepting run. ii) k i : c k = 1: Here, the colour of the sequence remins 1 forever. By definition of the trnsition function δ c, if 1-coloured component exists t level k in the run, it implies tht there exists 2-coloured component t level k 1. Since c k = 1 is true k i, then k i 1, there exists 2-coloured component in r c (k), mking ll the sttes of r c non-ccepting for k i 1. So there exists no ccepting run of x on A c. x is therefore in L(A c ). We now show the opposite direction of the equivlence sttement, y proving tht n ω-word not ccepted y A cn produce n ccepting run of A c. Lemm 8. Let x = x(0)x(1)x(2)... Σ ω \ L(A). Then run r c of A c on x s.t. r c is ccepting. Proof. Let r e the unique run of A on x (such run exists under the ssumption tht A is complete). By Lemm 5, there exist only finitely mny i s.t. r (i) F. This mens tht i 0 s.t. i i,!r (i) F. We now construct n ccepting run r c of A c on x which jumps to the lower prt Ǎ exctly t tht point i where r will hve cesed holding sets tht re continued nd ccepting. Let r c = r c (0)r c (1)r c (2) Q ω c e run of A c on x s.t. r c (i) ˇQ iff i i. We show, y contrdiction, tht r c is ccepting. Suppose it is not. Then i i s.t. i i, r c (i) / F c, i.e. r c eventully visits only non-ccepting sttes. By definition of the cceptnce condition F c of A c, t lest one of components of r c (i ) is 2-coloured. Formlly: 1 j r c (i ) s.t. r c (i )(j ) is 2-coloured. We now define the unique greedy run of A contining r c (i )(j ): Let (S 0, c 0 )(S 1, c 1 )(S 2, c 2 ) (2 Q [ 1, 2]) ω e sequence s.t.: k 0, (S k, c k ) x(k) (S k+1, c k+1 ) (S i, c i ) = r c (i )(j ) for unique j : 1 j r c (i ) (S i, c i ) = r c (i )(j ). Since r c (i )(j ) is 2-coloured, the definition of δ c implies tht there must exist n i : i i i nd j : 1 j r c (i ) s.t. r c (i )(j ) F 4, which contrdicts the fct tht i i,!r (i) F. Therefore our ssumption tht r c is not n ccepting run is contrdicted nd x L(A c ). As consequence of lemms 7 nd 8, we hve the following: Corollry 2. For x Σ ω, x L(A) x L(A c ). This proves the correctness of the construction. In terms of size of the construction, dding the colouring to A, does not introduce more thn 3 k fctor for ech A -stte with k components. The numer of sttes of the lower prt # lower (m) is thus ounded y: # lower (m) n=1 ( ) m n k! n k=0 { n k } 3 k A looser (ut simpler) upper ound cn further e defined (using Stirling s pproximtion of the fctoril [15]): ( ) m n { } n # lower (m) 3 m k! n k n=1 k=0 3 m 2(m) 3 m 1 2 n! 2(ln 2) n+1 3 m 1 (ln 2) m+1 2πm ( m e ( ) m 2πm 3m = ln 2 e ln 2 2πn (1.59m) m = ( m 2π m 1.59m ) m ) m 4 In words, this mens tht if we find 2-coloured component, then t some point in the pst of this sequence, n ccepting stte of A ws visited.

11 Since m m m 1, # lower (m) O((1.59m) m ) So the size of the entire construction Q c is not more thn ( ) m n { } n 2(m) 1 + k! 3 k. 5 n k nd thus: n=1 k=0 Q c O((1.59m) m ) This upper ound is very loose nd its refinement is the suject of ongoing reserch. We resume our previous exmple nd construct the complement of the utomton of Figure 1. To void cumersome nottion in the following exmple, component (S j, c j ) will e denoted s: Ŝ j if c j = 1 S j if c j = 0 S j if c j = 1 S j if c j = 2 The upper prt  of the complement utomton is just the utomton A where we ppend colour 1 to ll components (Figure 6). ( {q in }) ( {q in }, {q 1 }) ( {q in }, {q 1 }, {q 2 }) Fig. 6. Upper prt  of Büchi utomton A c complement to A of Figure 1. The lower prt Ǎ is constructed in similr wy, ut with the ddition of colours 0, 1 nd 2. Let s first look t the -successor in Ǎ of ( {q in }). The two successor sets re {q in } nd {q 1 }. By definition of the trnsition function ˇδ, since {q in } F =, the colour (initilly 0) remins 0. For the set {q 1 }, since {q 1 } F, the new colour is 2. So the -successor of ( {q in }) in Ǎ is ({q in}, {q 1 }). The sme holds for symol nd we cn drw the trnsition (Figure 7): Let s now look t the -successor of this newly creted stte. The -successor of {q 1 } is {q 2 } nd colour 2 remins. The - successors of {q in } re {q in } (left successor) nd {q 1 } (rightsuccessor). Since {q in } F =, the colour of {q in } remins 0. The colour of {q 1 } is set to 1 ecuse {q 1 } F nd colour 2 lredy exists in the predecessor stte. So the -successor of ({q in }, {q 1 }) is finlly ({q in }, {q 1 }, {q 2 }) nd we cn drw the trnsition in our utomton (Figure 8). 5 Size of the upper prt (which is equl to the size of A ) plus the size of the lower prt. ( {q in }) ( {q in }, {q 1 }) ( {q in }, {q 1 }, {q 2 }) ({q in }, {q 1 }) Fig. 7. Interim lower prt Ǎ of Büchi utomton A c. ( {q in }) ( {q in }, {q 1 }) ( {q in }, {q 1 }, {q 2 }) ({q in }, {q 1 }) ({q in }, {q 1 }, {q 2 }) Fig. 8. Interim lower prt Ǎ of Büchi utomton A c. By pplying this simple method for ll rechle A c -sttes, we get the utomton of Figure 9, where the ccepting sttes re the sttes of the lower prt which do not contin 2-coloured component. Here it is only the cse for stte ({q in }, {q 1 }, {q 2 }). ( {q in }) ( {q in }, {q 1 }) ( {q in }, {q 1 }, {q 2 }) ({q in }, {q 1 }) ({q in }, {q 1 }, {q 2 }) ({q in }, {q 1 }, {q 2 }) ({q in }, {q 1 }, {q 2 }) Fig. 9. Automton A c complement to A.

12 E. An improved lgorithm The presented construction llows some optimistions to e pplied. First, it is possile to join ll neighouring 1-coloured components, s well s ll neighouring 2-coloured components, without chnging the lnguge of the constructed utomton, ut gretly reducing its size (nd thus its worstcse ound). We define the join : Q c Q c function s the function tht tkes n ritrry stte of Q c nd outputs nother stte of Q c where ll neighouring 1-coloured components hve een joined together, nd ll neighouring 2-coloured components hve een joined together. We extend the join function to sets in the usul wy: join : 2 Qc Σ 2 Qc join(q, ) := join(q) q Q Let A c = (Q c, Σ, δ c, q 0, F c ) e Büchi utomton s constructed y the lgorithm ove. Defining new trnsition function δ join : Q c Σ Q c δ join (q, ) := join(δ c (q, )). llows us to consider the utomton A join := (Q c, Σ, δ join, q 0, F ). We here prove the lnguge equivlence etween A nd A join. Lemm 9. Let r e run of A on n ω-word x. Let r e sequence of sttes such tht join(r(i)) = r (i), i 0. Then r is run of A join on x. Proof. We show this y induction on the length of prefixes of x. First, it is cler tht r(0) = r (0) ecuse pplying join to stte of the upper prt hs no effect. So r (0) is run of A on ɛ. For the induction step, y hypothesis we hve tht r (0) r (i) is run of x(0) x(i 1). Then we get: r (i + 1) = join(r(i + 1)) join(δ(r(i), x(i))) = δ join (r(i), x(i)) = δ join (join(r(i)), x(i)) = δ join (r (i), x(i)) So r (0) r (i + 1) is indeed run of A on x. The following corollry holds trivilly: Corollry 3. For ny i 0, r(i) contins the sme 1-coloured sttes s r (i). Also, r(i) contins the sme 2-coloured sttes s r (i). The equivlence of r nd r in terms of cceptnce, cn therefore e stted: Lemm 10. A ccepts r if nd only if A ccepts r. Proof. We first prove tht r is ccepting implies tht r ccepting. Let x Σ ω. Let r e n ccepting run of A on x. Then it visits infinitely mny ccepting sttes of A, which contin no 2-coloured component. By Corollry 3, r lso visits infinitely mny sttes tht contin no 2-coloured component. r is thus ccepting. The sme rgument holds in the other direction. In order to reduce the stte spce of the lower prt, one cn pply further optimistion. Tht is, 2-coloured component immeditely followed y 1-coloured component cn e joined into single 2-coloured component. Intuitively, this cn e done ecuse switching 1-coloured component to colour 2 only delys the ppernce of the next ccepting stte (of Q c ). Since, y the structure of δ join such n opertion cn only e done finitely mny times, we only introduce finitely mny delys, nd thus do not turn n ccepting run of A join into non-ccepting run. This is proven formlly elow: We define function join 2 1 : Q c Q c which pplies the sustitution descried ove recursively until there is no 1-coloured component following 2-coloured component. join 2 1 : 2 Qc 2 Qc is extended to sets in the usul wy. A new trnsition function cn e defined: δ 2 1 : Q c Σ Q c δ 2 1 (q, ) := join 2 1 (δ join (q, )). The corresponding utomton A 2 1 := (Q = ˆQ ˇQ {s}, Σ, δ 2 1, q 0, F ) contins sttes tht hve no two neighouring 1-coloured components, no two neighouring 2-coloured components, nd no 1-coloured component immeditely following 2-coloured component. To show lnguge equivlence, we first need to prove some generl properties of the colourings in run on the constructed utomton. Let x Σ ω e n ω-word nd r = r(0)r(1)r(2) Q ω e run of A on x such tht k > 0 such tht r(i) ˇQ i k. Tht is, l is the point where r reches the lower prt ˇQ. This lemm sttes tht, in the lower prt ˇQ, the numer of 0- coloured elements cnnot increse from one stte to the next. Lemm 11. Let m i e the numer of 0-coloured elements in stte r(i). Then for i l, m i m i+1. Proof. By definition of ˇδ in the construction lgorithm, 0- coloured component cn hve t most one 0-coloured succes-

13 sor. Therefore the numer of 0-coloured components cnnot increse from stte of the run r to the next. By oundedness of the numer of components, it follows immeditely tht there re only finitely steps where the numer of 0-coloured components cn decrese. Corollry 4. In r, there re finitely mny i where m i > m i+1. The following lemm shows lnguge equivlence. Lemm 12. L(A) = L(A 2 1 ). Proof. We first prove tht L(A join ) L(A 2 1 ). Let x L(A join ) nd let r e the run of A join on x. Consider the run r of x such tht r (i) := join 2 1 (r(i)), i 0. One cn see, y looking t the trnsition function δ, tht the sitution where 1-coloured component immeditely follows 2-coloured component cn only rise fter 0-coloured component disppers (ecuse 2-coloured components re inherently older thn 1-coloured components, nd tht newly creted components (emerging from 0-coloured component) re plced to the left of older components). In r, these two components re merged. And the next occurrence of 2-coloured component followed y 1-coloured component is necessrily the result of nother 0-coloured component disppering. By Corollry 4, this cn only hppen finitely mny times. Since r is ccepting, ll sttes tht re in 1- or 2-coloured components eventully dispper. In r, this disppering cn e delyed y the union of 1-coloured elements into 2-coloured elements, ut only y finite mount of steps. Therefore, ll sttes present in 1- or 2-coloured component eventully dispper lso, nd t this point n ccepting stte is mrked. So r contins infinitely mny ccepting sttes. In the other direction of proof, suppose r is ccepting, then ll sttes contined in 2-coloured components eventully dispper (ech time n ccepting stte of A 2 1 is visited). The set of these sttes is superset of the set of sttes in 2-coloured components tht dispper in r. So i such tht r (i) F, then r(i) F. r is n ccepting run of A 2 1 immeditely implies tht r is n ccepting run of A join. Since L(A) = L(A join ), we hve L(A) = L(A 2 1 ). The following lemm sttes tht it is sufficient to consider tuples of which the first component is either 0-coloured, or 2-coloured. In other words, if the first component of stte is of colour 1, tht component cn e coloured 2 nd joined with the following 2-coloured component, if such next component exists. We must define new function f (for first component) f : Q c Q c tht performs this opertion on stte p := ((S 0, c 0 ), (S 1, c 1 ),..., (S m, c m )): If c 0 = 1 nd c 1 = 0, then f(p) := ((S 0, 2), (S 1, c 1 ),..., (S m, c m )) If c 0 = 1 nd c 1 = 2, then f(p) := ((S 0 S 1, 2), (S 2, c 2 ),..., (S m, c m )) otherwise (nd if p < 2): f(p) = p. f : 2 Qc 2 Qc is extended to sets in the usul wy. We define the trnsition function: nd the utomton: δ f : Q c Σ Q c δ f (q, ) := f(δ 2 1 (q, )). A f := (Q = ˆQ ˇQ {s}, Σ, δ f, q 0, F ). It is esy to see (using n rgument s in 9 if necessry), tht for run r = r(0) r(1) r(2) of A on n ω-word x Σ ω, the run r := f(r(0)) f(r(1)) is run of A f on x. Lemm 13. L(A) = L(A f ). Proof. We first show tht L(A 2 1 ) L(A f ). Let x L(A 2 1 ) nd r e n ccepting run of A 2 1 on x. Let r = f(r(0)) f(r(1)) e run of A f on x. We use the sme rgument s in the proof of Lemm 12. A 1-coloured component on the leftmost position cn only e the result of 0-coloured component tht hs previously disppered. Therefore, the switching of this 1-coloured component to colour 2 (nd possile merging with the next 2-coloured component if it exists), cn only hppen finitely mny times, nd s such does not lter the cceptnce of the run. So r is ccepting if nd only if r is ccepting. For the other direction L(A 2 1 ) L(A f ), let x L(A f ). Let r e n ccepting run of A 21 on x nd r = f(r(0)) f(r(1)) e run of A f on x. i 0, if r (i) contins no 2-coloured component, then r(i) either. So if r is ccepting (nd contins infinitely mny sttes tht hve no 2-coloured component), then r is lso ccepting. As consequence, L(A) = L(A 1 2 ) = L(A f ). These optimistions reduce the set of possile sttes in the lower prt. We first must count the numer col(k) of different wys of colouring tuple of size k (which we henceforth cll k-tuple). Let col 0 (k), col 1 (k) nd col 2 (k) e the numer of colourings of k-tuple which leftmost component is coloured 0, 1 or 2, respectively. The ove optimistions (nmely join, 2 1 nd f ) yield the following recurrence reltions, vlid for k 1: col 0 (k + 1) = col 0 (k) + col 1 (k) + col 2 (k) = col(k) col 1 (k + 2) = col 0 (k + 1) + col(k) col 2 (k + 1) = col 0 (k)

14 The numer of colourings cn then e recursively evluted, k 1: col(k + 3) = col 0 (k + 3) + col 1 (k + 3) + col 2 (k + 3) (1) = col(k + 2) + col 0 (k + 2) + col 2 (k + 2) + col 0 (k + 2) (2) = col(k + 2) + 2col(k + 1) + col 2 (k + 2) (3) = col(k + 2) + 2col(k + 1) + col 0 (k + 1) (4) = col(k + 2) + 2col(k + 1) + col(k) (5) From this, we cn deduce tht, k 1: col(k + 2) col(k + 1) + col(k) Reintroduced in eqution 5, this gives us: col(k + 3) = col(k + 2) + 2col(k + 1) + col(k) = col(k + 2) + col(k + 1) + col(k + 1) + col(k) }{{} col(k+2) col(k + 2) + col(k + 1) + col(k + 2) = 2col(k + 2) + col(k + 1) 2col(k + 2) This result cn e used in eqution 5 gin to ound the increse of col: col(k + 3) = col(k + 2) + 2col(k + 1) + }{{} col(k) }{{} col(k+2) 1/2col(k+1) col(k + 2) + col(k + 2) + 1/2col(k + 1) }{{} 1/4col(k+2) 2.25 col(k + 2) We re left to find the initil vlues of col in order to hve vlid ound. There re 2 colourings of tuples of size 1: 1) ((S 1, 0)) 2) ((S 1, 2)) There re 4 colourings of tuples of size 2: 1) ((S 1, 0), (S 2, 0)) 2) ((S 1, 0), (S 2, 1)) 3) ((S 1, 0), (S 2, 2)) 4) ((S 1, 2), (S 2, 0)) And there re 9 colourings of tuples of size 3: 1) ((S 1, 0), (S 2, 0)), (S 3, 0)) 2) ((S 1, 0), (S 2, 0)), (S 3, 1)) 3) ((S 1, 0), (S 2, 0)), (S 3, 2)) 4) ((S 1, 0), (S 2, 1)), (S 3, 0)) 5) ((S 1, 0), (S 2, 1)), (S 3, 2)) 6) ((S 1, 0), (S 2, 2)), (S 3, 0)) 7) ((S 1, 2), (S 2, 0)), (S 3, 0)) 8) ((S 1, 2), (S 2, 0)), (S 3, 1)) 9) ((S 1, 2), (S 2, 0)), (S 3, 2)) We sum up: col(1) = 2 col(2) = 4 col(3) = 9 So from these initil vlues, nd the recurrence reltion clculted ove, we get: col(k) 2.25 k k 0. The numer of sttes in the lower prt of the optimised utomton is then: ( ) m n { } n # lower (m) k! 2.25 k n k n=1 k=0 nd we my reclculte the pproximtion: # lower (m) O(( m)m ) = O((1.195m) m ) F. Further possiilities for Optimiztion Without further proof here, it is esy to see tht there is some room for other lnguge-preserving opertions. For instnce in the cse where utomton A is complete, we oserve tht A c -sttes of which the rightmost component hs colour 2 cn e ignored, s well s ll their successors. This is ecuse the completeness enforces tht rnches of the execution tree cn only die if t some point, the deletion process descried in section III removes the component. Since the deletion process is done right-to-left, this is only possile if there exists nother component on the right, which is not the cse here. Therefore rightmost rnch is persistent nd if its colour is 2, this colour never disppers nd future sttes cn never ecome ccepting. Tking our previous exmple, since A is complete, optimiztion directly leds to the utomton of Figure 10 (pplied t construction time nd not s reduction from Figure 9). G. Benchmrk results In this section, we give the output of our performnce test ginst other complementtion constructions. For these experiments, we hve implemented the lgorithm presented in Section III, with the 2 1 optimistion of Section IV-E. The lgorithm ws implemented in Jv nd then trnsformed into plugin for the GOAL 6 softwre. It ws checked ginst usul complementtion methods: slice, rnk nd Sfr-Pitermn, 6

15 ( {q in }) ( {q in }, {q 1 }) ( {q in }, {q 1 }, {q 2 }) ({q in }, {q 1 }, {q 2 }) ({q in }, {q 1 }, {q 2 }) Fig. 10. Reduced utomton A c complement to A. which re ll lredy implemented in GOAL. No specific optimistion (reduction of ded sttes, mximising of the cceptnce condition,... ) ws used for either of the lgorithm. It is cler tht pplying such optimistions will often reduce the output size, s well on our construction thn on the lgorithms it is tested ginst. These preliminry enchmrks only tke into ccount the numer of sttes of the constructed utomton. In order to compre the presented lgorithm (tht we nme here Tuple ) with ech other, we wrote GOAL script tht genertes rndom Büchi utomt with following properties: Numer of sttes: 6 Numer of trnsitions: 24 Size of (propositionl) lphet: 2 Density of ccepting sttes: 0.3 The script pplies the tuple construction on one side, nd the other lgorithm on the other side, nd outputs the numer of sttes nd trnsitions for ech construction. You will note tht the complementtion time is not considered here. The reson is tht computtion time depends too much on the GOAL frmework nd on the wy the vrious lgorithms re implemented. As it is suggested in [16], the Sfr-Pitermn [17] lgorithm produces the lest sttes thn ny other construction to dte. Here re the results for 1000 generted utomt (we print the verge numer of sttes nd trnsitions): Sfr-Pitermn Tuple v. # sttes v. # trnsitions # wins The wins line shows how mny times the lgorithm hs eten its counterprt. Interestingly, the tuple construction ets Sfr-Pitermn nerly hlf of the time. This shows tht our preliminry construction shows good potentil on rndom utomt nd motivtes further reserch on efficiency. We lso deliver some test results ginst other lgorithms implemented if GOAL. Becuse these other lgorithms tke lot more time, the test is only done on 100 utomt: Slice (with turn-wise cut-point optimistion) [2] : Slice Tuple v. # sttes v. # trnsitions # wins Rnk (with tight-rnk nd turn-wise cut-point optimistions) [18]: Rnk Tuple v. # sttes v. # trnsitions # wins Our construction is clerly more efficient one prcticl cses thn those two pproches. H. An Alterntive Construction The worst-cse ounds discussed ove cn e improved, s it ws shown in [1] tht the O(0.76m) m ound is tight. Therefore, there exist complementtion methods tht do not exceed tht ound. We cn improve the ound of our construction y modifying the trnsition function. It is possile to consider only one 2-coloured component t time. The stte-spce of the lower prt is then loosely ounded y: # lower (m) n=1 ( m n ) n { n k! k k=0 } 1.62 k A very loose upper ound for this expression is O(0.86m) m, nd there is strong evidence (y computtion of ctul vlues of the expression) tht it cn e ounded y O(0.76m) m. Demonstrtions of these sttements will e the suject of future pper. We my nevertheless lredy mention tht experimentl results led to oserve tht this lterntive construction does not ehve s well s the primry (optimised) construction. V. CONCLUSION We hve presented here direct complementtion construction for Büchi utomt. The gol ws not to find n efficient lgorithm, such serch would hve een vin ecuse of the theoreticl limits of complementtion. We however strongly elieve tht some prcticl construction cn stem from etter

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

Lecture 09: Myhill-Nerode Theorem

Lecture 09: Myhill-Nerode Theorem CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives

More information

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

Lecture 9: LTL and Büchi Automata

Lecture 9: LTL and Büchi Automata Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Converting Regular Expressions to Discrete Finite Automata: A Tutorial Converting Regulr Expressions to Discrete Finite Automt: A Tutoril Dvid Christinsen 2013-01-03 This is tutoril on how to convert regulr expressions to nondeterministic finite utomt (NFA) nd how to convert

More information

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny

More information

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

More information

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016 CS125 Lecture 12 Fll 2016 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Science Deprtment Compiler Design Fll Lexicl Anlysis Smple Exercises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sciences Institute 4676 Admirlty Wy, Suite

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30 Tlen en Automten Test 1, Mon 7 th Dec, 2015 15h45 17h30 This test consists of four exercises over 5 pges. Explin your pproch, nd write your nswer to ech exercise on seprte pge. You cn score mximum of 100

More information

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations. Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted

More information

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University U.U.D.M. Project Report 07:4 Frey Frctions Rickrd Fernström Exmensrete i mtemtik, 5 hp Hledre: Andres Strömergsson Exmintor: Jörgen Östensson Juni 07 Deprtment of Mthemtics Uppsl University Frey Frctions

More information

Homework Solution - Set 5 Due: Friday 10/03/08

Homework Solution - Set 5 Due: Friday 10/03/08 CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

Model Reduction of Finite State Machines by Contraction

Model Reduction of Finite State Machines by Contraction Model Reduction of Finite Stte Mchines y Contrction Alessndro Giu Dip. di Ingegneri Elettric ed Elettronic, Università di Cgliri, Pizz d Armi, 09123 Cgliri, Itly Phone: +39-070-675-5892 Fx: +39-070-675-5900

More information

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018 CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

State Minimization for DFAs

State Minimization for DFAs Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid

More information

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010 CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w

More information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,

More information

Harvard University Computer Science 121 Midterm October 23, 2012

Harvard University Computer Science 121 Midterm October 23, 2012 Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

More information

The size of subsequence automaton

The size of subsequence automaton Theoreticl Computer Science 4 (005) 79 84 www.elsevier.com/locte/tcs Note The size of susequence utomton Zdeněk Troníček,, Ayumi Shinohr,c Deprtment of Computer Science nd Engineering, FEE CTU in Prgue,

More information

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont. NFA DFA Exmple 3 CMSC 330: Orgniztion of Progrmming Lnguges NFA {B,D,E {A,E {C,D {E Finite Automt, con't. R = { {A,E, {B,D,E, {C,D, {E 2 Equivlence of DFAs nd NFAs Any string from {A to either {D or {CD

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Name Ima Sample ASU ID

Name Ima Sample ASU ID Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)

More information

Worked out examples Finite Automata

Worked out examples Finite Automata Worked out exmples Finite Automt Exmple Design Finite Stte Automton which reds inry string nd ccepts only those tht end with. Since we re in the topic of Non Deterministic Finite Automt (NFA), we will

More information

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA RIGHT LINEAR LANGUAGES. Right Liner Grmmr: Rules of the form: A α B, A α A,B V N, α V T + Left Liner Grmmr: Rules of the form: A Bα, A α A,B V N, α V T

More information

Some Theory of Computation Exercises Week 1

Some Theory of Computation Exercises Week 1 Some Theory of Computtion Exercises Week 1 Section 1 Deterministic Finite Automt Question 1.3 d d d d u q 1 q 2 q 3 q 4 q 5 d u u u u Question 1.4 Prt c - {w w hs even s nd one or two s} First we sk whether

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions

More information

DFA minimisation using the Myhill-Nerode theorem

DFA minimisation using the Myhill-Nerode theorem DFA minimistion using the Myhill-Nerode theorem Johnn Högerg Lrs Lrsson Astrct The Myhill-Nerode theorem is n importnt chrcteristion of regulr lnguges, nd it lso hs mny prcticl implictions. In this chpter,

More information

Infinite Geometric Series

Infinite Geometric Series Infinite Geometric Series Finite Geometric Series ( finite SUM) Let 0 < r < 1, nd let n be positive integer. Consider the finite sum It turns out there is simple lgebric expression tht is equivlent to

More information

2.4 Linear Inequalities and Interval Notation

2.4 Linear Inequalities and Interval Notation .4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook

More information

Designing Information Devices and Systems I Spring 2018 Homework 7

Designing Information Devices and Systems I Spring 2018 Homework 7 EECS 16A Designing Informtion Devices nd Systems I Spring 2018 omework 7 This homework is due Mrch 12, 2018, t 23:59. Self-grdes re due Mrch 15, 2018, t 23:59. Sumission Formt Your homework sumission should

More information

How Deterministic are Good-For-Games Automata?

How Deterministic are Good-For-Games Automata? How Deterministic re Good-For-Gmes Automt? Udi Boker 1, Orn Kupfermn 2, nd Mich l Skrzypczk 3 1 Interdisciplinry Center, Herzliy, Isrel 2 The Herew University, Isrel 3 University of Wrsw, Polnd Astrct

More information

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-* Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion

More information

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh Finite Automt Informtics 2A: Lecture 3 Mry Cryn School of Informtics University of Edinburgh mcryn@inf.ed.c.uk 21 September 2018 1 / 30 Lnguges nd Automt Wht is lnguge? Finite utomt: recp Some forml definitions

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

More information

CSE396 Prelim I Answer Key Spring 2017

CSE396 Prelim I Answer Key Spring 2017 Nme nd St.ID#: CSE96 Prelim I Answer Key Spring 2017 (1) (24 pts.) Define A to e the lnguge of strings x {, } such tht x either egins with or ends with, ut not oth. Design DFA M such tht L(M) = A. A node-rc

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

Quadratic Forms. Quadratic Forms

Quadratic Forms. Quadratic Forms Qudrtic Forms Recll the Simon & Blume excerpt from n erlier lecture which sid tht the min tsk of clculus is to pproximte nonliner functions with liner functions. It s ctully more ccurte to sy tht we pproximte

More information

GNFA GNFA GNFA GNFA GNFA

GNFA GNFA GNFA GNFA GNFA DFA RE NFA DFA -NFA REX GNFA Definition GNFA A generlize noneterministic finite utomton (GNFA) is grph whose eges re lele y regulr expressions, with unique strt stte with in-egree, n unique finl stte with

More information

FABER Formal Languages, Automata and Models of Computation

FABER Formal Languages, Automata and Models of Computation DVA337 FABER Forml Lnguges, Automt nd Models of Computtion Lecture 5 chool of Innovtion, Design nd Engineering Mälrdlen University 2015 1 Recp of lecture 4 y definition suset construction DFA NFA stte

More information

Deterministic Finite Automata

Deterministic Finite Automata Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite

More information

Review of Gaussian Quadrature method

Review of Gaussian Quadrature method Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge

More information

Lecture 2 : Propositions DRAFT

Lecture 2 : Propositions DRAFT CS/Mth 240: Introduction to Discrete Mthemtics 1/20/2010 Lecture 2 : Propositions Instructor: Dieter vn Melkeeek Scrie: Dlior Zelený DRAFT Lst time we nlyzed vrious mze solving lgorithms in order to illustrte

More information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck. Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent

More information

Tutorial Automata and formal Languages

Tutorial Automata and formal Languages Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we

More information

Section 4: Integration ECO4112F 2011

Section 4: Integration ECO4112F 2011 Reding: Ching Chpter Section : Integrtion ECOF Note: These notes do not fully cover the mteril in Ching, ut re ment to supplement your reding in Ching. Thus fr the optimistion you hve covered hs een sttic

More information

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems Centrum voor Wiskunde en Informtic REPORTRAPPORT Supervisory control for nondeterministic systems A. Overkmp Deprtment of Opertions Reserch, Sttistics, nd System Theory BS-R9411 1994 Supervisory Control

More information

Torsion in Groups of Integral Triangles

Torsion in Groups of Integral Triangles Advnces in Pure Mthemtics, 01,, 116-10 http://dxdoiorg/1046/pm011015 Pulished Online Jnury 01 (http://wwwscirporg/journl/pm) Torsion in Groups of Integrl Tringles Will Murry Deprtment of Mthemtics nd Sttistics,

More information

1.4 Nonregular Languages

1.4 Nonregular Languages 74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll

More information

1.3 Regular Expressions

1.3 Regular Expressions 56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,

More information

Finite-State Automata: Recap

Finite-State Automata: Recap Finite-Stte Automt: Recp Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 09 August 2016 Outline 1 Introduction 2 Forml Definitions nd Nottion 3 Closure under

More information

set is not closed under matrix [ multiplication, ] and does not form a group.

set is not closed under matrix [ multiplication, ] and does not form a group. Prolem 2.3: Which of the following collections of 2 2 mtrices with rel entries form groups under [ mtrix ] multipliction? i) Those of the form for which c d 2 Answer: The set of such mtrices is not closed

More information

Formal Methods in Software Engineering

Formal Methods in Software Engineering Forml Methods in Softwre Engineering Lecture 09 orgniztionl issues Prof. Dr. Joel Greenyer Decemer 9, 2014 Written Exm The written exm will tke plce on Mrch 4 th, 2015 The exm will tke 60 minutes nd strt

More information

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1 Non-Deterministic Finite Automt Fll 2018 Costs Busch - RPI 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q q2 1 q 0 q 3 Fll 2018 Costs Busch - RPI 2 Nondeterministic Finite Automton (NFA) Alphbet

More information

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014 CS125 Lecture 12 Fll 2014 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

More information

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion

More information

Discrete Mathematics and Probability Theory Spring 2013 Anant Sahai Lecture 17

Discrete Mathematics and Probability Theory Spring 2013 Anant Sahai Lecture 17 EECS 70 Discrete Mthemtics nd Proility Theory Spring 2013 Annt Shi Lecture 17 I.I.D. Rndom Vriles Estimting the is of coin Question: We wnt to estimte the proportion p of Democrts in the US popultion,

More information