NON-DETERMINISTIC KLEENE COALGEBRAS

Size: px
Start display at page:

Download "NON-DETERMINISTIC KLEENE COALGEBRAS"

Transcription

1 Logicl Methods in Computer Science Vol. 6 (3:23) 2010, pp Submitted Jn. 3, 2010 Published Sep. 9, 2010 NON-DETERMINISTIC KLEENE COALGEBRAS ALEXANDRA SILVA, MARCELLO BONSANGUE b, AND JAN RUTTEN c CWI, Amsterdm, The Netherlnds e-mil ddress: ms@cwi.nl b LIACS, University of Leiden,The Netherlnds e-mil ddress: mrcello@lics.nl c CWI (Amsterdm), VUA (Amsterdm) nd RUN (Nijmegen), The Netherlnds e-mil ddress: jnr@cwi.nl Abstrct. In this pper, we present systemtic wy of deriving (1) lnguges of (generlised) regulr expressions, nd (2) sound nd complete xiomtiztions thereof, for wide vriety of systems. This generlizes both the results of Kleene (on regulr lnguges nd deterministic finite utomt) nd Milner (on regulr behviours nd finite lbelled trnsition systems), nd includes mny other systems such s Mely nd Moore mchines. 1. Introduction In previous pper [9], we presented lnguge to describe the behviour of Mely mchines nd sound nd complete xiomtiztion thereof. The defined lnguge nd xiomtiztion cn be seen s the nlogue of clssicl regulr expressions [21] nd Kleene lgebr [22], for deterministic finite utomt (DFA), or the process lgebr nd xiomtiztion for lbelled trnsition systems (LTS) [28]. We now extend the previous pproch nd devise frmework wherein lnguges nd xiomtiztions cn be uniformly derived for lrge clss of systems, including DFA, LTS nd Mely mchines, which we will model s colgebrs. Colgebrs provide generl frmework for the study of dynmicl systems such s DFA, Mely mchines nd LTS. For functor G: Set Set, G-colgebr or G-system is pir (S,g), consisting of set S of sttes nd function g: S G(S) defining the trnsitions of the sttes. We cll the functor G the type of the system. For instnce, DFA cn be modelled s colgebrs of the functor G(S) = 2 S A, Mely mchines re obtined by tking G(S) = (B S) A nd imge-finite LTS re colgebrs for the functor G(S) = (P ω (S)) A, where P ω is finite powerset ACM Subject Clssifiction: F3.1, F3.2, F4.1. Key words nd phrses: Colgebr, Kleene s theorem, xiomtiztion. The first uthor ws prtilly supported by the Fundção pr Ciênci e Tecnologi, Portugl, under grnt number SFRH/BD/27482/2006. LOGICAL METHODS Ð IN COMPUTER SCIENCE DOI: /LMCS-6 (3:23) 2010 c A. Silv, M. Bonsngue, nd J. Rutten CC Cretive Commons

2 2 A. SILVA, M. BONSANGUE, AND J. RUTTEN Under mild conditions, functors G hve finl colgebr (unique up to isomorphism) into which every G-colgebr cn be mpped vi unique so-clled G-homomorphism. The finl colgebr cn be viewed s the universe of ll possible G-behviours: the unique homomorphism into the finl colgebr mps every stte of colgebr to cnonicl representtive of its behviour. This provides generl notion of behviourl equivlence: two sttes re equivlent if nd only if they re mpped to the sme element of the finl colgebr. Instntiting the notion of finl colgebr for the forementioned exmples, the result is s expected: for DFA the finl colgebr is the set 2 A of ll lnguges over A; for Mely mchines it is the set of cusl functions f: A ω B ω ; nd for LTS it is the set of finitely brnching trees with rcs lbelled by A modulo bisimilrity. The notion of equivlence lso specilizes to the fmilir notions: for DFA, two sttes re equivlent when they ccept the sme lnguge; for Mely mchines, if they relize (or compute) the sme cusl function; nd for LTS if they re bisimilr. It is the min im of this pper to show how the type of system, given by the functor G, is not only enough to determine notion of behviour nd behviourl equivlence, but lso llows for uniform derivtion of both set of expressions describing behviour nd corresponding xiomtiztion. The theory of universl colgebr [31] provides stndrd equivlence nd universl domin of behviours, uniquely bsed on the functor G. The min contributions of this pper re (1) the definition of set of expressions Exp G describing G-behviours, (2) the proof of the correspondence between behviours described by Exp G nd loclly finite G-colgebrs (this is the nlogue of Kleene s theorem), nd (3) corresponding sound nd complete xiomtiztion, with respect to bisimultion, of Exp G (this is the nlogue of Kleene lgebr). All these results re solely bsed on the type of the system, given by the functor G. In nutshell, we combine the work of Kleene with colgebr, considering the clss of non-deterministic functors. Hence, the title of the pper: non-deterministic Kleene colgebrs. Orgniztion of the pper. In Section 2 we introduce the clss of non-deterministic functors nd colgebrs. In Section 3 we ssocite with ech non-deterministic functor G generlized lnguge Exp G of regulr expressions nd we present n nlogue of Kleene s theorem, which mkes precise the connection between Exp G nd G-colgebrs. A sound nd complete xiomtiztion of Exp G is presented in Section 4. Section 5 contins two more exmples of ppliction of the frmework nd Section 6 shows lnguge nd xiomtiztion for the clss of polynomil nd finitry colgebrs. Section 7 presents concluding remrks, directions for future work nd discusses relted work. This pper is n extended version of [11, 10]: it includes ll the proofs, more exmples nd explntions, new mteril bout polynomil nd finitry functors nd n extended discussion section. 2. Preliminries We give the bsic definitions on non-deterministic functors nd colgebrs nd introduce the notion of bisimultion. First we fix nottion on sets nd opertions on them. Let Set be the ctegory of sets nd functions. Sets re denoted by cpitl letters X,Y,... nd functions by lower cse f,g,... We write for the empty set nd the collection of ll finite subsets of set X is defined s P ω (X) = {Y X Y finite}. The collection of functions from set X to set

3 NON-DETERMINISTIC KLEENE COALGEBRAS 3 Y is denoted by Y X. We write id X for the identity function on set X. Given functions f : X Y nd g : Y Z we write their composition s g f. The product of two π 1 π 2 sets X,Y is written s X Y, with projection functions X X Y Y.The set 1 is singleton set typiclly written s 1 = { } nd it cn be regrded s the empty product. We define X + Y s the set X Y {, }, where is the disjoint union of κ 2 sets, with injections X κ 1 X Y Y. Note tht the set X + Y is different from the clssicl coproduct of X nd Y (which we shll denote by X +Y), becuse of the two extr elements nd. These extr elements will lter be used to represent, respectively, underspecifiction nd inconsistency in the specifiction of some systems. The intuition behind the need of these extr elements will become cler when we present our lnguge of expressions nd concrete exmples, in Section 3.3.1, of systems whose type involves +. Note tht X +X = 2 X = X +X. For ech of the opertions defined bove on sets, there re nlogous ones on functions. Let f: X Y, f 1 : X Y nd f 2 : Z W. We define the following opertions: f 1 f 2 : X Z Y W f 1 +f 2 : X +Z Y +W (f 1 f 2 )( x,z ) = f 1 (x),f 2 (z) (f 1 +f 2 )(c) = c, c {, } (f 1 +f 2 )(κ i (x)) = κ i (f i (x)), i {1,2} f A : X A Y A P ω (f): P ω (X) P ω (Y) f A (g) = f g P ω (f)(s) = {f(x) x S} Note tht here we re using the sme symbols tht we defined bove for the opertions on sets. It will lwys be cler from the context which opertion is being used. In our definition of non-deterministic functors we will use constnt sets equipped with n informtion order. In prticulr, we will use join-semilttices. A (bounded) join-semilttice is set B equipped with binry opertion B nd constnt B B, such tht B is commuttive, ssocitive nd idempotent. The element B is neutrl with respect to B. As usul, B gives rise to prtil ordering B on the elements of B: b 1 B b 2 b 1 B b 2 = b 2 Every set S cn be mpped into join-semilttice by tking B to be the set of ll finite subsets of S with union s join. Non-deterministic functors. Non-deterministic functors re functors G: Set Set, built inductively from the identity nd constnts, using, +, ( ) A nd P ω. Definition 2.1. The clss NDF of non-deterministic functors on Set is inductively defined by putting: NDF G:: = Id B G +G G G G A P ω G where B is finite (non-empty) join-semilttice nd A is finite set. Since we only consider finite exponents A = { 1,..., n }, the functor ( ) A is not relly needed, since it is subsumed by product with n components. However, to simplify the presenttion, we decided to include it.

