A Algebra-Coalgebra Duality in Brzozowski s Minimization Algorithm

Size: px
Start display at page:

Download "A Algebra-Coalgebra Duality in Brzozowski s Minimization Algorithm"

Transcription

1 A Alger-Colger Dulity in Brzozowski s Minimiztion Algorithm F. BONCHI, ENS Lyon, Université de Lyon LIP (UMR 5668) M.M. BONSANGUE, LIACS - Leiden University H.H. HANSEN, Rdoud University Nijmegen P. PANANGADEN, McGill University J.J.M.M. RUTTEN, Centrum Wiskunde & Informtic A. SILVA, Rdoud University Nijmegen 3 We give new presenttion of Brzozowski s lgorithm to minimize finite utomt, using elementry fcts from universl lger nd colger, nd uilding on erlier work y Ari nd Mnes on ctegoricl presenttion of Klmn dulity etween rechility nd oservility. This leds to simple proof of its correctness nd opens the door to further generliztions. Notly, we derive lgorithms to otin miniml, lnguge equivlent utomt from Moore, non-deterministic nd weighted utomt. Ctegories nd Suject Descriptors: F.. [Theory of Computtion]: Models of Computtion; F.4.3 [Mthemticl Logic nd Forml Lnguges]: Forml Lnguges; I.. [Symolic nd Algeric Mnipultion]: Algorithms Generl Terms: Algorithms, Theory Additionl Key Words nd Phrses: lger, utomt, colger, dulity. INTRODUCTION Dulity plys fundmentl role in mny res of mthemtics, computer science, systems theory nd even physics. For exmple, the fmilir concept of Fourier trnsform is essentilly dulity result: n instnce of Pontrygin dulity, see, for exmple the stndrd textook [Rudin 96]. Another sic instnce, known to undergrdutes, is the dulity of finite-dimensionl vector spces V over some field k, nd the spce of liner mps from V to k, which is itself finite-dimensionl vector spce. Building on this self-dulity, fundmentl principle in systems theory due to [Klmn 959] cptures the dulity etween the concepts of oservility nd controllility (to e explined elow). The ltter ws further extended to utomt theory (where controllility mounts to rechility) in [Ari nd Zeiger 969], nd in vrious ppers [Ari nd Mnes 974; 975; 975c; 975; 980; 980] where Ari nd Mnes explored lgeric utomt theory in ctegoricl frmework; see lso the excellent collection of ppers [Klmn et l. 969] where oth utomt theory nd systems theory is presented. Authors ddresses: F. Bonchi, ENS Lyon, Université de Lyon, Frnce; M. M. Bonsngue, Leiden Institute of Advnced Computer Science, Leiden University, The Netherlnds; P. Pnngden, McGill University, Montrel, Queec, Cnd; J. Rutten, CWI, Amsterdm, The Netherlnds; H. Hnsen nd A. Silv, Intelligent systems section, Rdoud University Nijmegen, The Netherlnds. Also ffilited to CWI, Amsterdm, The Netherlnds. Also ffilited to Rdoud University Nijmegen, The Netherlnds. 3 Also ffilited to CWI, Amsterdm, The Netherlnds & HASL / INESC TEC, Universidde do Minho, Brg, Portugl. Permission to mke digitl or hrd copies of prt or ll of this work for personl or clssroom use is grnted without fee provided tht copies re not mde or distriuted for profit or commercil dvntge nd tht copies show this notice on the first pge or initil screen of disply long with the full cittion. Copyrights for components of this work owned y others thn ACM must e honored. Astrcting with credit is permitted. To copy otherwise, to repulish, to post on servers, to redistriute to lists, or to use ny component of this work in other works requires prior specific permission nd/or fee. Permissions my e requested from Pulictions Dept., ACM, Inc., Penn Plz, Suite 70, New York, NY USA, fx + () , or permissions@cm.org. c YYYY ACM /YYYY/0-ARTA $5.00 DOI 0.45/ ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

2 A: In system with sttes nd trnsitions triggered y ctions, it my e the cse tht n oserver cnnot discern the stte of the system. Insted, he cn see n oservle of some quntity or property tht does not uniquely fix the stte. However, if one cn use sequence of oservtions following prescried course of ctions to determine the stte then one sys tht the system is oservle. Similrly, system is sid to e controllle if sequence of ctions cn drive it into desired stte irrespective of the initil stte. These concepts re nturl for control theory ut seem less relted to utomt. It ws significnt synthesis of [Ari nd Mnes 975] to see tht this mkes sense in utomt theory s well. The min contriution of the present pper is to exploit this dulity to explin rther unexpected nd surprising lgorithm for minimizing utomt due to [Brzozowski 96]: Strting with (possily non-deterministic) utomton tht ccepts lnguge L, one reverses its trnsitions, mkes it deterministic, tkes the prt tht is rechle, nd then repets ll of this once more. The surprise is tht the result will e miniml deterministic utomton tht ccepts L. Although we re presently not concerned with complexity nd performnce, we riefly mention tht lthough the worst cse complexity of the lgorithm is exponentil, it often performs well in prctice, see e.g. [Chmprnud et l. 00; Tkov nd Vrdi 005]. Though n elementry description nd correctness proof of the lgorithm is not very difficult (see for instnce [Skrovitch 009, Cor. 3.4]), this proof does not relly explin why it works. Here, we im t supplying the conceptul reson nd provide proof tht the lgorithm works ecuse of the simple dulity etween rechility nd oservility mentioned ove. We first present reformultion of Ari nd Mnes dulity result in terms of elementry lger nd colger [Rutten 000], from which we will derive (the correctness of) Brzozowski s lgorithm s corollry. We mention tht one of the first ppers to study miniml reliztions using ctegory theory is [Goguen 97]. Although dulity does not ply role there, our definitions of rechility nd oservility re essentilly the sme s in [Goguen 97]. Our resons for giving this new formultion of Brzozowski s lgorithm re the following. First, the dulity etween rechility nd oservility is in itself very eutiful result tht, unfortuntely, it is not very well-known in the computer science community. The work of Klmn [Klmn 959; Klmn et l. 969] is, of course, well known in the systems community ut not, for exmple, in the progrmming lnguges nd logics community. Secondly, sic notions of lger nd colger turn out to e the nturl mthemticl settings for the modelling of rechility nd oservility, respectively, nd provide n elementry proof nd understnding of the lgorithm, pving lso the wy to severl extensions. The elementry proof (in sections 4) uses only the notions of sets nd functions. As result, this prt of the pper should e ccessile to nyone with very sic understnding of utomt. We then present more forml, ctegoricl proof (in Section 9), which identifies the relevnt ctegories nd functors. While it is not essentil to understnd the rest of the pper, it cptures the essence of dulity most clerly. Thirdly, our proof of Brzozowski s lgorithm is esy to generlise. The present pper contins the strightforwrd generlistion of the lgorithm to Moore utomt in Section 5. As n ppliction of this generlistion we show how to use it to minimize utomt corresponding to expressions of Kleene lger with tests (KAT) in Section 6. The construction for Moore utomt is then used to otin Brzozowski-like lgorithms for non-deterministic utomt (NDA) in Section 7, nd weighted utomt (WA) in Section 8. More precisely, these lgorithms tke s input n NDA or WA, nd produces s output miniml Moore utomton tht ccepts the sme (weighted) ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

3 lnguge s the originl one. As for the deterministic cse, the Brzozowski lgorithms for NDA nd WA re sed on performing twice the opertions of reversing nd determiniztion ut such opertions now get different interprettion. We emphsize tht the output utomton is not stte-miniml s n NDA or WA (s for exmple studied in [Ari nd Mnes 975c]). In fct, s shown in Exmple 8.3 the stte spce of our resulting deterministic nd miniml Moore utomton my even e infinite. This pper is n extended version of the pper [Bonchi et l. 0], which only contined the proof of correctness of Brzozowski s lgorithm nd the strightforwrd extension to Moore utomt; thus sections 6 9 re new.. REACHABILITY AND OBSERVABILITY Let = {0}, = {0, } nd let A e ny set. A deterministic utomton with inputs from A is given y the following dt: i X t X A Tht is, set X of sttes, trnsition function t: X X A mpping ech stte x X to function t(x): A X tht sends n input symol A to stte t(x)(), n initil stte i X (formlly denoted y function i: X), nd set of finl (or ccepting) sttes given y function f : X, sending stte to if it is finl nd to 0 if it is not. We introduce rechility nd oservility of deterministic utomt y mens of the following digrm: ε A r X α i t f f o ε? A (A ) A r A X A o A ( A ) A in the middle of which we hve our utomton (X, t, i, f). On the left, we hve the set A of ll words over A. We view this s n utomton with the empty word ε s initil stte nd with trnsition function α: A (A ) A α(w)() = w On the right, we hve the set A of ll lnguges over A, lso viewed s n utomton. The trnsition function of this utomton is β : A ( A ) A β(l)() = {w A w L} (3) where β(l)() is the so-clled (left) -derivtive of the lnguge L; nd finl stte function ε?: A tht mps lnguge to if it contins the empty word, nd to 0 if it does not. Notice tht in the utomton on the left we do not cre out finl stte, only the initil β A:3 () () ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

4 A:4 stte mtters; this mkes sense from the point of view of rechility, we only cre where we cn get to from the initil stte. Similrly for the utomton on the right, we do not cre out the initil stte, only out the finl stte. Horizontlly, we hve functions r nd o tht we will introduce next. First we define x w, for x X nd w A, inductively y x ε = x x w = t(x w )() i.e., x w is the stte reched from x y inputting (ll the letters of) the word w. With this nottion, we now define r : A X o: X A r(w) = i w o(x)(w) = f(x w ) Thus r sends word w to the stte i w tht is reched from the initil stte i X y inputting the word w; nd o sends stte x to the lnguge it ccepts. Tht is, switching freely etween lnguges s mps nd lnguges s susets, o(x) = {w A f(x w ) = } (4) We think of o(x) s the semntics or the ehvior of the stte x. The functions r nd o re homomorphisms in the precise sense tht they mke the tringles nd squres of digrm () commute. In order to understnd the ltter, we note tht t the ottom of the digrm, we use, for f : V W, the nottion f A : V A W A to denote the function defined y f A (φ)() = f(φ()), for φ: A V nd A. One cn redily see tht the function r is uniquely determined y the functions i nd t; similrly, the function o is uniquely determined y the functions t nd f. In ctegoricl terms, the unique existence of r is consequence of A eing n initil lger of the functor + (A ); similrly, the unique existence of o rests on the fct tht A is finl colger of the functor ( ) A. Hving explined digrm (), we cn now give the following definition. Definition. (rechility, oservility, minimlity). A deterministic utomton (X, t, i, f) is rechle if r is surjective, it is oservle if o is injective, nd it is miniml if it is oth rechle nd oservle. Thus (X, t, i, f) is rechle if ll sttes re rechle from the initil stte, tht is, for every x X there exists word w A such tht i w = x; nd (X, t, i, f) is oservle if different sttes recognize different lnguges, in other words, if they hve different oservle ehvior. This explins the use of the word oservle, nmely, n utomton is oservle if its sttes cn e unmiguously identified with their oservle ehviour. Note tht our definition of miniml utomton coincides with the stndrd one, nd for fixed lnguge L, the miniml utomton ccepting L is unique up to isomorphism. 3. CONSTRUCTING THE REVERSE OF AN AUTOMATON Next we show tht y reversing the trnsitions, nd y swpping the initil nd finl sttes of deterministic utomton, one otins new utomton ccepting the reversed lnguge. By construction, this utomton will gin e deterministic. Moreover, if the originl utomton is rechle, the resulting one is oservle. ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

5 A:5 Our construction will mke use of the following opertion: V ( ) : f W which is defined, for set V, y V = {S S V } nd, for f : V W nd S W, y V W f : W V f (S) = {v V f(v) S} (In ctegoricl terms, this is the contrvrint powerset functor.) The reverse construction. Given the trnsition function t: X X A of deterministic utomton, we pply, from left to right, the following three trnsformtions: X t X A X A X X A X f ( X ) A The single, verticl line in the middle corresponds to n ppliction of the opertion ( ) introduced ove. The doule lines, on the left nd on the right, indicte isomorphisms tht re sed on the opertions of currying nd uncurrying. The end result consists of new set of sttes X together with new trnsition function (which y use of nottion we denote y t ) t : X ( X ) A t (S)() = {x X t(x)() S} which mps ny suset S X, for ny A, to the set of ll its -predecessors. Note tht the reversed trnsition function t is gin deterministic. Initil ecomes finl. Applying the opertion ( ) to the initil stte (function) of our utomton X gives i X (where we write for ), y which we hve trnsformed the initil stte i into finl stte function i for the new utomton X. We note tht ccording to this new function i, suset S X is finl (tht is, is mpped to ) precisely when i S. Rechle ecomes oservle. Next we pply ( ) to the entire left hnd-side of digrm (), tht is, to oth t nd i nd to α nd ε, s well s to the functions r nd r A. This yields the following commuting digrm: X i i ε X t X t r A α ( X ) A ra ( A ) A (5) ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

6 A:6 We note tht for ny lnguge L A, we hve ε (L) = ε?(l) nd, for ny A, α (L)() = {w A w L} The ltter resemles the definition of β(l)() ut it is different in tht it uses w insted of w. By the universl property (of finlity) of the triple ( A, β, ε? ), there exists unique homomorphism rev : A A s shown here A α which sends lnguge L to its reverse ε rev ε? A β ( A ) A rev A ( A ) A rev(l) = {w A w R L } where w R is the reverse of w. Comining digrms (5) nd (6) yields the following commuting digrm: X t r A i α rev ε ε? A ( X ) A ra ( A ) A rev A ( A ) A Thus we see tht the composition of rev nd r (is the unique function tht) mkes the following digrm commute: β (6) X i O ε? A O = rev r (7) t β ( X ) A O A ( A ) A One cn esily show tht it stisfies, for ny S X, O(S) = {w R A i w S} (8) Finl ecomes initil. The following ijective correspondence f X f X ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