4 4 A. SILVA, M. BONSANGUE, AND J. RUTTEN Next, weshowtheexplicitdefinitionofthefunctorsboveonsetx ndonmorphism f: X Y (note tht G(f): G(X) G(Y)). Id(X) = X B(X) = B (G 1 +G 2 )(X) = G 1 (X) +G 2 (X) Id(f) = f B(f) = id B (G 1 +G 2 )(f) = G 1 (f) +G 2 (f) (G A )(X) = G(X) A (P ω G)(X) = P ω (G(X)) (G 1 G 2 )(X) = G 1 (X) G 2 (X) (G A )(f) = G(f) A (P ω G)(f) = P ω (G(f)) (G 1 G 2 )(f) = G 1 (f) G 2 (f) Typicl exmples of non-deterministic functors include M = (B Id) A, D = 2 Id A, Q = (1 + Id) A nd N = 2 (P ω Id) A, where 2 = {0,1} is two-element join semilttice with 0 s bottom element (1 0 = 1) nd 1 = { } is one element join-semilttice. These functors represent, respectively, the type of Mely, deterministic, prtil deterministic nd non-deterministic utomt. In this pper, we will use the lst three s running exmples. In [9], we hve studied in detil regulr expressions for Mely utomt. Similrly to wht hppened there, we impose join-semilttice structure on the constnt functor. The product, exponentition nd powerset functors preserve the join-semilttice structure nd thus do not need to be chnged. This is not the cse for the clssicl coproduct nd thus we use + insted, which lso gurntees tht the join semilttice structure is preserved. Next, we give the definition of the ingredient reltion, which reltes non-deterministic functor G with its ingredients, i.e. the functors used in its inductive construction. We shll use this reltion lter for typing our expressions. Definition 2.2. Let NDF NDF be the lest reflexive nd trnsitive reltion on nondeterministic functors such tht G 1 G 1 G 2, G 2 G 1 G 2, G 1 G 1 +G 2, G 2 G 1 +G 2, G G A, G P ω G Here nd throughout this document we use F G s shorthnd for F,G. If F G, then F is sid to be n ingredient of G. For exmple, 2, Id, Id A nd D itself re ll the ingredients of the deterministic utomt functor D = 2 Id A. Non-deterministic colgebrs. A non-deterministic colgebr is pir(s, f: S G(S)), where S is set of sttes nd G is non-deterministic functor. The functor G, together with the function f, determines the trnsition structure (or dynmics) of the G-colgebr [31]. Mely, deterministic, prtil deterministic nd non-deterministic utomt re, respectively, colgebrs for the functors M = (B Id) A, D = 2 Id A, Q = (1 +Id) A nd N = 2 (P ω Id) A. A G-homomorphism from G-colgebr (S, f) to G-colgebr (T, g) is function h: S T preserving the trnsition structure, i.e. such tht g h = G(h) f. Definition 2.3. A G-colgebr (Ω,ω) is sid to be finl if for ny G-colgebr (S,f) there exists unique G-homomorphism beh S : S Ω. For every non-deterministic functor G there exists finl G-colgebr (Ω G,ω G ) [31]. For instnce, s we lredy mentioned in the introduction, the finl colgebr for the functor D is the set of lnguges 2 A over A, together with trnsition function d : 2 A 2 (2 A ) A defined s d(φ) = φ(ǫ), λλw.φ(w). Here ǫ denotes the empty sequence nd w denotes the word resulting from prefixing w with the letter. The notion of finlity will ply key role lter in providing semntics to expressions. Given G-colgebr (S,f) nd subset V of S with inclusion mp i: V S we sy tht V is subcolgebr of S if there exists g: V G(V) such tht i is homomorphism.

5 NON-DETERMINISTIC KLEENE COALGEBRAS 5 Given s S, s = (T,t), denotes the smllest subcolgebr generted by s, with T given by T = {V V is subcolgebr of S nd s V} If the functor F preserves rbitrry intersections, then the subcolgebr s exists. This will be the cse for every functor considered in this pper. Moreover, ll the functors we will consider preserve monos nd thus the trnsition structure t is unique [31, Proposition 6.1]. We will write Colg(G) for the ctegory of G-colgebrs together with colgebr homomorphisms. WelsowriteColg LF (G) forthectegory ofg-colgebrs thtreloclly finite. Objects re G-colgebrs (S,f) such tht for ech stte s S the generted subcolgebr s is finite. Mps re the usul homomorphisms of colgebrs. Let (S,f) nd (T,g) be two G-colgebrs. We cll reltion R S T bisimultion [18] iff s,t R f(s),g(t) G(R) where G(R) is defined s G(R) = { G(π 1 )(x),g(π 2 )(x) x G(R)}. We write s G t wheneverthereexists bisimultion reltion contining (s,t) ndwecll G thebisimilrity reltion. We shll drop the subscript G whenever the functor G is cler from the context. For ll non-deterministic G-colgebrs (S,f) nd (T,g) nd s S,t T, it holds tht s t beh S (s) = beh T (t) (the left to right impliction lwys holds, wheres the right to left impliction only holds for certin clsses of functors, which include the ones we consider in this pper [31, 35]). 3. A lnguge of expressions for non-deterministic colgebrs In this section, we generlize the clssicl notion of regulr expressions to non-deterministic colgebrs. We strt by introducing n untyped lnguge of expressions nd then we single out the well-typed ones vi n pproprite typing system, thereby ssociting expressions to non-deterministic functors. Definition 3.1 (Expressions). Let A be finite set, B finite join-semilttice nd X set of fixed point vribles. The set Exp of ll expressions is given by the following grmmr, where A, b B nd x X: ε :: = x ε ε µx.γ b l ε r ε l[ε] r[ε] (ε) {ε} where γ is gurded expression given by: γ :: = γ γ µx.γ b l ε r ε l[ε] r[ε] (ε) {ε} The only difference between the BNF of γ nd ε is the occurrence of x. In the expression µx.γ, µ is binder for ll the free occurrences of x in γ. Vribles tht re not bound re free. A closed expression is n expression without free occurrences of fixed point vribles x. We denote the set of closed expressions by Exp c. Intuitively, expressions denote elements of the finl colgebr. The expressions, ε 1 ε 2 nd µx.ε will ply similr role to, respectively, the empty lnguge, the union of lnguges nd the Kleene str in clssicl regulr expressions for deterministic utomt. The expressions l ε nd r ε refer to the left nd right hnd-side of products. Similrly, l[ε] nd r[ε] refer to the left nd right hnd-side of sums. The expressions (ε) nd {ε} denote function ppliction nd singleton set, respectively. We shll soon illustrte, by mens

6 6 A. SILVA, M. BONSANGUE, AND J. RUTTEN of exmples, the role of these expressions. Here, it is lredy visible tht our pproch (to define lnguge) for the powerset functor differs from clssicl modl logic where nd re used. This is choice, justified by the fct tht our gol is to hve process lgebr like lnguge insted of modl logic one. It lso explins why we only consider finite powerset: every finite set cn be written s the finite union of its singletons. Our lnguge does not hve ny opertor denoting intersection or complement (it only includes the sum opertor ). This is nturl restriction, very much in the spirit of Kleene s regulr expressions for deterministic finite utomt. We will prove tht this simple lnguge is expressive enough to denote exctly ll loclly finite colgebrs. Next, we present typing ssignment system for ssociting expressions to non-deterministic functors. This will llow us to ssocite with ech functor G the expressions ε Exp c tht re vlid specifictions of G-colgebrs. The typing proceeds following the structure of the expressions nd the ingredients of the functors. Definition 3.2 (Type system). We define typing reltion Exp NDF NDF tht will ssocite n expression ε with two non-deterministic functors F nd G, which re relted by the ingredient reltion (F is n ingredient of G). We shll write ε: F G for ε,f,g. The rules tht define re the following: : F G b: B G x: G G ε: G G µx.ε: G G ε 1 : F G ε 2 : F G ε: G G ε: F G ε: F G ε 1 ε 2 : F G ε: Id G {ε}: P ω F G (ε): F A G ε: F 1 G l ε : F 1 F 2 G ε: F 2 G r ε : F 1 F 2 G ε: F 1 G l[ε]: F 1 +F 2 G ε: F 2 G r[ε]: F 1 +F 2 G Intuitively, ε: F G (for closed expression ε) mens tht ε denotes n element of F(Ω G ), where Ω G is the finl colgebr of G. As expected, there is rule for ech expression construct. The extr rule involving Id G reflects the isomorphism between the finl colgebr Ω G nd G(Ω G ) (Lmbek s lemm, cf. [31]). Only fixed points t the outermost level of the functor re llowed. This does not men however tht we disllow nested fixed points. For instnce, µx. (x µy. (y)) would be well-typed expression for the functor D of deterministic utomt, s it will become cler below, when we will present more exmples of well-typed nd non-well-typed expressions. The presented type system is decidble (expressions re of finite length nd the system is inductive on the structure of ε Exp). Note tht the rules bove re ment to be red s n inductive definition rther thn s n lgorithm. In n eventul implementtion, extr cre is needed in the cse G = Id, to void looping in the rule for Id G. We cn formlly define the set of G-expressions: (closed nd gurded) well-typed expressions ssocited with non-deterministic functor G. Definition 3.3 (G-expressions). Let G be non-deterministic functor nd F n ingredient of G. We define Exp F G by: Exp F G = {ε Exp c ε: F G}. We define the set Exp G of well-typed G-expressions by Exp G G.

7 NON-DETERMINISTIC KLEENE COALGEBRAS 7 Let us instntite the definition of G-expressions to the functors of deterministic utomt D = 2 Id A. Exmple 3.4 (Deterministic expressions). Let A be finite set of input ctions nd let X be set of (recursion or) fixed point vribles. The set Exp D of deterministic expressions is given bytheset ofclosed ndgurded(ech vribleoccursinthescopeof( )) expressions generted by the following BNF grmmr. For A nd x X: Exp D ε :: = ε ε µx.ε x l ε 1 r ε 2 ε 1 :: = 0 1 ε 1 ε 1 ε 2 :: = (ε) ε 2 ε 2 Exmples of well-typed expressions for the functor D = 2 Id A (with 2 = {0,1} two-element join-semilttice with 0 s bottom element; recll tht the ingredients of D re 2, Id A nd D itself) include r ( ), l 1 r (l 0 ) nd µx.r (x) l 1. The expressions l[1], l 1 1 nd µx.1 re exmples of non well-typed expressions for D, becuse the functor D does not involve +, the subexpressions in the sum hve different type, nd recursion is not t the outermost level (1 hs type 2 D), respectively. It is esy to see tht the closed (nd gurded) expressions generted by the grmmr presented bove re exctly the elements of Exp D. The most interesting cse to check is the expression r (ε). Note tht (ε) hs type Id A D s long s ε hs type Id D. And the crucil remrk here is tht, by definition of, Exp Id G Exp G. Therefore, ε hs type Id D if it is of type D D, or more precisely, if ε Exp D, which explins why the grmmr bove is correct. At this point, we should remrk tht the syntx of our expressions differs from the clssicl regulr expressions in the use of µ nd ction prefixing (ε) insted of str nd full conctention. We shll prove lter tht these two syntcticlly different formlisms re eqully expressive (Theorems 3.12 nd 3.14), but, to increse the intuition behind our expressions, let us present the syntctic trnsltion from clssicl regulr expressions to Exp D (this trnsltion is inspired by [28]) nd bck. Definition 3.5. The set of regulr expressions is given by the following syntx RE r:: = 0 1 r+r r r r where A nd denotes sequentil composition. We define the following trnsltions between regulr expressions nd deterministic expressions: ( ) : RE Exp D ( ) : Exp D RE (0) = ( ) = 0 (1) = l 1 (l ) = (l 0 ) = (r ) = 0 () = r (l 1 ) (l 1 ) = 1 (r 1 +r 2 ) = (r 1 ) (r 2 ) (l ε 1 ε 2 ) = (l ε 1 ) +(l ε 2 ) (r 1 r 2 ) = (r 1 ) [(r 2 ) /l 1 ] (r (ε) ) = (ε) (r ) = µx.(r) [x/l 1 ] l 1 (r ε 1 ε 2 ) = (r ε 1 ) +(r ε 2 ) (ε 1 ε 2 ) = (ε 1 ) +(ε 2 ) (µx.ε) = sol(eqs(µx.ε)) The function eqs trnsltes µx.ε into system of equtions in the following wy. Let µx 1.ε 1,...,µx n.ε n bell the fixed point subexpressionsof µx.ε, with x 1 = x nd ε 1 = ε. We

8 8 A. SILVA, M. BONSANGUE, AND J. RUTTEN define n equtions x i = (ε i ), where ε i is obtined from ε i by replcing ech subexpression µx i.ε i byx i, forlli = 1,...n. Thesolution ofthesystem, sol(eqs(µx.ε)), isthencomputed in the usul wy (the solution of n eqution of shpe x = rx+t is r t). In [32], regulr expressions were given colgebric structure, using Brzozowski derivtives [13]. Lter in this pper, we will provide colgebr structure to Exp D, fter which the soundness of the bove trnsltions cn be stted nd proved: r r nd ε ε, where will coincide with lnguge equivlence. Thus, the regulr expression is trnslted to r (µx.r (x) l 1 ), wheres the expression µx.r (r (x) ) l 1 is trnsformed into (). We present next the syntx for the expressions in Exp Q nd in Exp N (recll tht Q = (1 +Id) A nd N = 2 (P ω Id) A ). Exmple 3.6 (Prtil expressions). Let A be finite set of input ctions nd X be set of (recursion or) fixed point vribles. The set Exp Q of prtil expressions is given by the set of closed nd gurded expressions generted by the following BNF grmmr. For A nd x X: Exp Q ε :: = ε ε µx.ε x (ε 1 ) ε 1 :: = ε 1 ε 1 l[ε 2 ] r[ε] ε 2 :: = ε 2 ε 2 Intuitively, the expressions (l[ ]) nd (r[ε]) specify, respectively, stte which hs no defined trnsition for input nd stte with n outgoing trnsition to nother one specified by ε. Exmple 3.7 (Non-deterministic expressions). Let A be finite set of input ctions nd X be set of (recursion or) fixed point vribles. The set Exp N of non-deterministic expressions is given by the set of closed nd gurded expressions generted by the following BNF grmmr. For A nd x X: Exp N ε :: = x r ε 2 l ε 1 ε ε µx.ε ε 1 :: = ε 1 ε ε 2 :: = ε 2 ε 2 (ε ) ε :: = ε ε {ε} Intuitively, the expression r ({ε 1 } {ε 2 }) specifies stte which hs two outgoing trnsitions lbelled with the input letter, one to stte specified by ε 1 nd nother to stte specified by ε 2. We hve defined lnguge of expressions which gives us n lgebric description of systems. We should lso remrk t this point tht in the exmples we strictly follow the type system to derive the syntx of the expressions. However, it is obvious tht mny simplifictions cn be mde in order to obtin more polished lnguge. In prticulr, fter the xiomtiztion we will be ble to decrese the number of levels in the bove grmmrs, since will we hve xioms of the shpe (ε) (ε ) (ε ε ). In Section 5, we will sketch two exmples where we pply some simplifiction to the syntx. The gol is now to present generliztion of Kleene s theorem for non-deterministic colgebrs (Theorems 3.12 nd 3.14). Recll tht, for regulr lnguges, the theorem sttes tht lnguge is regulr if nd only if it is recognized by finite utomton. In order to chieve our gol we will first show tht the set Exp G of G-expressions crries G-colgebr structure.

9 NON-DETERMINISTIC KLEENE COALGEBRAS Expressions re colgebrs. In this section, we show tht the set of G-expressions for given non-deterministic functor G hs colgebric structure δ G : Exp G G(Exp G ). More precisely, we re going to define function δ F G : Exp F G F(Exp G ) for every ingredient F of G, nd then set δ G = δ G G. Our definition of the function δ F G will mke use of the following. Definition 3.8. For every G NDF nd for every F with F G: (i) we define constnt Empty F G F(Exp G ) by induction on the syntctic structure of F: Empty Id G = Empty F1 +F 2 G = Empty B G = B Empty F A G = λ.empty F G Empty F1 F 2 G = Empty F1 G,Empty F2 G = Empty PωF G (ii) we define function Plus F G : F(Exp G ) F(Exp G ) F(Exp G ) by induction on the syntctic structure of F: Plus Id G (ε 1,ε 2 ) = ε 1 ε 2 Plus B G (b 1,b 2 ) = b 1 B b 2 Plus F1 F 2 G( ε 1,ε 2, ε 3,ε 4 ) = Plus F1 G(ε 1,ε 3 ),Plus F2 G(ε 2,ε 4 ) Plus F1 +F 2 G (κ i(ε 1 ),κ i (ε 2 )) = κ i (Plus Fi G(ε 1,ε 2 )), i {1,2} Plus F1 +F 2 G (κ i(ε 1 ),κ j (ε 2 )) = i,j {1,2} nd i j Plus F1 +F 2 G (x, ) = Plus F 1 +F 2 G (,x) = Plus F1 +F 2 G (x, ) = Plus F 1 +F 2 G (,x) = x Plus F A G(f,g) = λ. Plus F G (f(),g()) Plus PωF G(s 1,s 2 ) = s 1 s 2 Intuitively, one cn think of the constnt Empty F G nd the function Plus F G s liftings of nd to the level of F(Exp G ). We need two more things to define δ F G. First, we define n order on the types of expressions. For F 1, F 2 nd G non-deterministic functors such tht F 1 G nd F 2 G, we define (F 1 G) (F 2 G) F 1 F 2 The order is prtil order (structure inherited from ). Note lso tht (F 1 G) = (F 2 G) F 1 = F 2. Second, we define mesure N(ε) bsed on the mximum number of nested ungurded occurrences of µ-expressions in ε nd ungurded occurrences of. We sy tht subexpression µx.ε 1 of ε occurs ungurded if it is not in the scope of one of the opertors l, r, l[ ], r[ ], ( ) or { }. Definition 3.9. For every gurded expression ε, we define N(ε) s follows: N( ) = N(b) = N((ε)) = N(l ε ) = N(r ε ) = N(l[ε]) = N(r[ε]) = N({ε}) = 0 N(ε 1 ε 2 ) = 1+mx{N(ε 1 ), N(ε 2 )} N(µx.ε) = 1+N(ε) ThemesureN inducesprtil orderon theset of expressions: ε 1 ε 2 N(ε 1 ) N(ε 2 ), where is just the ordinry inequlity of nturl numbers. Now we hve ll we need to define δ F G : Exp F G F(Exp G ).