7 (gin n instnce of currying) trnsforms the finl stte function f of the originl utomton X into n initil stte function of our new utomton X, which we denote gin y f. It will induce, y the universl property of (A, ε, α), unique homomorphism R s follows: ε f A R α X t (A ) A ( X ) A R A Putting everything together. By now, we hve otined the following, new deterministic utomton: ε A α f R X t i O ε? A (A ) A R A ( X ) A O A ( A ) A where the ove digrm is simply the comintion of digrms (9) nd (7) ove. THEOREM 3.. Let (X, t, i, f) e deterministic utomton nd let ( X, t, f, i ) e the reversed deterministic utomton constructed like ove. () If (X, t, i, f) is rechle, then ( X, t, f, i ) is oservle. () If (X, t, i, f) ccepts the lnguge L, then ( X, t, f, i ) ccepts rev(l). PROOF. As the opertion ( ) trnsforms surjections into injections (nd since rev is ijection), rechility of (X, t, i, f) implies oservility of ( X, t, f, i ). The second sttement follows from the fct tht we hve O(f) = {w A i (f w ) = } = {w R A i w f} [y identity (8)] = rev({w A i w f}) = rev(o(i)) We consider the following two utomt. In the picture elow, n rrow points to the initil stte nd doule circle indictes tht stte is finl: x y z xy yz y β, xyz, xz x z A:7 (9) (0) () ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

8 A:8 The utomton on the left is rechle (ut not oservle, since y nd z ccept the sme lnguge {, } + ). Applying the reverse construction yields the utomton on the right, which is oservle (ll the sttes ccept different lnguges) ut not rechle (e.g., the stte {x, y}, denoted y xy, is not rechle from the initil stte {y, z}). Furthermore, the lnguge ccepted y the utomton on the right, {, }, is the reverse of the lnguge ccepted y the utomton on the left, which is {, }. 4. BRZOZOWSKI S ALGORITHM As n immedite consequence, we otin the following version of Brzozowski s lgorithm. COROLLARY 4.. Given deterministic utomton ccepting lnguge L, () pply the reverse construction, () tke the rechle prt, (3) pply the reverse construction, (4) tke the rechle prt. The resulting utomton is the miniml utomton ccepting L. PROOF. The utomton otined fter steps () nd () is rechle nd ccepts rev(l). After step (3), the utomton is oservle nd ccepts rev(rev(l)) = L. Finlly, tking rechility in step (4) yields miniml utomton ccepting L. Note tht in Corollry 4., if the originl utomton is lredy rechle, then the utomton otined fter step () is miniml utomton ccepting rev(l). We sw tht pplying the reverse construction (step ()) to the left utomton in () resulted in the utomton on the right in (). By tking the rechle prt of the ltter (step ()), we otin the utomton depicted elow on the left (where = {y, z}, = {x, y, z} nd 3 = ):, 3, (), The utomton on the right in () is otined y, once more, reversing-determinizing (step (3)) nd tking the rechle prt (step (4)). It is the minimiztion of the utomton we strted with. Note tht the originl lgorithm in [Brzozowski 96] works with non-deterministic utomt, while Corollry 4. is restricted to deterministic utomt. In Section 7, we will show how to tret non-deterministic utomt nd in Section 8 we will further generlize to weighted utomt. First, in the next section, we extend our result to deterministic Moore utomt. 5. MOORE AUTOMATA Moore utomt generlise deterministic utomt y llowing outputs in n ritrry set B, rther thn just. Formlly, Moore utomton with inputs in A nd ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

9 outputs in B consists of set of sttes X, n initil stte i: X, trnsition function t: X X A nd n output function f : X B. Moore utomt ccept functions in B A (tht is functions φ: A B) insted of lnguges in A. Here is in nutshell how our story ove cn e generlised to Moore utomt. We cn redrw digrm () y simply replcing with B. We then define rechility, oservility, nd minimlity s efore. Next, we dopt our procedure of reversing trnsitions y using (the contrvrint functor) B ( ) insted of ( ) : for ll sets V, B V = {φ φ: V B} nd, for ll functions g : V W, the function B g : B W B V mps ech φ B W to B g (φ) = φ g. Finlly, ll the results discussed ove will lso hold for Moore utomt. We note tht lthough the output set B my e infinite, if the stte spce X is finite, then the rnge of the output function B 0 = f[x] B is lso finite, nd we cn view the Moore mchine s hving output in B 0. Consequently, the stte spce B0 X of the reversed Moore mchine is lso finite. The next exmple illustrtes the minimiztion of Moore utomton. We consider the following Moore utomton with inputs in A = {, } nd output in the suset B = { 3, 3, } of the rtionl numers Q. In the picture elow, the output vlue r of stte x is indicted inside the circle y x/r: p/ 3 q/ 3 t/ 3 The utomton ccepts function in B A mpping every word w ending with to, every word ending with to 3 nd every other word to 3. Clerly, the utomton is rechle from p. However, it is not oservle, since, for exmple, the sttes p nd q ccept the sme function. Applying the reverse construction (step ()) yields Moore utomton with B S s set of sttes, where S = {p, q, s, t, u} is the set of sttes of the originl utomton. The output vlue of stte φ: S B is given y φ(p), where p is the initil stte of the originl utomton. Further, the output function of the originl utomton ecomes the new initil stte, i.e., the function φ 0 : S B mpping p nd q to 3, t nd u to 3, nd s to. The rechle prt of the (finite) stte spce B S cn e computed using stndrd lest fixpoint lgorithm tht strts from the initil stte φ 0, nd itertively dds successor sttes until no new sttes re found. We otin the following utomton tht hs only five sttes. s/ u/ 3 A:9 (3) φ 0 / 3 φ / 3, φ / (4) φ 3 / 3 φ 4 / 3,, We do not spell out the full definition of the ove sttes. As n exmple, the stte φ consists of the mp ssigning p, q nd s to 3 (tht is φ 0(q)), nd t, u to (tht is φ 0 (s)). ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

10 A:0 Note tht the function in B A ccepted y the stte φ 0 mps ech word w {, } to the sme vlue where the reverse word w R is mpped y the function ccepted y the originl utomton in (3). More precisely, it mps words which egin with to, words which egin with to 3, nd ll other words to 3. If we repet the reverse construction one more time (step (3)), nd tke the rechle utomton from the new initil stte (step (4)), we otin the miniml Moore utomton equivlent to the one in (3): x/ 3 y/ 3 z/ (5) 6. KLEENE ALGEBRA WITH TESTS Kleene lger with tests (KAT) re simple, ut powerful, extension of regulr expressions nd Kozen s coinductive clculus of KAT [Kozen 997; 008] provides method for deriving Moore utomton from KAT expression. In this section, we show how the lgorithm ove for Moore utomt cn e pplied in order to otin miniml utomton recognizing KAT expression. We will first recll the colgeric theory of Kleene lger with tests from [Kozen 008]. The proof of the existence of finite utomt for KAT expressions in Section 6.4 is essentilly the sme s for the cse of (clssicl) deterministic utomt nd regulr expressions. It cn therey e seen s simplifiction of the proof given in [Kozen 008, Section 5.]. 6.. Expressions Let Σ e set of primitive ction symols p, q Σ nd let T e finite set of primitive test symols t T. We define the set BExp of (Boolen) tests s the Boolen terms over T : BExp :: = t T + 0 The set of toms α, β is At = T. Let denote Boolen equivlence on the set BExp. The quotient of BExp with respect to is then Boolen lger B stisfying B = (BExp/ ) = T = At (the second equlity is ctully n isomorphism). Note tht the toms of the Boolen lger B re (indeed) given y the set At. We denote the -equivlence clss of BExp y [] nd define, for α At, α α [] At or, equivlently, α α +. Next we define the set Exp of KAT expressions e, f y e Exp :: = 6.. Automt on gurded strings We define the set GS of gurded strings x, y y p Σ BExp ef e + f e GS = (At Σ) At We shll denote the elements of At Σ y romn letters, nd the elements of GS y strings x = n α GS for n 0, i At Σ nd α At. An utomton on gurded strings consists of set of sttes S together with n output function f : S At ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