10 10 A. SILVA, M. BONSANGUE, AND J. RUTTEN Definition For every ingredient F of non-deterministic functor G nd n expression ε Exp F G, we define δ F G (ε) s follows: δ F G ( ) = Empty F G δ F G (ε 1 ε 2 ) = Plus F G (δ F G (ε 1 ),δ F G (ε 2 )) δ G G (µx.ε) = δ G G (ε[µx.ε/x]) δ Id G (ε) = ε for G Id δ B G (b) = b δ F1 F 2 G(l ε ) = δ F1 G(ε),Empty F2 G δ F1 F 2 G(r ε ) = Empty F1 G,δ F2 G(ε) δ F1 +F 2 G (l[ε]) = κ 1(δ F1 G(ε)) δ F1 +F 2 G (r[ε]) = κ 2(δ { F2 G(ε)) δ F A G((ε)) = λ δf G (ε) if =. Empty F G otherwise δ PωF G({ε}) = {δ F G (ε)} Here, ε[µx.ε/x] denotes syntctic substitution, replcing every free occurrence of x in ε by µx.ε. In order to see tht the definition of δ F G is well-formed, we hve to observe tht δ F G cn be seen s function hving two rguments: the type F G nd the expression ε. Then, we use induction on the Crtesin product of types nd expressions with orders nd, respectively. More precisely, given two pirs F 1 G,ε 1 nd F 2 G,ε 2 we hve n order F 1 G,ε 1 F 2 G,ε 2 (i) (F 1 G) (F 2 G) or (ii) (F 1 G) = (F 2 G) nd ε 1 ε 2 (3.1) Observe tht in the definition bove it is lwys true tht F G,ε F G,ε, for ll occurrences of δ F G(ε ) occurring in the right hnd side of the eqution defining δ F G (ε). In ll cses, but the ones tht ε is fixed point or sum expression, the inequlity comes from point (i) bove. For the cse of the sum, note tht F G,ε 1 F G,ε 1 ε 2 nd F G,ε 2 F G,ε 1 ε 2 by point (ii), since N(ε 1 )<N(ε 1 ε 2 ) nd N(ε 2 )<N(ε 1 ε 2 ). Similrly, in the cse of µx.ε we hve tht N(ε) = N(ε[µx.ε/x]), which cn esily be proved by (stndrd) induction on the syntctic structure of ε, since ε is gurded (in x), nd this gurntees tht N(ε[µx.ε/x])<N(µx.ε). Hence, G G,ε G G,µx.ε. Also note tht cluse 4 of the bove definition overlps with cluses 1 nd 2 (by tking F = Id). However, they give the sme result nd thus the function δ F G is well-defined. Definition We define, for ech non-deterministic functor G, G-colgebr by putting δ G = δ G G. δ G : Exp G G(Exp G ) The function δ G cn be thought of s the generliztion of the well-known notion of Brzozowski derivtive [13] for regulr expressions nd, moreover, it provides n opertionl semntics for expressions, s we shll see in Section 3.2. The observtion tht the set of expressions hs colgebr structure will be crucil for the proof of the generlized Kleene theorem, s will be shown in the next two sections.

11 NON-DETERMINISTIC KLEENE COALGEBRAS Expressions re expressive. Hving G-colgebr structure on Exp G hs two dvntges. First, it provides us, by finlity, directly with nturl semntics becuse of the existence of (unique) homomorphism beh: Exp G Ω G, tht ssigns to every expression ε n element beh(ε) of the finl colgebr Ω G. The second dvntge of the colgebr structure on Exp G is tht it lets us use the notion of G-bisimultion to relte G-colgebrs (S,g) nd expressions ε Exp G. If one cn construct bisimultion reltion between n expression ε nd stte s of given colgebr, then the behviour represented by ε is equl to the behviour of the stte s. This is the nlogue of computing the lnguge L(r) represented by given regulr expression r nd the lnguge L(s) ccepted by stte s of finite stte utomton nd checking whether L(r) = L(s). The following theorem sttes tht every stte in loclly finite G-colgebr cn be represented by n expression in our lnguge. This generlizes hlf of Kleene s theorem for deterministic utomt: if lnguge is ccepted by finite utomton then it is regulr (i.e. it cn be denoted by regulr expression). The generliztion of the other hlf of the theorem (if lnguge is regulr then it is ccepted by finite utomton) will be presented in Section 3.3. It is worth to remrk tht in the usul definition of deterministic utomton the initil stte of the utomton is included nd, thus, in the originl Kleene s theorem, it ws enough to consider finite utomt. In the colgebric pproch, the initil stte is not explicitly modelled nd thus we need to consider loclly-finite colgebrs: colgebrs where ech stte will generte finite subcolgebr. Theorem Let G be non-deterministic functor nd let (S, g) be loclly-finite G- colgebr. Then, for ny s S, there exists n expression s Exp G such tht s s. Proof. Let s S nd let s = {s 1,...,s n } with s 1 = s. We construct, for every stte s i s, n expression s i such tht s i s i. If G = Id, we set, for every i, s i =. It is esy to see tht { s i, s i s } is bisimultion nd, thus, we hve tht s s. For G Id, we proceed in the following wy. Let, for every i, A i = µx i.γ G g(s i ) where, for F G nd c F s, the expression γc F Exp F G is defined by induction on the structure of F: γ Id s i = x i γ B b = b γf 1 F 2 c,c = l γ F 1 c r γ F 2 c γ FA f = A(γ F f() ) γ F 1 +F 2 κ 1 (c) = l[γ F 1 c ] γ F 1 +F 2 κ 2 (c) = r[γ F 2 c ] γ F 1 +F 2 = γ F 1 +F 2 = l[ ] r[ ] {γ γ PωF c F} C C = c C otherwise Note tht here the choice of l[ ] r[ ] to represent inconsistency is rbitrry but cnonicl, in the sense tht ny other expression involving sum of l[ε 1 ] nd r[ε 2 ] will be bisimilr. Formlly, the definition of γ bove is prmetrized by function from {s 1,...,s n } to fixed set of vribles {x 1,...,x n }. Itshouldlso benoted tht i Iε i stndsforε 1 (ε 2 (ε 3...)) (this is choice, since lter we will xiomtize to be commuttive nd ssocitive). Let A 0 i = A i, define A k+1 i = A k i {Ak k+1 /x k+1} nd then set s i = A n i. Here, A{A /x} denotes syntctic replcement (tht is, substitution without renming of bound vribles in A which re lso free vribles in A ). The definition of s i does not depend in the

12 12 A. SILVA, M. BONSANGUE, AND J. RUTTEN chosen order of {s 1,...,s n }: the expressions obtined re just different modulo renming of vribles. Observe tht the term A n i = (µx i.γ G g(s i ) ){A0 1 /x 1}...{A n 1 n /x n } is closed term becuse, for every j = 1,...,n, the term A j 1 j contins t most n j free vribles in the set {x j+1,...,x n }. It remins to prove tht s i s i. We show tht R = { s i, s i s i s } is bisimultion. For tht, we define, for F G nd c F s, ξc F = γc F {A 0 1 /x 1}...{An n 1 /x n } nd the reltion R F G = { c,δ F G (ξc F ) c F s }. Then, we prove tht 1 R F G = F(R) nd 2 g(s i ),δ G ( s i ) R G G. 1 By induction on the structure of F. F = Id Note tht R Id G = { s i,ξs Id i s i s } which is equl to Id(R) = R provided tht ξs Id i = s i. The ltter is indeed the cse: ξ Id s i = γ Id s i {A 0 1 /x 1}...{A n 1 n /x n } = x i {A 0 1 /x 1}...{A n 1 n /x n } (def. ξ Id s i ) (def. γ Id s i ) = Ai i 1 {A i i+1 /x i+1}...{an n 1 /x n } ({A i 1 i /x i }) = A 0 i {A0 1 /x 1}...{An n 1 /x n } (def. A i 1 i ) = s i (def. s i ) F = B Note tht, for b B, ξ B b = γb b {A0 1 /x 1}...{A n 1 n /x n } = b. Thus, we hve tht R B G = { s i,ξ B s i s i B s } = { b,b b B} = B(R). F = F 1 F 2 u,v, e,f F 1 F 2 (R) u,e F 1 (R) nd v,f F 2 (R) (def. F 1 F 2 ) u,e R F1 G nd v,f R F2 G u,e = c,δ F1 G(ξ F 1 c ) nd v,f = c,δ F2 G(ξ F 2 c ) (ind. hyp.) (def. R Fi G) u,v = c,c nd e,f = δ F1 F 2 G(l(ξ F 1 c ) r(ξ F 2 c )) (def. δ F G ) u,v = c,c nd e,f = δ F1 F 2 G(ξ F 1 F 2 c,c ) (def. ξ F ) u,v, e,f R F1 F 2 G F = F 1 +F 2, F = F A 1 nd F = P ω F 1 : similr to F 1 F 2. 2 We wnt to prove tht g(s i ),δ G ( s i ) R G G. For tht, we must show tht g(s i ) G s nd δ G ( s i ) = δ G (ξ G g(s i )). The former follows by definition of s, wheres for the ltter we observe tht: δ G ( s i ) = δ G ((µx i.γ G g(s i) ){A0 1 /x 1}...{A n 1 n /x n }) (def. of s i ) = δ G (µx i.γ G g(s i) {A0 1 /x 1}...{A i 2 i 1 /x i 1}{A i i+1 /x i+1}...{a n 1 n /x n })

13 NON-DETERMINISTIC KLEENE COALGEBRAS 13 = δ G (γ G g(s i) {A0 1/x 1 }...{A i 2 i 1 /x i 1}{A i i+1 /x i+1}...{a n 1 n /x n }[A n i /x i]) (def. of δ G ) = δ G (γ G g(s i) {A0 1 /x 1}...{A i 2 i 1 /x i 1}{A i i+1 /x i+1}...{an n 1 /x n }{A n i /x i}) ([A n i /x i] = {A n i /x i}) = δ G (γ G g(s i) {A0 1/x 1 }...{A i 2 i 1 /x i 1}{A n i /x i}{a i i+1 /x i+1}...{a n 1 n /x n }) = δ G (ξ G g(s i) ) Here, note tht [A n i /x i] = {A n i /x i}, becuse A n i hs no free vribles. The lst two steps follow, respectively, becuse x i is not free in A i i+1,...,an 1 n nd: {A n i /x i}{a i i+1 /x i+1}...{an n 1 /x n } = {A i 1 i {A i i+1 /x i+1}...{an n 1 /x n }/x i }{A i i+1 /x i+1}...{an n 1 /x n } = {A i 1 i /x i }{A i i+1/x i+1 }...{A n 1 n /x n } (3.2) Eqution (3.2) uses the syntctic identity A{B{C/y}/x}{C/y} = A{B/x}{C/y}, y not free in C (3.3) Let us illustrte the construction ppering in the proof of Theorem 3.12 by some exmples. These exmples will illustrte the similrity with the proof of Kleene s Theorem presented in most textbooks, where regulr expression denoting the lnguge recognized by stte of deterministic utomton is built using system of equtions. Consider the following deterministic utomton over A = {, b}, whose trnsition function g is given by the following picture ( s represents tht the stte s is finl): b s 1 s 2,b We define A 1 = µx 1.γ D g(s 1 ) nd A 2 = µx 2.γ D g(s 2 ) where γ D g(s 1 ) = l 0 r b(x 1) (x 2 ) γ D g(s 2 ) = l 1 r (x 2) b(x 2 ) We hve A 2 1 = A 1{A 1 2 /x 2} nd A 2 2 = A 2{A 0 1 /x 1}. Thus, s 2 = A 2 nd, since A 1 2 = A 2, s 1 is the expression µx 1.l 0 r b(x 1 ) (µx 2.l 1 r (x 2 ) b(x 2 ) ) By construction we hve s 1 s 1 nd s 2 s 2. For nother exmple, tke the following prtil utomton, lso over two letter lphbet A = {,b}: q 1 In the grphicl representtion of prtil utomton (S, p) we omit trnsitions for which p(s)() = κ 1 ( ). In this cse, this hppens in q 1 for the input letter b nd in q 2 for. We will hve the equtions q 2 A 1 = A 0 1 = A1 1 = µx 1.b(l[ ]) (r[x 2 ]) A 2 = A 0 2 = A1 2 = µx 2.(l[ ]) b(r[x 2 ]) b

14 14 A. SILVA, M. BONSANGUE, AND J. RUTTEN Thus: s 1 = A 2 1 = µx 1.b(l[ ]) (r[µx 2.(l[ ]) b(r[x 2 ])]) s 2 = µx 2.(l[ ]) b(r[x 2 ]) Agin we hve s 1 s 1 nd s 2 s 2. As lst exmple, let us consider the following non-deterministic utomton, over one letter lphbet A = {}: We strt with the equtions: s 1 Then we hve the following itertions: A 1 1 = A 1 s 3 A 1 = µx 1.l 0 r ({x 1 } {x 2 } {x 3 }) A 2 = µx 2.l 0 r ({x 2 } {x 3 }) A 3 = µx 3.l 1 r ({x 1 } {x 3 }) A 2 1 = A 1{A 1 2 /x 2} = µx 1.l 0 r ({x 1 } {A 2 } {x 3 }) A 3 1 = A 1{A 1 2 /x 2}{A 2 3 /x 3} = µx 1.l 0 r ({x 1 } {(A 2 {A 2 3 /x 3})} {A 2 3 }) s 2 A 1 2 = A 2{A 1 /x 1 } = A 2 A 2 2 = A 2{A 1 /x 1 } = A 2 A 3 2 = A 2{A 1 /x 1 }{A 2 3 /x 3} = µx 2.l 0 r ({x 2 } {A 2 3 }) A 1 3 = A 3{A 1 /x 1 } = µx 3.l 1 r ({A 1 } {x 3 }) A 2 3 = A 3{A 1 /x 1 }{A 1 2 /x 2} = µx 3.l 1 r ({(A 1 {A 1 2 /x 2})} {x 3 }) A 3 3 = A2 3 This yields the following expressions: s 1 = µx 1.l 0 r ({x 1 } { s 2 } { s 3 }) s 2 = µx 2.l 0 r ({x 2 } { s 3 }) s 3 = µx 3.l 1 r ({µx 1.l 0 r ({x 1 } {µx 2.l 0 r ({x 2 } {x 3 }) } {x 3 }) } {x 3 }) 3.3. Finite systems for expressions. Next, we prove the converse of Theorem 3.12, tht is, we show how to construct finite G-colgebr (S,g) from n rbitrry expression ε Exp G, such tht there exists stte s S with ε G s. The immedite wy of obtining colgebr from n expression ε Exp G is to compute the subcolgebr ε, since we hve provided the set Exp G with colgebr structure δ G : Exp G G(Exp G ). However, the subcolgebr generted by n expression ε Exp G by repetedly pplying δ G is, in generl, infinite. Tke for instnce the deterministic expression ε 1 = µx.r (x µy.r (y) ) (for simplicity, we consider A = {} nd below we will write,

15 NON-DETERMINISTIC KLEENE COALGEBRAS 15 in the second component of δ D, n expression ε insted of the function mpping to ε) nd observe tht: δ D (ε 1 ) = 0,ε 1 µy.r (y) δ D (ε 1 µy.r (y) ) = 0,ε 1 µy.r (y) µy.r (y) δ D (ε 1 µy.r (y) µy.r (y) ) = 0,ε 1 µy.r (y) µy.r (y) µy.r (y). As one would expect, ll the new sttes re equivlent nd will be identified by beh (the morphism into the finl colgebr). However, the function δ D does not mke ny stte identifiction nd thus yields n infinite colgebr. This phenomenon occurs lso in clssicl regulr expressions. It ws shown in [13] tht normlizing the expressions using the xioms for ssocitivity, commuttivity nd idempotency ws enough to gurntee finiteness 1. We will show in this section tht this lso holds in our setting. Consider the following xioms (only the first three re essentil, but we include the fourth to obtin smller colgebrs): (Associtivity) ε 1 (ε 2 ε 3 ) (ε 1 ε 2 ) ε 3 (Commuttivity) ε 1 ε 2 ε 2 ε 1 (Idempotency) ε ε ε (Empty) ε ε We define the reltion ACIE Exp F G Exp F G, written infix, s the lest equivlence reltioncontiningthefouridentitiesbove. Thereltion ACIE givesrisetothe(surjective) equivlence mp[ε] ACIE = {ε ε ACIE ε }. Thefollowing digrm showsthempsdefined so fr: Exp F G [ ] ACIE Exp F G / ACIE δ F G F(Exp G ) F([ ] ACIE ) F(Exp G / ACIE ) In order to complete the digrm, we next prove tht ACIE is contined in the kernel of F([ ] ACIE ) δ F G 2. This will gurntee the existence of function δ F G : Exp F G / ACIE F(Exp G / ACIE ) which, when F = G, provides Exp G / with colgebric structure δ G : Exp G / ACIE G(Exp G / ACIE ) (s before we write δ G for δ G G ) nd which mkes [ ] ACIE homomorphism of colgebrs. 1 Actully, to gurntee finiteness, similr to clssicl regulr expressions, it is enough to eliminte double occurrences of expressions ε t the outermost level of n expression ε ε (nd to do this one needs the ACI xioms). Note tht this is weker thn tking expressions modulo the ACI xioms: for instnce, the expressions ε 1 ε 2 nd ε 2 ε 1, for ε 1 ε 2, would not be identified in the process bove. 2 This is equivlenttoprove tht ExpF G / ACIE, together with [ ] ACIE, is the coequlizer of the projection morphisms from ACIE to Exp F G.

16 16 A. SILVA, M. BONSANGUE, AND J. RUTTEN Lemm Let G nd F be non-deterministic functors, with F G. For ll ε 1,ε 2 Exp F G, ε 1 ACIE ε 2 (F([ ] ACIE ))(δ F G (ε 1 )) = (F([ ] ACIE ))(δ F G (ε 2 )) Proof. In order to improve redbility, in this proof we will use [ ] to denote [ ] ACIE. It is enough to prove tht for ll x 1,x 2,x 3 F(Exp G ): 1 F([ ])(Plus F G (Plus F G (x 1,x 2 ),x 3 )) = F([ ])(Plus F G (x 1,Plus F G (x 2,x 3 ))) 2 F([ ])(Plus F G (x 1,x 2 )) = F([ ])(Plus F G (x 2,x 1 )) 3 F([ ])(Plus F G (x 1,x 1 )) = F([ ])(x 1 ) 4 F([ ])(Plus F G (Empty F G,x 1 )) = F([ ])(x 1 ) By induction on the structure of F. We illustrte few cses, the omitted ones re proved in similr wy. F = Id x 1,x 2,x 3 Exp G 1 [Plus Id G (Plus Id G (x 1,x 2 ),x 3 )] = [(x 1 x 2 ) x 3 ] (def. Plus) = [x 1 (x 2 x 3 )] (Associtivity) = [Plus Id G (x 1,Plus Id G (x 2,x 3 ))] (def. Plus) 4 [Plus Id G (Empty Id G,x 1 )] = [ x 1 ] (def. Plus nd Empty) = [x 1 ] (Empty) F = F 1 F 2 x 1 = u 1,v 1,x 2 = u 2,v 2 (F 1 F 2 )(Exp G ) 2 (F 1 F 2 )([ ])(Plus F1 F 2 G( u 1,v 1, u 2,v 2 )) = F 1 ([ ])(Plus F1 G(u 1,u 2 )),F 2 ([ ])(Plus F2 G(v 1,v 2 )) (def. Plus) = F 1 ([ ])(Plus F1 G(u 2,u 1 )),F 2 ([ ])(Plus F2 G(v 2,v 1 )) (ind. hyp.) = (F 1 F 2 )([ ])(Plus F1 F 2 G( u 2,v 2, u 1,v 1 )) (def. Plus) 3 (F 1 F 2 )([ ])(Plus F1 F 2 G( u 1,v 1, u 1,v 1 )) = F 1 ([ ])(Plus F1 G(u 1,u 1 )),F 2 ([ ])(Plus F2 G(v 1,v 1 )) (def. Plus) = F 1 ([ ])(u 1 ),F 2 ([ ])(v 1 ) (ind. hyp.) = (F 1 F 2 )([ ])( u 1,v 1 ) F = P ω F 1 x 1,x 2,x 3 P ω F 1 (Exp G ) 1 P ω F 1 ([ ])(Plus PωF 1 G(x 1,Plus PωF 1 G(x 2,x 3 ))) = P ω F 1 ([ ])(x 1 (x 2 x 3 )) (def. Plus) = P ω F 1 ([ ])((x 1 x 2 ) x 3 ) = P ω F 1 ([ ])(Plus PωF 1 G(Plus PωF 1 G(x 1,x 2 ),x 3 )) (def. Plus) In thelst butonestep, we usethefct tht, for ny setx, (P ω (X),, ) is join-semilttice (hence, x 1 (x 2 x 3 ) = (x 1 x 2 ) x 3 ). Due to this fct, in the cse F = P ω F 1, in this prticulr proof, the induction hypothesis will not be used.

17 NON-DETERMINISTIC KLEENE COALGEBRAS 17 Thus, we hve well-defined function δ F G : Exp F G / ACIE F(Exp G / ACIE ) such tht δ F G ([ε] ACIE ) = (F[ ] ACIE )(δ F G (ε)). We re redy to stte nd prove the second hlf of Kleene s theorem. Theorem Let G be non-deterministic functor. For every ε Exp G, there exists G (ε) = (S,g) such tht S is finite nd there exists s S with ε s. Proof. For every ε Exp G, we set G (ε) = [ε] ACIE (recll tht s denotes the smllest subcolgebr generted by s). First note tht, by Lemm 3.13, the mp [ ] ACIE is homomorphism nd thus ε [ε] ACIE. We prove, for every ε Exp G, tht the subcolgebr [ε] ACIE = (V,δ G ) hs finite stte spce V (here, δ G ctully stnds for the restriction of δ G to V). Agin, in order to improve redbility, below we will use [ ] to denote [ ] ACIE. More precisely, we prove, for ll ε Exp F G, the following inclusion V V = {[ε 1... ε k ] ε 1,...,ε k cl(ε) ll distinct,ε 1,...,ε k Exp G } (3.4) Here, if k = 0 we tke the sum bove to be nd cl(ε) denotes the smllest set contining ll subformuls of ε nd the unfoldings of µ (sub)formuls, tht is, the smllest subset stisfying: cl( ) = { } cl(l[ε 1 ]) = {l[ε 1 ]} cl(ε 1 ) cl(ε 1 ε 2 ) = {ε 1 ε 2 } cl(ε 1 ) cl(ε 2 ) cl(r[ε 1 ]) = {r[ε 1 ]} cl(ε 1 ) cl(µx.ε 1 ) = {µx.ε 1 } cl(ε 1 [µx.ε 1 /x]) cl((ε 1 )) = {(ε 1 )} cl(ε 1 ) cl(l ε 1 ) = {l ε 1 } cl(ε 1 ) cl({ε 1 }) = {{ε 1 }} cl(ε 1 ) cl(r ε 1 ) = {r ε 1 } cl(ε 1 ) Note tht the set cl(ε) is finite (the number of different unfoldings is finite) nd hs the property ε cl(ε). We prove the inclusion in eqution (3.4) in the following wy. First, we observe tht [ε] V, becuse ε cl(ε). Then, we prove tht (V,δ G ) (gin, δ G ctully stnds for the restriction of δ G to V) is subcolgebr of (Exp G,δ G ). Thus, V V, since V, the stte spce of [ε] is equl to the intersection of ll subcolgebrs of (Exp G,δ G ) contining [ε]. To prove tht (V,δ G ) is subcolgebr we prove tht, for ε 1,...,ε k Exp F G, ε 1,...,ε k cl(ε) ll distinct δ F G ([ε 1... ε k ]) F(V) (3.5) The intended result then follows by tking F = G. We first prove two uxiliry results, by induction on the structure of F: 1 (F[ ])(Empty F G ) F(V) 2 (F[ ])(Plus F G (u,v)) F(V) (F[ ])(u) F(V) nd (F[ ])(v) F(V) for u,v F(Exp G ). F = Id 1 (F[ ])(Empty F G ) = [ ] V 2 (F[ ])(Plus F G (u,v)) = [u v] V [u] V nd [v] V u,v Exp G The right to left impliction follows becuse, using the (Associtivity), (Commuttivity) nd (Idempotency) xioms, we cn rewrite u v s ε 1... ε k, with ll ε 1,...,ε k cl(ε) distinct.

18 18 A. SILVA, M. BONSANGUE, AND J. RUTTEN F = B 1 (B[ ])(Empty B G ) = B B(V) 2 (B[ ])(Plus B G (u,v)) = u v B(V) u B(V) nd v B(V) u,v B(Exp G ) = B F = F 1 F 2 1 (F 1 F 2 [ ])(Empty F1 F 2 G) = (F 1 [ ])(Empty F1 G),(F 2 [ ])(Empty F2 G) F 1 F 2 (V) 2 (F 1 F 2 [ ])(Plus F1 F 2 G( u 1,u 2, v 1,v 2 )) = (F 1 [ ])(Plus F1 G(u 1,v 1 )),(F 2 [ ])(Plus F2 G(u 2,v 2 )) F 1 F 2 (V) (IH) u 1,v 1 F 1 (V) nd u 2,v 2 F 2 (V) u,v F 1 F 2 (V), u = u 1,u 2,v = v 1,v 2 F 1 F 2 (Exp G ) F = F 1 +F 2 nd F = F A 1 : similr to F 1 F 2. F = P ω F 1 1 (PωF[ ])(EmptyPωF G) = PωF(V) 2 (P ω F[ ])(Plus PωF G(u,v)) = ((P ω F[ ])(u) (P ω F[ ])(v)) P ω F(V) (P ω F[ ](u)) P ω F(V) nd (P ω F[ ](v)) P ω F(V) Using 2, we cn simplify our proof gol (eqution (3.5)) s follows: δ F G ([ε 1... ε k ]) F(V) (F[ ])(δ F G (ε i )) F(V), ε i cl(ε), i = 1,...,k Next, using induction on the product of types of expressions nd expressions(using the order in eqution (3.1)), 1 nd 2, we prove tht (F[ ])(δ F G (ε i )) F(V), for ny ε i cl(ε). (F[ ])(δ F G ( )) = (F[ ])(Empty F G ) F(V) (by 1 ) (F[ ])(δ F G (ε 1 ε 2 )) = (F[ ])(Plus F G (δ F G (ε 1 ),δ F G (ε 2 )) F(V) (IH nd 2 ) (G[ ])(δ G G (µx.ε)) = (G[ ])(δ G G (ε[µx.ε/x])) G(V) (Id[ ])(δ Id G (ε i )) = [ε i ] Id(V) for G Id (IH) (ε i cl(ε)) (B[ ])δ B G (b) = b B(V) (B(V) = B) (F 1 F 2 [ ])(δ F1 F 2 G(l ε )) = (F 1 [ ])(δ F1 G(ε)),(F 2 [ ])(Empty F2 G) F 1 F 2 (V) (IH nd 1 ) (F 1 F 2 [ ])(δ F1 F 2 G(r ε )) = (F 1 [ ])(Empty F1 G),(F 2 [ ])(δ F2 G(ε)) F 1 F 2 (V) (IH nd 1 ) (F 1 +F 2 [ ])(δ F1 +F 2 G (l[ε])) = κ 1((F 1 [ ])(δ F1 G(ε))) F 1 +F 2 (V) (IH) (F 1 +F 2 [ ])(δ F1 +F 2 G (r[ε])) = κ 2((F 2 [ ])(δ F2 G(ε))) F 1 +F 2 (V) (IH) ( { (F A [ ])(δ F A G((ε))) = λ (F[ ])(δf G (ε)) if =. ) F Empty F G otherwise A (V) (IH nd 1 ) (P ω F[ ])(δ PωF G({ε})) = {(F[ ])(δ F G (ε))} P ω F(V) (IH)

19 NON-DETERMINISTIC KLEENE COALGEBRAS Exmples. n this subsection we will illustrte the construction described in the proof of Theorem 3.14: given n expression ε Exp G we construct G-colgebr (S,g) such tht there is s S with s ε. For simplicity, we will consider deterministic nd prtil utomt expressions over A = {, b}. Let us strt by showing the synthesised utomt for the most simple deterministic expressions, l 0 nd l 1.,b,b,b l 0,b l 1,b The first two utomt recognize the empty lnguge nd the lst the lnguge {ǫ} contining only the empty word. We note tht the generted utomt re not miniml (for instnce, the utomt for l 0 nd re bisimilr). Our gol hs been to generte finite utomton from n expression. From this the miniml utomton cn lwys be obtined by identifying bisimilr sttes. The following utomton, generted from the expression r (l 1 ), recognizes the lnguge {}, r (l 1 ) l 1 b,b For n exmple of n expression contining fixed points, consider ε = µx. r (l 0 l 1 x). One cn esily compute the synthesised utomton: µx.r (l 0 l 1 x) b,b l 0 l 1 ε nd observe tht it recognizes the lnguge. Here, the role of the join-semilttice structure is lso visible: l 0 l 1 ε specifies tht this stte is supposed to be non-finl (l 0 ) nd finl (l 1 ). The conflict of these two specifictions is solved, when they re combined with, using the semilttice: becuse 1 0 = 1 the stte is set to be finl. As lst exmple of deterministic expressions consider ε 1 = µx.r (x µy.r (y) ). Applying δ D to ε 1 one gets the following (prtil) utomton: b,b µx.r (x µy.r (y) ) ε 1 µy.r (y) b Clculting δ D (ε 1 µy.r (y) ) yields δ D (ε 1 µy.r (y) ) = 0,t where t() = ε 1 µy.r (y) µy.r (y) t(b) =

20 20 A. SILVA, M. BONSANGUE, AND J. RUTTEN Note tht the expression ε 1 µy.r (y) µy.r (y) is in the sme equivlence clss s ε 1 µy.r (y), which is stte tht lredy exists. As we sw in the beginning of Section 3.1, by only pplying δ D, without ACI, one would lwys generte syntcticlly different sttes which insted of the utomton computed now: µx.r (x µy.r (y) ) ε 1 µy.r (y) b would yield the following infinite utomton (with ε 2 = µy.r (y) ): µx.r (x µy.r (y) ) b ε 1 ε 2 ε 1 ε 2 ε 2,b... b b b Let us next see few exmples of synthesis for prtil utomt expressions, where we will illustrte the role of nd. In the grphicl representtion of prtil utomton (S,p), we will omit trnsitions for inputs with g(s)() = κ 1 ( ) nd we will drw s g(s)() whenever g(s)() {, }. Note however tht S nd S nd thus will hve no defined trnsitions. As before, let us first present the corresponding utomt for simple expressions, (l[ ]), ( ) nd (l[ ]) b(l[ ]).,b b,b (l[ ]) b ( ),b (l[ ]) b(l[ ]) Note how is used to encode underspecifiction, working s kind of dedlock stte. In the first three expressions the behviour for one or both of the inputs is missing, wheres in the lst expression the specifiction is complete. The element is used to del with inconsistent specifictions. For instnce, consider the expression (l[ ]) b(l[ ]) (r[(l[ ]) b(l[ ])]). All inputs re specified, but note tht t the outermost level input ppers in two different sub-expressions (l[ ]) nd (r[(l[ ]) b(l[ ])]) specifying t the sme time tht input leds to successful termintion nd tht it leds to stte where (l[ ]) b(l[ ]) holds, which is contrdictory, giving rise to the following utomton. (l[ ]) b(l[ ]) (r[(l[ ]) b(l[ ])]) 4. A sound nd complete xiomtiztion In the previous section, we hve shown how to derive from the type of system, given by functor G, lnguge Exp G tht llows for specifiction of G-behviours. Anlogously to Kleene s theorem, we hve proved the correspondence between the behviours denoted by Exp G nd loclly finite G-colgebrs. In this section, we will show how to provide Exp G with sound nd complete xiomtiztion. Agin, the functor G will serve s min guide

21 NON-DETERMINISTIC KLEENE COALGEBRAS 21 for the definition. The defined xiomtiztion is closely relted to Kleene lgebr (the set of expressions hs join semilttice structure) nd to the xiomtiztion provided by Milner for CCS (uniqueness of fixed points will be required). When instntiting the definition below to concrete functors one will recover known xiomtiztions, such s the one for CCS mentioned bove or the one for lbelled trnsition systems (with explicit termintion) presented in [1]. The ltter will be discussed in detil in Section 5. Next, we introduce n equtionl system for expressions of type F G. We define the reltion Exp F G Exp F G, written infix, s the lest equivlence reltion contining the following identities: (1) (Exp F G,, ) is join-semilttice. ε ε ε ε 1 ε 2 ε 2 ε 1 ε 1 (ε 2 ε 3 ) (ε 1 ε 2 ) ε 3 ε ε (2) µ is the unique fixed point. γ[µx.γ/x] µx.γ γ[ε/x] ε µx.γ ε (Idempotency) (Commuttivity) (Associtivity) (Empty) (FP) (Unique) (3) The join-semilttice structure propgtes through the expressions. B (B ) b 1 b 2 b 1 B b 2 (B ) l ( L) l ε 1 ε 2 l ε 1 l ε 2 ( L) r ( R) r ε 1 ε 2 r ε 1 r ε 2 ( R) ( ) ( A ) (ε 1 ε 2 ) (ε 1 ) (ε 2 ) ( A ) l[ε 1 ε 2 ] l[ε 1 ] l[ε 2 ] (+ L) r[ε 1 ε 2 ] r[ε 1 ] r[ε 2 ] (+ R) l[ε 1 ] r[ε 2 ] l[ ] r[ ] (+ ) (4) is congruence. (5) α-equivlence ε 1 ε 2 ε[ε 1 /x] ε[ε 2 /x] for x free in ε µx.γ µy.γ[y/x] for y not free in γ (Cong) (α equiv) It is importnt to remrk tht in the third group of rules there does not exist ny rule pplicble to expressions of type P ω F. Exmple 4.1. Consider the non-deterministic utomt over the lphbet A = {}: s 1 Applying (s defined in the proof of Theorem 3.12) one cn esily compute the expressions corresponding to s 1 nd s 2 : ε 1 = s 1 = µx 1.l 0 r ({x 1 }) ε 2 = s 2 = µy 1.l 0 r ({µy 2.l 0 r ({µy 1.l 0 r ({y 2 }) }) }) s 2 s 3

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

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

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

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

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

Lecture 1. Functional series. Pointwise and uniform convergence.

Lecture 1. Functional series. Pointwise and uniform convergence. 1 Introduction. Lecture 1. Functionl series. Pointwise nd uniform convergence. In this course we study mongst other things Fourier series. The Fourier series for periodic function f(x) with period 2π is

More information

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS. THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS RADON ROSBOROUGH https://intuitiveexplntionscom/picrd-lindelof-theorem/ This document is proof of the existence-uniqueness theorem

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

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

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004 Advnced Clculus: MATH 410 Notes on Integrls nd Integrbility Professor Dvid Levermore 17 October 2004 1. Definite Integrls In this section we revisit the definite integrl tht you were introduced to when

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

20 MATHEMATICS POLYNOMIALS

20 MATHEMATICS POLYNOMIALS 0 MATHEMATICS POLYNOMIALS.1 Introduction In Clss IX, you hve studied polynomils in one vrible nd their degrees. Recll tht if p(x) is polynomil in x, the highest power of x in p(x) is clled the degree of

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

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

Deriving Syntax and Axioms for Quantitative Regular Behaviours

Deriving Syntax and Axioms for Quantitative Regular Behaviours Deriving Syntx nd Axioms for Quntittive Regulr Behviours Filippo Bonchi 2, Mrcello Bonsngue 1,2, Jn Rutten 2,3, nd Alexndr Silv 2 1 LIACS - Leiden University 2 Centrum voor Wiskunde en Informtic (CWI)

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

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

Review of basic calculus

Review of basic calculus Review of bsic clculus This brief review reclls some of the most importnt concepts, definitions, nd theorems from bsic clculus. It is not intended to tech bsic clculus from scrtch. If ny of the items below

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

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

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

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying Vitli covers 1 Definition. A Vitli cover of set E R is set V of closed intervls with positive length so tht, for every δ > 0 nd every x E, there is some I V with λ(i ) < δ nd x I. 2 Lemm (Vitli covering)

More information

Bisimulation. R.J. van Glabbeek

Bisimulation. R.J. van Glabbeek Bisimultion R.J. vn Glbbeek NICTA, Sydney, Austrli. School of Computer Science nd Engineering, The University of New South Wles, Sydney, Austrli. Computer Science Deprtment, Stnford University, CA 94305-9045,

More information

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 UNIFORM CONVERGENCE Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 Suppose f n : Ω R or f n : Ω C is sequence of rel or complex functions, nd f n f s n in some sense. Furthermore,

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

Categorical approaches to bisimilarity

Categorical approaches to bisimilarity Ctegoricl pproches to bisimilrity PPS seminr, IRIF, Pris 7 Jérémy Dubut Ntionl Institute of Informtics Jpnese-French Lbortory for Informtics April 2nd Jérémy Dubut (NII & JFLI) Ctegoricl pproches to bisimilrity

More information

CSCI FOUNDATIONS OF COMPUTER SCIENCE

CSCI FOUNDATIONS OF COMPUTER SCIENCE 1 CSCI- 2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2015 My 7, 2015 2 Announcements Homework 9 is due now. Some finl exm review problems will be posted on the web site tody. These re prcqce problems not

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

Relating logic to formal languages

Relating logic to formal languages Relting logic to forml lnguges Kml Lody The Institute of Mthemticl Sciences, Chenni October 2018 Reding 1. Howrd Strubing: Forml lnguges, finite utomt nd circuit complexity, birkhäuser. 2. Wolfgng Thoms:

More information

MAA 4212 Improper Integrals

MAA 4212 Improper Integrals Notes by Dvid Groisser, Copyright c 1995; revised 2002, 2009, 2014 MAA 4212 Improper Integrls The Riemnn integrl, while perfectly well-defined, is too restrictive for mny purposes; there re functions which

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.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)

More information

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn

More information

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below. Dulity #. Second itertion for HW problem Recll our LP emple problem we hve been working on, in equlity form, is given below.,,,, 8 m F which, when written in slightly different form, is 8 F Recll tht we

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

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation Strong Bisimultion Overview Actions Lbeled trnsition system Trnsition semntics Simultion Bisimultion References Robin Milner, Communiction nd Concurrency Robin Milner, Communicting nd Mobil Systems 32

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

Review of Riemann Integral

Review of Riemann Integral 1 Review of Riemnn Integrl In this chpter we review the definition of Riemnn integrl of bounded function f : [, b] R, nd point out its limittions so s to be convinced of the necessity of more generl integrl.

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

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

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.2011.2.1 COMPUTER SCIENCE TRIPOS Prt IA Tuesdy 7 June 2011 1.30 to 4.30 COMPUTER SCIENCE Pper 2 Answer one question from ech of Sections A, B nd C, nd two questions from Section D. Submit the nswers

More information

Improper Integrals, and Differential Equations

Improper Integrals, and Differential Equations Improper Integrls, nd Differentil Equtions October 22, 204 5.3 Improper Integrls Previously, we discussed how integrls correspond to res. More specificlly, we sid tht for function f(x), the region creted

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

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

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

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

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1 Exm, Mthemtics 471, Section ETY6 6:5 pm 7:4 pm, Mrch 1, 16, IH-115 Instructor: Attil Máté 1 17 copies 1. ) Stte the usul sufficient condition for the fixed-point itertion to converge when solving the eqution

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

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

How to simulate Turing machines by invertible one-dimensional cellular automata

How to simulate Turing machines by invertible one-dimensional cellular automata How to simulte Turing mchines by invertible one-dimensionl cellulr utomt Jen-Christophe Dubcq Déprtement de Mthémtiques et d Informtique, École Normle Supérieure de Lyon, 46, llée d Itlie, 69364 Lyon Cedex

More information

Chapter 0. What is the Lebesgue integral about?

Chapter 0. What is the Lebesgue integral about? Chpter 0. Wht is the Lebesgue integrl bout? The pln is to hve tutoril sheet ech week, most often on Fridy, (to be done during the clss) where you will try to get used to the ides introduced in the previous

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

7.2 The Definite Integral

7.2 The Definite Integral 7.2 The Definite Integrl the definite integrl In the previous section, it ws found tht if function f is continuous nd nonnegtive, then the re under the grph of f on [, b] is given by F (b) F (), where

More information

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tble of Contents: Week 1: Preliminries (set lgebr, reltions, functions) (red Chpters 1-4) Weeks

More information

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives Block #6: Properties of Integrls, Indefinite Integrls Gols: Definition of the Definite Integrl Integrl Clcultions using Antiderivtives Properties of Integrls The Indefinite Integrl 1 Riemnn Sums - 1 Riemnn

More information

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions Physics 6C Solution of inhomogeneous ordinry differentil equtions using Green s functions Peter Young November 5, 29 Homogeneous Equtions We hve studied, especilly in long HW problem, second order liner

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

Math 1B, lecture 4: Error bounds for numerical methods

Math 1B, lecture 4: Error bounds for numerical methods Mth B, lecture 4: Error bounds for numericl methods Nthn Pflueger 4 September 0 Introduction The five numericl methods descried in the previous lecture ll operte by the sme principle: they pproximte the

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

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

Math 61CM - Solutions to homework 9

Math 61CM - Solutions to homework 9 Mth 61CM - Solutions to homework 9 Cédric De Groote November 30 th, 2018 Problem 1: Recll tht the left limit of function f t point c is defined s follows: lim f(x) = l x c if for ny > 0 there exists δ

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

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

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

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 2013 Outline 1 Riemnn Sums 2 Riemnn Integrls 3 Properties

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

MATH 101A: ALGEBRA I PART B: RINGS AND MODULES 35

MATH 101A: ALGEBRA I PART B: RINGS AND MODULES 35 MATH 101A: ALGEBRA I PART B: RINGS AND MODULES 35 9. Modules over PID This week we re proving the fundmentl theorem for finitely generted modules over PID, nmely tht they re ll direct sums of cyclic modules.

More information

Checking NFA equivalence with bisimulations up to congruence

Checking NFA equivalence with bisimulations up to congruence Checking NFA equivlence with bisimultions up to congruence Filippo Bonchi, Dmien Pous To cite this version: Filippo Bonchi, Dmien Pous. Checking NFA equivlence with bisimultions up to congruence. Principle

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

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

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

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

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility)

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility) CS5371 Theory of Computtion Lecture 20: Complexity V (Polynomil-Time Reducibility) Objectives Polynomil Time Reducibility Prove Cook-Levin Theorem Polynomil Time Reducibility Previously, we lernt tht if

More information

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus Unit #9 : Definite Integrl Properties; Fundmentl Theorem of Clculus Gols: Identify properties of definite integrls Define odd nd even functions, nd reltionship to integrl vlues Introduce the Fundmentl

More information

Integral points on the rational curve

Integral points on the rational curve Integrl points on the rtionl curve y x bx c x ;, b, c integers. Konstntine Zeltor Mthemtics University of Wisconsin - Mrinette 750 W. Byshore Street Mrinette, WI 5443-453 Also: Konstntine Zeltor P.O. Box

More information

Notes on length and conformal metrics

Notes on length and conformal metrics Notes on length nd conforml metrics We recll how to mesure the Eucliden distnce of n rc in the plne. Let α : [, b] R 2 be smooth (C ) rc. Tht is α(t) (x(t), y(t)) where x(t) nd y(t) re smooth rel vlued

More information

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford Probbilistic Model Checking Michelms Term 2011 Dr. Dve Prker Deprtment of Computer Science University of Oxford Long-run properties Lst lecture: regulr sfety properties e.g. messge filure never occurs

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

1 Probability Density Functions

1 Probability Density Functions Lis Yn CS 9 Continuous Distributions Lecture Notes #9 July 6, 28 Bsed on chpter by Chris Piech So fr, ll rndom vribles we hve seen hve been discrete. In ll the cses we hve seen in CS 9, this ment tht our

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