11 nd trnsition function t: S S At Σ A: mpping every s S, for every At Σ, to next stte t(s)() S, lso denoted y s = t(s)() Such utomt re, in other words, colgers (S, f, t ) of the set functor F (S) = At S At Σ. The crrier of the finl colger of this functor consists, s usul, of the set ( At ) (At Σ) = At(At Σ) = (At Σ) At = GS tht is, the set of lnguges over gurded strings. It crries n utomton structure f : GS At nd t: GS ( GS ) At Σ given, for lnguge K GS nd At Σ y f(k) = {α At α K} = K At t(k)() = K = {x GS x K} The ltter is the fmilir derivtive (or left quotient) of lnguges (over the lphet At Σ) The utomton of KAT expressions By using ( slight vrition of) the syntctic Brzozowski derivtives, lso the set Exp of KAT expressions cn e supplied with n utomton structure f : Exp At nd t: Exp Exp At Σ First we define the output f(e) y induction on the structure of d, e Exp: f(p) = f() = {α At α } f(de) = f(d) f(e) f(d+e) = f(d) f(e) f(e ) = At Next we define the -derivtive e = t(e)() Exp, for e Exp nd = α, q At Σ, gin y induction on the structure of e: p = p α,q = { if p = q 0 if p q (de) = (de) α,q = { d f + e if α o(d) d f if α o(d) = 0 (e + f) = e + f (e ) = e e By finlity, there now exists unique homomorphism Exp o GS t,f t,f At Exp At Σ At ( GS ) At Σ which ssigns to ech KAT expression the lnguge (of gurded strings) tht it denotes Finite utomt for KAT expressions For every e Exp nd w (At Σ), we define the repeted derivtive e w y e ε = e nd e w = (e w ). ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

12 A: PROPOSITION 6.. For e, f Exp nd w (At Σ), the repeted derivtives (ef) w, (e + f) w nd (e ) w re of the form for k, l, m 0, t i, u i, v i (At Σ). (ef) w = e t f + + e tk f + f u + + f ul (e + f) w = e w + f w (e ) w = e v e + + e vm e PROOF. The proof is y strightforwrd induction on the syntctic structure of KAT expressions. By the fct tht the repeted derivtives of sic KAT expressions p Σ nd BExp re contined in {0, } nd y Proposition 6., we cn construct for ny KAT expression e Exp finite utomton with e s designted (initil) stte. This utomton is essentilly the suutomton generted y e quotiented with idempotence. This mens tht in the repeted derivtives of e we remove doule occurrences of expressions g in sums of the form + g + + g +. Modulo this reduction, there re only finitely mny repeted derivtives. For instnce, suppose y induction tht we hve proved tht the numer of repeted derivtives of expressions e nd f is ounded y w e N nd w f M. Then it follows from Proposition 6. tht the totl numer w ef of repeted derivtives of ef (with doule occurrences of expressions removed) is ounded y N+M. Note tht it is very esy to come up with much shrper ounds for w e, ut ll we wnted to show here is the existence of finite utomt for KAT expressions. Also note tht the procedure descried in the prgrph ove does not mount to tking the quotient of Exp with respect to the equivlence induced y the xioms ACI (ssocitivity - commuttivity - idempotency) of +. For instnce, for primitive test symols p q, the KAT expressions p + q nd q + p will not e identified; our procedure yields two different (ut isimilr) utomt for these expressions Brzozowski meets Kozen: minimiztion lgorithm for KAT In this section, we show how to otin miniml utomton on gurded strings corresponding to KAT expression e. We will use the following two KAT expressions, over the one letter lphets Σ = {p} nd T = {}, to illustrte the lgorithm E = (p) F = + p(p) The expressions ove denote, respectively, the following two simple impertive progrms while p; if then { p ; while p; } else skip; Intuitively, it is esy to see tht the two progrms re equivlent. We will show tht the utomton corresponding to the expression F cn e minimized to the utomton ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

13 A:3 corresponding to E. The suutomt generted y E nd F in the utomton of KAT expressions re the following: F/,p E/,p E/,p,p 0/0,p,p 0/0,p,p,p By pplying reverse construction (step ()) to the utomton on the left nd then tking its rechle prt (step ()), we otin the following utomton. φ 0 / where φ 0 : {F, E, 0} B is the function defined y,p,p,p 0/0,p φ 0 (F) = φ 0 (E) = φ 0 (0) = 0 nd 0: {F, E, 0} B is the function mpping every stte to 0. In this prticulr exmple, when we execute steps (3) nd (4) for the ove utomton, we recover n isomorphic utomton. This is s expected, since the utomton ove is precisely the utomton for the expression E where the while loop is completely folded. 7. NON-DETERMINISTIC AUTOMATA A non-deterministic utomton with input from finite lphet A is given y finite set X of sttes, trnsition function t: X P ω (X) A tht sends stte x X nd n input symol A to finite set of sttes t(x)(), set of initil sttes given y function i: P ω (X), nd set of finl (or ccepting) sttes given y function f : X which sends stte to if it is finl nd to 0 if it is not. In order to find miniml deterministic utomton recognizing the sme lnguge of non-deterministic utomton, we could first determinize the originl utomton nd then pply Brzozowski s lgorithm in Corollry 4.. Next we show how one cn directly construct, from non-deterministic utomton, deterministic one recognizing the reverse lnguge. Once we hve this utomton, we cn pply Theorem 3. nd otin miniml deterministic utomton recognizing the lnguge of the utomton we strt with. This sves one determininiztion step since determiniztion of the originl utomton nd step () of Corollry 4. re essentilly comined into one determiniztion step. 7.. The reverse of non-deterministic utomton Our construction will mke use of the following lower inverse opertion: V f P ω (V ) f P ω (W ) P ω (W ),p ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

14 A:4 which is defined, for f : V P ω (W ) nd S W, y f : P ω (W ) P ω (V ) f (S) = {v V f(v) S } (In topologicl terms, f is the lower inverse of multifunction f.) Note tht f ( ) = nd tht f (U U ) = f (U ) f (U ). Now, given the trnsition function t: X P ω (X) A of our non-deterministic utomton, we pply, from left to right, the following three trnsformtions: X X A P ω (X A) P ω (X) A t P ω (X) A P ω (X) P ω (X) t P ω (X) The single, verticl line in the middle corresponds to n ppliction of the lower inverse opertion introduced ove. The doule lines on the left indicte the isomorphism sed on the opertions of currying nd uncurrying, wheres the doule lines on the right indicte the isomorphism etween P ω (X A) nd P ω (X) A which holds since we ssume A to e finite. The end result consists of deterministic trnsition function on the set of sttes P ω (X), which y use of nottion we simply denote y t (in nlogy with the nottion t used in Section 3). Concretely, t : P ω (X) P ω (X) A where t (S)() = {x X t(x)() S } which mps ny suset S X, for ny A, to the set of ll sttes tht hve n -trnsition to stte in S. Note tht this lower inverse construction yields deterministic trnsition function. If we pply this lower inverse construction to the initil sttes i: P ω (X) of our originl non-deterministic utomton, we otin the function i : P ω (X) P ω () = with i (S) = if nd only if i( ) S, where = { }. Thus we hve trnsformed the set of initil sttes i into finl stte mp i for the new deterministic utomton on P ω (X), ccording to which suset S X is finl (tht is, is mpped to ) precisely when it contins some initil stte of the originl utomton. As lst step, we trnsform the finl stte function f : X of the originl nondeterministic utomton X into n initil stte of our new deterministic utomton P ω (X), s efore, y using the ijective correspondence etween functions from X to nd elements of X. Putting everything together we now hve constructed deterministic utomton which recognizes the reverse of the lnguge ccepted y the originl utomton. THEOREM 7.. Let (X, t, i, f) e non-deterministic utomton ccepting the lnguge L. Then the lnguge ccepted y the deterministic utomton (P ω (X), t, f, i ) is rev(l). PROOF. We show tht, for ll x X nd for ll w A t(x)(w) f x t (f)(w R ) (6) Note tht here we re using the inductive extensions of t nd t to words, with t(q)(ε) = {q} nd t (S)(ε) = S. Also note tht eqution (6) is slightly more generl sttement thn the theorem, since we re not requiring x to e n initil stte. The proof is y induction on the length of words w A. For the empty word ε, note tht t(x)(ε) f {x} f x f x t (f)(ε). ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

15 A:5 Tke A nd w A. t(x)(w) f ( t(y)(w) y t(x)() ) f y t(x)() t(y)(w) f (definition of t on words) y t(x)() y t (f)(w R ) (induction hypothesis) t(x)() t (f)(w R ) x t (t (f)(w R ))() (definition of t ) x t (f)(w R ) (definition of t on words) x t (f)((w) R ) Now, y replcing step () in Corollry 4., y the lower inverse construction, we otin the originl Brzozowski lgorithm [Brzozowski 96] for non-deterministic utomt. Indeed, since (P ω (X), t, f, i ) is deterministic nd ccepts rev(l), y tking its rechle prt (step ()), nd y reversing it (step (3)), we otin deterministic utomton tht is oservle nd ccepts rev(rev(l)) = L. By tking its rechle prt gin (step (4)), we otin deterministic utomton tht is miniml nd ccepts L. Exmple 7.. We pply this lgorithm to the following utomton (tken from [Adámek et l. 0]):, 3 which recognizes the lnguge L = {w w } consisting ll words ending in nd contining t lest two s. Applying the lower inverse construction nd tking rechility we otin the utomton, 3 3, 3 which recognizes the reverse lnguge rev(l) = {w w }. We cn now reverse (step (3)) nd tke the rechle prt (step (4)), otining the following deterministic utomton which is the miniml deterministic utomton recognizing the lnguge L = {w w }. 8. WEIGHTED AUTOMATA Next we will generlize the ove construction for non-deterministic utomt to weighted utomt over certin semirings. ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

16 A:6 8.. Semirings nd semimodules Recll tht semiring is tuple (S, +,, 0, ) where (S, +, 0) nd (S,, ) re monoids, the former of which is commuttive, nd multipliction distriutes over finite sums: r 0 = 0 = 0 r r (s + t) = r s + r t (r + s) t = r t + s t We just write S to denote semiring. In this section we require semiring to e commuttive, which mens tht the monoid (S,, ) is lso commuttive. Exmples of commuttive semirings re: every field, the Boolen semiring, the semiring (N, +,, 0, ) of nturl numers, nd the tropicl semiring (N { }, min, +,, 0). The semiring of lnguges (P ω (A ),,,, ε) with conctention s multipliction is n exmple of non-commuttive semiring. For semiring S, n S-semimodule is commuttive monoid (M, +, 0) with leftction S M M denoted y juxtposition rm for r S nd m M, such tht for every r, s S nd every m, n M the following lws hold: (r + s)m = rm + sm r(m + n) = rm + rn 0m = 0 r0 = 0 m = m r(sm) = (r s)m Every semiring S is n S-semimodule, where the ction is tken to e just the semiring multipliction. Semilttices re nother exmple of semimodules (for the Boolen semiring S). An S-semimodule homomorphism is monoid homomorphism h: M M such tht h(rm) = rh(m) for ech r S nd m M. S-semimodule homomorphisms re lso clled liner mps. The set of ll liner mps from S-semimodule M to M is denoted y Lin(M, M ). Free S-semimodules over set X exist nd cn e constructed using the functor V : Set Set defined on sets X nd mps h: X Y s follows: V (X) = { ϕ: X S ϕ hs finite support }, V (h(ϕ)) = ( y x h (y) ϕ(x)), where function ϕ: X S is sid to hve finite support if ϕ(x) 0 holds only for finitely mny elements x X. One cn think of V (X) s consisting of ll forml liner comintions of elements of X. In fct, V (X) is the free S-semimodule on X when equipped with the following pointwise S-semimodule structure: (ϕ + ϕ )(x) = ϕ (x) + ϕ (x) (sϕ )(x) = s ϕ (x). Free semimodules enjoy the following universl property: for every function h: X M from set X to semimodule M, there exists unique liner mp h : V (X) M tht is clled the liner extension of h. In the following, we will often identify function with its liner extension (nd thus we will often use h in plce of h ). A sis of n S-semimodule M is suset X of M such tht the liner extension of the function X M is n isomorphism (tht is, V (X) nd M re isomorphic s S-semimodules). Similrly to vector spces, we define for n S-semimodule M over commuttive semiring S its dul spce M to e the set Lin(M, S) of ll liner mps etween M nd S, endowed with the S-semimodule structure otined y tking pointwise ddition nd monoidl ction: (g + h)(m) = g(m) + h(m), nd (sh)(m) = s h(m). Note tht S = V () nd tht S = Lin(S, S) = S. Unlike vector spces, not ll S-semimodules re free semimodules (just s not ll modules over ring re free modules). An importnt oservtion in [Worthington 009] is tht for commuttive semiring S, if M = V (X) is free S-semimodule with finite ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

17 A:7 non-empty set X s sis, then the dul spce M is free S-semimodule with s sis the following set (of the sme crdinlity s X): {x Lin(M, S) x X nd x (y) = if x = y, nd 0 otherwise}. Tht is, x : M S is the projection on the x-component. By considering elements of M s column vectors, the elements of M re row vectors. For liner mp h: M M etween S-semimodules M nd M the trnspose h T : M M is the mp defined y h T (ϕ) = ϕ h for every ϕ M = Lin(M, S). It is esy to see tht h T (ϕ) M. Note tht in mtrixnottion h T is indeed the liner mp given y the trnsposed mtrix of h. From the commuttivity of S it follows tht (g h) T = h T g T. Finlly, we note tht V (X) nd V (X) re isomorphic, since they re freely generted from ses of the sme crdinlity. 8.. The reverse of weighted utomton A weighted utomton with finite input lphet A nd weights over semiring S is given y set of sttes X, function t: X V (X) A (encoding the trnsition reltion in the following wy: the stte x X cn mke trnsition to y X with input A nd weight s S if nd only if t(x)()(y) = s), finl stte function f : X S ssociting n output weight with every stte, nd n initil stte function i: V (X). It will e convenient to descrie weighted utomt using mtrix-vector nottion. The initil stte function i is then column vector, nd the finl stte function f is row vector. The trnsition function t cn e seen s n A-indexed collection of mps t : X V (X) which y linerity uniquely determines liner mp t : V (X) V (X). Hence t corresponds to n A-indexed collection of X X-mtrices t where t (y, x) = t(x)()(y) for ll x, y X. We denote mtrix multipliction y. Given stte vector v in V (X), the next stte vector fter reding letter is given y the product t v, nd the output of stte vector v is the product f v. The inductive extension of t from letters to words mounts to mtrix-multipliction with t 0... n = t n... t 0 for 0... n A + nd t ε is equl to the identity mtrix. Like Moore utomt, weighted utomt recognize functions in S A which re usully referred to s forml power series (over S), nd herefter denoted y σ nd ρ. More precisely, the forml power series recognized y weighted utomton (X, t, i, f) is the function tht mps w A to f(t(i)(w)) S, or in mtrix nottion w f t w i. Notice tht if we tke S to e the Boolen semiring then weighted utomt re precisely non-deterministic utomt (ecuse V nd P ω re nturlly isomorphic). Next we recll from [Worthington 009] how to construct from weighted utomton (X, t, i, f) deterministic Moore utomton recognizing the reverse lnguge. The stte spce of this reverse Moore utomton will e V (X). Given the trnsition function t: X V (X) A of weighted utomton, we pply, from left to right, the following three trnsformtions: X X A V (X A) (V (X) ) A t V (X) A V (X) V (X) t T V (X) Agin, we use nottion nd simply write t T for the end result, ignoring the isomorphisms. As efore, the doule lines on the left indicte the isomorphism sed on the opertions of currying nd uncurrying, wheres the doule lines on the right indicte ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

18 A:8 the isomorphism etween V (X A) nd (V (X) ) A otined from the isomorphism V (X A) = V (X) A (for A nd X finite sets) nd the fct tht M = M whenever M is free. The single, verticl line in the middle corresponds to n ppliction of the trnspose opertion to the liner extension of the function X A V (X). The end result consists of deterministic trnsition function on the set of sttes V (X) : ( ) t T : V (X) (V (X) ) A t T (ϕ)() si x i = s i ϕ(t(x i )()) where ϕ V (X), A nd s i x i is n element in V (X) expressed s forml sum. In the specil cse of non-deterministic utomt, trnsposing is esily seen to correspond to reversl of trnsitions. If we trnspose the (liner extension of the) initil stte function i: V (X) of our originl weighted utomton, we otin the (liner) function i T : V (X) V () = S with i T (ϕ) = ϕ(i( )), where = { }. This function will give the output weight ssocited to ech stte in the reverse Moore utomton. As lst step, we trnspose the (liner extension of the) finl stte function f : X S of the originl weighted utomton we otin the mp f T : S V (X) (recll tht S = S) defined y f T (s) ( s i x i ) = s s i f(x i ). Becuse of linerity we cn restrict its domin to the multiplictive unit of S nd otin the initil stte of the reverse Moore utomton s the liner mp f T (): s i x i s i f(x i ) = f ( s i x i ). Note tht f T is indeed the column vector otined y trnsposing the row vector f. THEOREM 8.. Let (X, t, i, f) e weighted utomton over commuttive semiring S nd finite input lphet A recognizing forml power series σ : A S. The reverse Moore utomton constructed ove (V (X), t T, f T, i T ) recognizes the power series σ R which is defined for ll w A y where w R is the reversed string of w. σ R (w) = σ(w R ) PROOF. We need to show for ll w A tht (using mtrix nottion) f t w i = i T t T w R f T. (7) Since f t w i is in S, i.e., it is -mtrix, it is equl to its own trnspose, nd hence (7) follows if we cn show tht t T w = t T w R for ll w A. We prove this y induction on the length of w. For w = ε, t T ε nd t ε R re oth equl to the identity mtrix. For the induction step, we hve for A nd u A : t T u = (t u t ) T = t T t T u (IH) = t T t T u R = tt u R = tt (u) R. Now, y replcing step () in Corollry 4., y the reverse Moore utomton construction, we otin Brzozowski lgorithm for weighted utomt. Indeed, strting with weighted utomton (X, t, i, f) which recognizes σ, the reverse Moore utomton (V (X), t T, f T, i T ) recognizes σ R, y tking its rechle prt (step ()), nd reversing it (step (3)), we otin Moore utomton tht is oservle nd recognizes σ. By tking its rechle prt gin (step (4)), we otin Moore utomton tht is miniml nd recognizes σ. Exmple 8.. We illustrte this lgorithm with n exmple over the semiring of rel numers nd the lphet A = {, }. Tke X = {x, y, z}, i = ( 0 0) T nd f = ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

19 A:9 ( ), with the trnsition function represented elow x, y, t = 0 0 t = 0 0, z, ( ) This weighted utomton recognizes the power series σ tht ssigns to ε, to words in nd 0 to ny other word. The reverse Moore utomton hs initil stte f T = ( ) T, output mp (represented s vector) i T = ( 0 0), nd trnsition function t T : V (X) (V (X) ) A s represented elow. Recll tht V (X) = V (X) nd t T is determined y its ction on the sis vectors x, y, z which we simply denote x, y, z.,, x y, z, t T = t T = ( The rechle prt of the reverse Moore utomton is depicted here: ) x/ z/0 y/, 0/0, where x = f T = ( ) T, y = ( 0 0) T, z = (0 ) T nd 0 = (0 0 0) T. We cn now esily see tht this new utomton recognizes the power series ρ tht ssigns to ε, to words in nd 0 to ny other word. It is esy to see tht indeed ρ(w) = σ(w R ), for ny w A. Now, we hve deterministic Moore utomton nd we cn execute steps (3) nd (4) in order to otin the miniml Moore utomton recognizing the power series σ. / /, /0 where, nd stnd for the functions {x, y, z, 0} R represented s vectors s, respectively, ( 0 0) T, ( 0 0) T nd ( ) T. Exmple 8.3. We give nother exmple of the construction with n exmple over the semiring of rel numers nd singleton lphet A = {}. Tke X = {x, y, z}, i = ( 0 ) T nd f = ( ), with trnsition function represented elow (we omit the ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

20 A:0 lel ) x z y t = ( ) This weighted utomton recognizes the power series σ tht mps n into 3 + n. Since A = {}, ech word w is equl to its reversed w R nd thus σ R = σ. The reverse Moore utomton hs initil stte f T = ( ) T, finl stte function i T = ( 0 ) nd trnsition function: x z y t T = ( ) Differently from the exmple ove, the rechle prt of the reverse Moore utomton is now infinite (elow, x = f T = ( ) T, y = ( 3) T nd z = ( 3 4) T ). x/3 y/4 z/5... However, since V (X) is generted from finite sis (for the properties discussed t the end of Section 8.), then lso the rechle sttes might e finitely generted. This is indeed the cse of the ove exmple where z cn e expressed s liner comintion of x nd y (z = y x). Intuitively, the ove infinite Moore utomton cn e finitely represented y the following weighted utomton x y hving s initil stte function i = ( 0) T nd finl stte function f = (3 4). Now, y pplying steps (3) nd (4) to the otined Moore utomton (or to its finite representtion), we get the exctly the sme utomton (since, in this specil cse, σ = ρ). We conclude this section y remrking tht in generl, nd not unexpectedly, we cnnot pply the lgorithm ove to ll semirings. In prticulr, in the exmple ove, if we would hve tken the utomton to e over the semiring of nturl numers, then the rechle prt of the reverse Moore utomton would not e finitely sed (like the two sttes weighted utomton ove). Note tht s we remrked ove z = y x which requires negtive coefficients. In generl, we will e le to gurntee tht the rechle prt of the reverse Moore utomton is finitely sed only for Noetherin semirings [Ézik nd Mletti 0; Bonsngue et l. 0]. 9. ADJUNCTIONS OF AUTOMATA: A CATEGORICAL PERSPECTIVE In this section we will mke explicit the ctegoricl picture tht underlies Theorem 3.. The min oservtion here is tht the dul self-djunction on the ctegory Set (induced y the contrvrint powerset functor) extends to one on the ctegory of deterministic utomt. We will lso see tht Brzozowski s minimistion lgorithm cn e descried ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

21 A: succinctly in terms of functors etween ctegories of utomt. From this ctegoricl picture the Brzozowski lgorithm for Moore utomt is n immedite nd esy generlistion. 9.. Self-dul djunction of Set The ctegory of sets nd functions is denoted y Set. There is n djunction etween Set nd Set op induced y the contrvrint powerset functor ( ) : Set Set op (s illustrted on the left in (8)) which mens tht there is nturl ijection etween morphisms s shown on the right in (8). Recll tht morphism X Y in Set op is morphism Y X in Set, i.e. function from Y to X. The op -nottion indictes the contrvrince. In prticulr, the functor op does exctly the sme s ; the op -superscript just keeps trck of the direction. Set op Set op X Y in Set (8) X Y in Set op In terms of set functions, the ijection of morphisms is given y tking exponentil trnspose which we denote y f ˆf (in oth directions): f : X Y ˆf : Y X in Set in Set given y: y f(x) x ˆf(y) (9) 9.. Ctegories of utomt We denote y DA the ctegory of deterministic utomt nd utomton morphisms. A deterministic utomton is oth + (A )-lger (initil stte plus trnsition structure) nd ( ) A -colger (output function plus trnsition structure), nd n utomton morphism is function tht respects oth structures. Tht is, n utomton morphism etween utomt (X, t, i, f) nd (Y, s, j, g) is mp h: X Y such tht the following digrm commutes: i X j h f Y g (0) t X A h A Y A For exmple, in digrm () (on pge 3) the rechility mp r is morphism of + (A )-lgers, nd the oservility mp o is morphism of ( ) A -colgers, ut not vice vers. The ctegory DA hs neither initil nor finl ojects, since utomton morphisms must preserve the ccepted lnguge. For given lnguge L A we will therefore restrict our ttention to the full suctegory DA(L) of DA which hs s its ojects ll the deterministic utomt tht ccept L. The ctegory DA(L) hs oth n initil oject nd finl oject tht re otined s follows. Consider gin the digrm () which hs on the left the initil +(A )-lger (A, α, ε) nd on the right the finl ( ) A - colger ( A, β, ε?). The initil oject of DA(L) is otined y dding to (A, α, ε) s output function χ L, the chrcteristic function of L. The finl oject of DA(L) is otined y dding the lnguge L s initil stte to ( A, β, ε?). The rechility nd s ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

22 A: oservility mps re now oth DA(L) morphisms, nd hence they re the initil, respectively finl, morphism in DA(L): L χ L () ε A r i X f o ɛ? A α (A ) A r A X A o A ( A ) A The notions of rechility nd oservility cn now e formulted in terms of initility nd finlity: An utomton in DA(L) is rechle if the initil morphism r is surjective. An utomton in DA(L) is oservle if the finl morphism o is injective. Note tht the finl morphism from the initil oject (A, α, ε, χ L ) ssigns to word w A the set of ll words u A such tht wu L. So the kernel of the finl oservility mp is nothing ut the Myhill-Nerode equivlence of L, nd the imge is miniml utomton tht ccepts L which hs s its sttes the set {β(l)(w) w A } of ll derivtives of L. The picture in () thus nicely cptures the well known equivlence: () L is regulr iff () the set of derivtives of L is finite iff (3) the Myhill-Nerode equivlence hs finite index Self-dul djunction of DA The definition of the reverse utomton in Section 3 defines mp on the ojects of DA using the contrvrint powerset functor on Set. It cn esily e verified tht y tking (f) = f = f for n utomton morphism f, tht is contrvrint functor on DA. We will now show tht the functor lifts the self-dul djunction on Set to DA. PROPOSITION 9.. The functor is lifting of the contrvrint powerset functor to the ctegory DA, which mens tht the following digrm commutes (U denotes the forgetful functor which sends n utomton to its stte set): t β DA U Set op op DA op U Set op In prticulr, induces self-dul djunction on DA. PROOF. The commuttivity of the digrm is cler from the definition of the reverse utomton. To see tht we indeed hve n djunction on DA we hve to show tht for ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

23 ll X = X, t, i, f nd Y = Y, s, j, g in DA there is nturl ijection of morphisms: A:3 X op (Y) in DA () (X ) Y in DA op The ove follows y showing tht the ijection vi exponentil trnspose given in (9) restricts to one etween DA-morphisms, tht is, we hve to prove tht function h: X Y is n DA-morphism exctly when its exponentil trnspose ĥ: Y X is. First we note tht in the construction of the reverse utomton, the finl stte function is turned into the initil stte function y tking exponentil trnspose. (This ws left implicit in Section 3.) Thus we wnt to prove tht for ll functions h: X Y, the following digrms X t h Y s X A ha ( Y ) A commute if nd only if s Y i ĝ X h Y (i) (ii) (iii) ĥ X t Y A ĥa ( X ) A j Y ĥ ˆf X (i ) (ii ) (iii ) commute. This will e esy to prove using the following fct: For ny function e: Z Y, the exponentil trnspose of ĥ e is equl to e h, i.e., since for ll x X, z Z: Z X e Y h Y ĥ X X Y f g h ĥ Y X (3) e Z x ĥ(e(z)) e(z) h(x) z e (h(x)) = e (h(x)). Now [(iii) (ii )] nd [(ii) (iii )] re esily otined from (3): f = j h ˆf = ĥ j nd g = i ĥ ĝ = h i. To see tht [(i) (i )] holds, note tht the commuttivity of these digrms cn e formulted prmetric in A. We will use the nottion t for the trnsition function for lel, i.e., t : X X where t (x) = t(x)(). We hve: (i) commutes for ll A: s h = h t (i ) commutes for ll A: t ĥ = ĥ s. By tking trnsposes on oth sides (nd using ĥ = h) it follows y (3) tht (i) commutes iff (i ) does. Since the reverse utomton ccepts the reverse lnguge, the ove djunction restricts to one etween DA(L) nd DA(rev(L)) op. j i ACM Journl Nme, Vol. V, No. N, Article A, Puliction dte: Jnury YYYY.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Let's start with an example:

Let's start with an example: Finite Automt Let's strt with n exmple: Here you see leled circles tht re sttes, nd leled rrows tht re trnsitions. One of the sttes is mrked "strt". One of the sttes hs doule circle; this is terminl stte

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

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

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. 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

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy: Scnner Specifying ptterns source code tokens scnner prser IR A scnner must recognize the units of syntx Some prts re esy: errors mps chrcters into tokens the sic unit of syntx x = x + y; ecomes

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

A negative answer to a question of Wilke on varieties of!-languages

A negative answer to a question of Wilke on varieties of!-languages A negtive nswer to question of Wilke on vrieties of!-lnguges Jen-Eric Pin () Astrct. In recent pper, Wilke sked whether the oolen comintions of!-lnguges of the form! L, for L in given +-vriety of lnguges,

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

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

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

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

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

CM10196 Topic 4: Functions and Relations

CM10196 Topic 4: Functions and Relations CM096 Topic 4: Functions nd Reltions Guy McCusker W. Functions nd reltions Perhps the most widely used notion in ll of mthemtics is tht of function. Informlly, function is n opertion which tkes n input

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

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

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

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

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd T. vn Lrhoven Institute for Computing nd Informtion Sciences Intelligent

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

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

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

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

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Mehryr Mohri Cournt Institute nd Google Reserch mohri@cims.nyu.com Preliminries Finite lphet Σ, empty string. Set of ll strings over

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

Formal Languages and Automata Theory. D. Goswami and K. V. Krishna

Formal Languages and Automata Theory. D. Goswami and K. V. Krishna Forml Lnguges nd Automt Theory D. Goswmi nd K. V. Krishn Novemer 5, 2010 Contents 1 Mthemticl Preliminries 3 2 Forml Lnguges 4 2.1 Strings............................... 5 2.2 Lnguges.............................

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

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

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

Analytically, vectors will be represented by lowercase bold-face Latin letters, e.g. a, r, q.

Analytically, vectors will be represented by lowercase bold-face Latin letters, e.g. a, r, q. 1.1 Vector Alger 1.1.1 Sclrs A physicl quntity which is completely descried y single rel numer is clled sclr. Physiclly, it is something which hs mgnitude, nd is completely descried y this mgnitude. Exmples

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

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

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

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

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

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

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

Bernoulli Numbers Jeff Morton

Bernoulli Numbers Jeff Morton Bernoulli Numbers Jeff Morton. We re interested in the opertor e t k d k t k, which is to sy k tk. Applying this to some function f E to get e t f d k k tk d k f f + d k k tk dk f, we note tht since f

More information

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24 Mtrix lger Mtrix ddition, Sclr Multipliction nd rnsposition Mtrix lger Section.. Mtrix ddition, Sclr Multipliction nd rnsposition rectngulr rry of numers is clled mtrix ( the plurl is mtrices ) nd the

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

Lecture Solution of a System of Linear Equation

Lecture Solution of a System of Linear Equation ChE Lecture Notes, Dept. of Chemicl Engineering, Univ. of TN, Knoville - D. Keffer, 5/9/98 (updted /) Lecture 8- - Solution of System of Liner Eqution 8. Why is it importnt to e le to solve system of liner

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

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

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

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

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

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

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

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

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 9 1. (4pts) ((p q) (q r)) (p r), prove tutology using truth tles. p

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

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

The Cayley-Hamilton Theorem For Finite Automata. Radu Grosu SUNY at Stony Brook

The Cayley-Hamilton Theorem For Finite Automata. Radu Grosu SUNY at Stony Brook The Cyley-Hmilton Theorem For Finite Automt Rdu Grosu SUNY t Stony Brook How did I get interested in this topic? Convergence of Theories Hyrid Systems Computtion nd Control: - convergence etween control

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.

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

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

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

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

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

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So.

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So. 5/9/ Comintionl Logic ENGG05 st Semester, 0 Dr. Hyden So Representtions of Logic Functions Recll tht ny complex logic function cn e expressed in wys: Truth Tle, Boolen Expression, Schemtics Only Truth

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

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

and that at t = 0 the object is at position 5. Find the position of the object at t = 2.

and that at t = 0 the object is at position 5. Find the position of the object at t = 2. 7.2 The Fundmentl Theorem of Clculus 49 re mny, mny problems tht pper much different on the surfce but tht turn out to be the sme s these problems, in the sense tht when we try to pproimte solutions we

More information

A tutorial on sequential functions

A tutorial on sequential functions A tutoril on sequentil functions Jen-Éric Pin LIAFA, CNRS nd University Pris 7 30 Jnury 2006, CWI, Amsterdm Outline (1) Sequentil functions (2) A chrcteriztion of sequentil trnsducers (3) Miniml sequentil

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

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

CS12N: The Coming Revolution in Computer Architecture Laboratory 2 Preparation

CS12N: The Coming Revolution in Computer Architecture Laboratory 2 Preparation CS2N: The Coming Revolution in Computer Architecture Lortory 2 Preprtion Ojectives:. Understnd the principle of sttic CMOS gte circuits 2. Build simple logic gtes from MOS trnsistors 3. Evlute these gtes

More information

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers 80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES 2.6 Finite Stte Automt With Output: Trnsducers So fr, we hve only considered utomt tht recognize lnguges, i.e., utomt tht do not produce ny output on ny input

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

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7 CS103 Hndout 32 Fll 2016 Novemer 11, 2016 Prolem Set 7 Wht cn you do with regulr expressions? Wht re the limits of regulr lnguges? On this prolem set, you'll find out! As lwys, plese feel free to drop

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

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

Java II Finite Automata I

Java II Finite Automata I Jv II Finite Automt I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz Finite Automt I p.1/13 Processing Regulr Expressions We lredy lerned out Jv s regulr expression

More information

Handout: Natural deduction for first order logic

Handout: Natural deduction for first order logic MATH 457 Introduction to Mthemticl Logic Spring 2016 Dr Json Rute Hndout: Nturl deduction for first order logic We will extend our nturl deduction rules for sententil logic to first order logic These notes

More information

Things to Memorize: A Partial List. January 27, 2017

Things to Memorize: A Partial List. January 27, 2017 Things to Memorize: A Prtil List Jnury 27, 2017 Chpter 2 Vectors - Bsic Fcts A vector hs mgnitude (lso clled size/length/norm) nd direction. It does not hve fixed position, so the sme vector cn e moved

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

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

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

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors: Vectors 1-23-2018 I ll look t vectors from n lgeric point of view nd geometric point of view. Algericlly, vector is n ordered list of (usully) rel numers. Here re some 2-dimensionl vectors: (2, 3), ( )

More information