Introduction to Group Theory

Introduction to Group Theory Introduction to Group Theory Let G be n rbitrry set of elements, typiclly denoted s, b, c,, tht is, let G = {, b, c, }. A binry opertion in G is rule tht ssocites with ech ordered pir (,b) of elements

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 203 Outline Riemnn Sums Riemnn Integrls Properties Abstrct

More information

1.9 C 2 inner variations

1.9 C 2 inner variations 46 CHAPTER 1. INDIRECT METHODS 1.9 C 2 inner vritions So fr, we hve restricted ttention to liner vritions. These re vritions of the form vx; ǫ = ux + ǫφx where φ is in some liner perturbtion clss P, for

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

Chapter 14. Matrix Representations of Linear Transformations

Chapter 14. Matrix Representations of Linear Transformations Chpter 4 Mtrix Representtions of Liner Trnsformtions When considering the Het Stte Evolution, we found tht we could describe this process using multipliction by mtrix. This ws nice becuse computers cn

More information

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique? XII. LINEAR ALGEBRA: SOLVING SYSTEMS OF EQUATIONS Tody we re going to tlk bout solving systems of liner equtions. These re problems tht give couple of equtions with couple of unknowns, like: 6 2 3 7 4

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

1 Sets Functions and Relations Mathematical Induction Equivalence of Sets and Countability The Real Numbers...

1 Sets Functions and Relations Mathematical Induction Equivalence of Sets and Countability The Real Numbers... Contents 1 Sets 1 1.1 Functions nd Reltions....................... 3 1.2 Mthemticl Induction....................... 5 1.3 Equivlence of Sets nd Countbility................ 6 1.4 The Rel Numbers..........................

More information

Recitation 3: More Applications of the Derivative

Recitation 3: More Applications of the Derivative Mth 1c TA: Pdric Brtlett Recittion 3: More Applictions of the Derivtive Week 3 Cltech 2012 1 Rndom Question Question 1 A grph consists of the following: A set V of vertices. A set E of edges where ech

More information

Automata and Languages

Automata and Languages Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive

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

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

arxiv: v1 [math.ra] 1 Nov 2014

arxiv: v1 [math.ra] 1 Nov 2014 CLASSIFICATION OF COMPLEX CYCLIC LEIBNIZ ALGEBRAS DANIEL SCOFIELD AND S MCKAY SULLIVAN rxiv:14110170v1 [mthra] 1 Nov 2014 Abstrct Since Leibniz lgebrs were introduced by Lody s generliztion of Lie lgebrs,

More information

Universal coalgebra: a theory of systems

Universal coalgebra: a theory of systems Theoreticl Computer cience 249 (2000) 3 80 www.elsevier.com/locte/tcs Fundmentl tudy Universl colgebr: theory of systems J.J.M.M. Rutten CWI, P.O. Box 94079, 1090 GB Amsterdm, Netherlnds Communicted by

More information

f(x) dx, If one of these two conditions is not met, we call the integral improper. Our usual definition for the value for the definite integral

f(x) dx, If one of these two conditions is not met, we call the integral improper. Our usual definition for the value for the definite integral Improper Integrls Every time tht we hve evluted definite integrl such s f(x) dx, we hve mde two implicit ssumptions bout the integrl:. The intervl [, b] is finite, nd. f(x) is continuous on [, b]. If one

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

THE QUADRATIC RECIPROCITY LAW OF DUKE-HOPKINS. Circa 1870, G. Zolotarev observed that the Legendre symbol ( a p

THE QUADRATIC RECIPROCITY LAW OF DUKE-HOPKINS. Circa 1870, G. Zolotarev observed that the Legendre symbol ( a p THE QUADRATIC RECIPROCITY LAW OF DUKE-HOPKINS PETE L CLARK Circ 1870, Zolotrev observed tht the Legendre symbol ( p ) cn be interpreted s the sign of multipliction by viewed s permuttion of the set Z/pZ

More information

Supervisory Control (4CM30)

Supervisory Control (4CM30) Supervisory Control (4CM30) Verifiction in mcrl2 Michel Reniers M.A.Reniers@tue.nl 2016-2017 Verifiction in mcrl2 M CIF = φ CIF iff M mcrl2 = φ mcrl2 1. Adpt CIF model 2. Formulte property in modl µ-clculus

More information