Contextual graph grammars characterising Rational Graphs

Size: px
Start display at page:

Download "Contextual graph grammars characterising Rational Graphs"

Transcription

1 Contextul grph grmmrs chrcterising Rtionl Grphs Christophe Morvn To cite this version: Christophe Morvn. Contextul grph grmmrs chrcterising Rtionl Grphs. Henning Bordihn nd Rudolf Freund nd Mrkus Holzer nd Mrtin Kutri nd Friedrich Otto. Workshop on Non-Clssicl Models for Automt nd Applictions 21, 21, Jen, Germny. Österreichischen Computer Gesellschft, pp , 21, <inri-52549> HAL Id: inri Sumitted on 11 Oct 21 HAL is multi-disciplinry open ccess rchive for the deposit nd dissemintion of scientific reserch documents, whether they re pulished or not. The documents my come from teching nd reserch institutions in Frnce or rod, or from pulic or privte reserch centers. L rchive ouverte pluridisciplinire HAL, est destinée u dépôt et à l diffusion de documents scientifiques de niveu recherche, puliés ou non, émnnt des étlissements d enseignement et de recherche frnçis ou étrngers, des lortoires pulics ou privés.

2 CONTEXTUAL GRAPH GRAMMARS CHARACTERISING RATIONAL GRAPHS Christophe Morvn Universit Pris-Est, INRIA Rennes Bretgne Atlntique Cmpus de Beulieu, 3542 Rennes, Frnce Emil: Astrct Deterministic grph grmmrs generte fmily of infinite grphs which chrcterise contextfree (word) lnguges. The present pper introduces context-sensitive extension of these grmmrs. We prove tht this extension chrcterises rtionl grphs (whose trces re contextsensitive lnguges). We illustrte tht this extension is not strightforwrd: the most ovious context-sensitive grph rewriting systems generte non recursive infinite grphs. 1. Introduction In 1956, nd then in 1959 Nom Chomsky wrote two rticles which defined the Chomsky hierrchy. This hierrchy hs hd tremendous impct on the development of the theory of forml lnguges. Since the erly sixties, it hs served for the clssifiction, nd evlution of the expressive power of forml lnguges nd forml models. There is deep connection etween this hierrchy nd grphs. It is ovious for type 3 lnguges (regulr lnguges) which re chrcterised y finite utomt. But from the mid-eighties on, there hs een n incresing effort to chrcterise lnguge fmilies y grph fmilies. One of the first ttempts to estlish properties on structures chrcterising type 2 lnguges hs een done y Muller nd Schupp. They proved the decidility of the mondic second order theory of the grphs of pushdown utomt [MS85]. In their work, the vertices of the grphs re the configurtions of the pushdown utomton, nd the rcs re trnsitions etween configurtions. Such chrcteristion is clled internl, it thoroughly depends on the choice of the mchine, nd it gives n explicit nme to ech vertex. Courcelle, in [Cou9], extended the decidility of mondic second order theory to grphs generted y deterministic grph grmmrs. Indeed these grph grmmrs were clssicl grph rewriting systems used to chrcterise fmilies of grphs. In this pper they were used to define infinite grphs. Indeed these grphs re very close to grphs of pushdown utomt ([CK1]) ut it is n externl chrcteristion: ech grmmr genertes set of isomorphic grphs. The nme of the vertices re not explicitly stted long the genertion of the grph. This is relly importnt s it provides higher level of strction. Another slight extension of these two fmilies is formed y the

3 2 Christophe Morvn prefix-recognizle grphs from [Cu96]. In this pper Cucl provides oth n externl nd internl chrcteristion of these grphs. He lso proves tht they hve decidle mondic second order theory, nd tht they chrcterise context-free lnguges. For type 1 lnguges (context-sensitive lnguges), there re lso severl grph chrcteristions: trnsition grphs of liner ounded Turing mchines [KP99], rtionl grphs [Mor], utomtic grphs [BG, Ris3] or liner ounded grphs [CM6]. All these works provide internl chrcteristions: the grphs re defined s sets of trnsitions etween vertices which re words on some lphet. To our knowledge there is no externl grph chrcteristion of context-sensitive lnguges. In prticulr there exists no context-sensitive extension of Courcelle s grph rewriting systems. [Sch97] is survey presenting severl contextul grph rewriting systems ut they re used exclusively to chrcterise fmilies of finite grphs, nd no connection is estlished with the Chomsky hierrchy. In this pper we propose n externl chrcteristion of rtionl grphs in terms of contextul rewriting system. It is orgnised in two min prts: the first reclls the definition of regulr nd rtionl grphs nd the second presents context-sensitive grph rewriting systems. We first exmine nturl, unrestricted, contextul extension of grph grmmrs. We show tht it is too generl, s it produces non-recursive grphs. Then, we propose restriction, which corresponds to rtionl grphs. Afterwrds we exmine possile relxtions of some constrints which yield fmilies of non-recursive grphs. We conclude this pper pplying our chrcteristion to reprove some fcts on context-sensitive lnguges. 2. Deterministic grph grmmrs nd rtionl grphs In this section we define clssicl nottions nd recll fundmentl definitions for deterministic grph grmmrs nd rtionl grphs Mthemticl preliminries Fundmentls For ny set E, its powerset is denoted y 2 E ; if it is finite, its size is denoted y E. Let the set of non-negtive integers e denoted y N, nd {1,2,3,...,n} e denoted y [n]. A monoid M is set equipped with n ssocitive opertion (denoted ) nd (unique) neutrl element (denoted ε). A monoid M is free if there exist suset A of M such tht M = A := n N An nd for ech u M there exists unique finite sequence of elements of A, (u(i)) i [n], such tht u = u(1)u(2) u(n); if A is finite, then is free, of finite rnk. Elements of free monoid of finite rnk re clled words. Let u e word in M, u denotes the length of u nd u(i) denotes its ith letter.

4 Contextul Grph Grmmrs Chrcterising Rtionl Grphs 3 Hypergrphs Let F e n lphet (finite set) rnked y mpping : F N, this mpping ssocites to ech element of F its rity. Given rnked lphet F, we denote y F n the set of symols of rity n. Now given V n ritrry set, hypergrph G is suset of n 1 F n V n. The vertex set of such hypergrph is the set V G = {v V FV vv G }, in our setting, this set is either finite or countle. A hyperrc of rity n is denoted y f v 1 v 2 v n. Hyper rcs of rity 2 re clled rcs. Given hypergrph G, n rc st in G is identified with the lelled trnsition s G t or simply s t if G is understood. Furthermore, is the lel, s the source nd t the trget. Elements of F 1 (lels of rity 1) re clled colours. Grphs A (simple oriented lelled) grph G over V, lelled y P is hypergrphs hving only hyperrcs of rity 1 or 2 (P = P 1 P 2 ). Given grph G, the set of sources nd trgets re respectively denoted y Dom(G) nd Im(G) (y convention, oth sets contin lso vertices elonging to rity 1 hyperrcs). AgrphGisdeterministic ifdistinctrcswiththesmesourcehvedistinctlel: r s r t s = t. Let G e grph, pth in etween vertices u Dom(G) nd v Im(G), lelled w, corresponds to the existence of vertices (u i ) i [n] such tht u = u 1, v = u n nd u i w(i) G u i+1 for i [n 1]. Such pth is denoted y w = G or simply w = if G is understood. A grph morphism g, etween grphs G nd G is mpping from Dom(G) Im(G) to Dom(G ) Im(G ) such tht if there is n rc u v, then there is n rc g(u) g(v). G G Such morphism is n isomorphism if g is ijection, nd its inverse is lso morphism Deterministic grph grmmrs A finite presenttion is n effective tool in order to mnipulte n infinite grph. Such presenttions llow to conceive lgorithms working on these grphs. Deterministic (hyperedge replcement) grph grmmrs re clssicl exmple of finite (externl) chrcteristions of infinite grphs. These grmmrs were initilly defined to e n extension to grphs of word grmmrs (see, e.g., [Roz97]). These grph grmmrs derived, from n xiom, n infinite fmily of finite grphs. Courcelle in [Cou9] considered the deterministic form of these grmmrs, ech grmmr, seen s set of equtions, dmits single (up to isomorphism) infinite grph s lest solution. In [Cu7], Cucl mde n extensive survey on deterministic grphs grmmrs. In prticulr, he gve uniform presenttion of severl results: he developed frmework of simple techniques, mking intensive use of colours nd colouring, to provide new proofs of these results.

5 4 Christophe Morvn Definition 2.1 (Hypergrph grmmr). A hypergrph grmmr (hr-grmmr for short) G, is 4-tuple (N,T,R,H ), where N nd T re two rnked lphets of respectively non-terminls nd terminls symols; H is the xiom, finite grph formed y hyperrcs lelled y N T, nd R is set of rules of the form f x 1 x (f) H where f x 1 x (f) is n hyperrc joining disjoint vertices nd H is finite hypergrph. Oserve tht usully, the vertices ppering in the left-hnd side of rule pper in the righthnd side (though the definition does not commnd it). Remrk 2.2. In this pper, we consider grphs, therefore, the terminl symols will hve either rnk one, or two. Such grph is seen s simple suset of T 2 VV T 1 V. A grmmr is deterministic if there is single rewriting rule per non-terminl: (X 1,H 1 ),(X 2,H 2 ) R X 1 (1) = X 2 (1) (X 1,H 1 ) = (X 2,H 2 ) Now, given set of rules R, the rewriting R is the inry reltion etween hypergrphs defined s follows: M rewrites into N, written M R N if there is non-terminl hyperrc X = Av 1 v 2...v p in M nd rule Ax 1 x 2...x p H in R such tht N is otined y replcing X y H in M: N = (M X) h(h) for some injection h, mpping v i to x i for ech i, nd every other vertices of H to vertices outside of M. This rewriting is denoted y M N. R,X Now, this rewriting oviously extends to sets of non-terminl, for E such set, this rewriting is denoted: M N. The complete prllel rewriting = is the rewriting reltive to the set of R,E R ll non-terminl hyperrcs of R. Now given deterministic grph grmmr G = (N,T,R,H ), nd hypergrph H, we denote y [H] := H (T V H V H T V H ) the set of terminl rcs, nd colours of H. We define G ω, the limit set of G, s the set of ll countle union of [H n ], derived from H (there re infinitely mny H n for ech n): } G ω = { n [H n ] n,h n = H n+1 R Formlly, G ω is set of grphs, nd we sy tht grph H is generted y G if it elongs to G ω. But ll these grphs re isomorphic, thus, we will often express tht G ω is the grph generted y G. Exmple 2.3. This is simple exmple of deterministic grph grmmr nd representtion of the resulting grph.

6 Contextul Grph Grmmrs Chrcterising Rtionl Grphs 5 (2) A rule An xiom A grph A A A c A A (1) (1) (2) c c Grph grmmrs chrcterise regulr grphs. This chrcteristion is very efficient to extend techniques working for finite grphs to these infinite grphs (for exmple computing the connected components of regulr grph is simply doing it inductively on the right-hnd sides of the rules). Furthermore these grphs (restricted to finite degree) correspond to trnsition grphs of pushdown utomt [CK1]. Yet, lgorithms defined on pushdown utomt often mke technicl ssumptions on the form of the utomton: for exmple tht ech stte reflects tht the configurtion elongs to certin regulr set. In most cses these ssumptions only ffect the internls of the utomton, it does not ffect the structure of its configurtion grph. More precisely, these trnsformtions do not ffect glolly the fmily of grphs ut some individul grph my e trnsformed switching representtion. This is not the cse for grph grmmrs: norml forms preserve the generted grph. Thus grph grmmrs re more suited when focussing on structurl properties. In the next susection we will define rtionl grphs with n internl chrcteristion, lter on, in Section 3 we will extend grph grmmrs in order to chrcterise rtionl grphs. The wy we enrich these grmmrs is similr to wht is done for word grmmrs: contextul rewriting is necessry. However, in order to void eing too generl, we will hve to seprte context rcs from non-terminl ones, nd the xiom will e regulr grph (defined y hr-grmmr) Rtionl grphs In this susection we present key elements on rtionl grphs. More detils cn e found in [Mor, MS1]. The fmily of rtionl susets of monoid (M, ) is the lest fmily contining the finite susets of M nd closed under union, conctention nd itertion. A trnsducer is finite utomton lelled y pirs of words over finite lphet X, see for exmple [Ber79]. A trnsducer ccepts reltion in X X ; these reltions re clled rtionl reltions s they re rtionl susets of the product monoid (X X, ). Now, let us consider the grphs of Σ X X (here, in order to seprte explicitly first nd second vertices, we use Crtesin product insted of conctention). Rtionl grphs re extensions of rtionl reltions, they re defined y lelled trnsducers. Definition 2.4. A lelled trnsducer T = (Q,I,F,E,L) over X nd Σ, is composed of finite

7 6 Christophe Morvn set of sttes Q, set of initil sttes I Q, set of finl sttes F Q, finite set of trnsitions (or edges) E Q X X Q nd mpping L from F into 2 Σ. An rc u v is ccepted y lelled trnsducer T if there is pth from stte in I to stte f in F lelled y (u,v) nd such tht L(f). Definition 2.5. The set of rtionl grphs in Σ X X, denoted y Rt(Σ X X ), is formed y the grphs ccepted y lelled trnsducers. Exmple 2.6. The grph depicted elow, on the right-hnd side, is generted y the lelled trnsducer on the left-hnd side. / 1/1 q 1 / p 1/ε q 2 /1 /1 ε/ 1/ 1/1 r 2 1/1 r 1 / r 3 c ε c 1 c 1 11 c The pth p / q 1 /1 r 2 1/1 r 2 ccepts the pir (1,11), the finl stte r 2 is lelled y thus there is n rc 1 11 in the grph. Rtionl grphs hve een introduced in order to define generl fmily of infinite grphs generlising previous fmilies. They hve few decidle properties, ut they chrcterise contextsensitive lnguges (csl) [MS1]. The rtionl trees (rooted connected cyclic rtionl grphs such tht ech vertex hs t most one predecessor) hve decidle first order theory [CM6]. Employing trnsducers to define fmily of grphs is n internl chrcteristion. A side-effect of such definition is tht the set of vertices of rtionl grph is regulr set of words. This implies tht some grphs re not rtionl simply ecuse of their vertex set, ut it is not relted to their structure. In contrst, for finite grphs, every lgorithm, every chrcteristion, is given up to renming of the vertices. Such externl chrcteristion is difficult to otin for infinite grphs. Still, chrcteristions like hr-grmmrs overcome this prolem. The next section defines contextul grph grmmrs chrcterising rtionl grphs. 3. Contextul grph grmmrs There re severl contextul grph rewriting systems (see Section 4 in [Sch97]). But like for hr-grmmrs, these systems hve not een used to chrcterise fmilies of infinite grphs. Especilly in the sense of deterministic grph grmmrs. We will see tht it is difficult to define such systems generting exclusively recursive sets of rcs.

8 Contextul Grph Grmmrs Chrcterising Rtionl Grphs Contextul grph rewriting systems Recursivity is understood differently for set of finite grphs, nd single infinite grph: in the first cse, it corresponds to checking tht given grph elongs to the fmily, wheres for systems tht produce single grph, recursivity corresponds to deciding, from the grmmr, the existence of n rc etween two given vertices. In the cse of sets of grphs, s soon s the grmmr does not remove terminl rcs, it is recursive. In the cse of single grph, it is not sufficient: the rules my use non-terminl rcs to perform complex computtions, which my eventully produce n rc depending on the result of this computtion, in such sitution, the grph itself my e non-recursive. In this first susection we present nive contextul rewriting system which genertes nonrecursive grphs. Let N R e finite rnked set of non-terminls, nd T R finite rnked set of terminls. We propose here nturl definition of contextul grph rewriting system. Definition 3.1 (Contextul grph rewriting system). A contextul grph rewriting system S, is set of rules of the form H c f x 1 x (f) H c H where f x 1 x (f) is non-terminl hyperrc, H c is finite context grph, nd H is finite hypergrph, tht cn shre some vertices with H c nd { x 1,, x (f) }. Furthermore, Hc is composed only of terminl hyperrcs, nd H c f x 1 x (f) forms connected hypergrph. The sketch of proof for Proposition 3.2 provides n exmple of contextul rewriting rules (rules r,r 1,r re explicitely depicted). Now, given rewriting rule H c f x 1 x (f) H c H, rewriting step in grph G consists in finding the non-terminl f in G, such tht there is morphism h of H c f x 1 x (f) into G then removing f from G, nd dding H to G ccording to the rule, nd to the morphism h. Given contextul grph rewriting system S, nd finite grph H, we define S ω (H) in the sme wy s G ω for hr-grmmr G. Recll tht this grph is restriction to terminl symols, in prticulr in our setting it only hs hyperrcs of rity 1 or 2. We sy tht such contextul rewriting system is deterministic, if there is, t most, one rule for ech non-terminl. This restriction only limits non-determinism, s there might e some situtions where the context of non-terminl cn e found more thn once. In such sitution, it mens tht the rewriting system my generte t lest two non-isomorphic grphs. Unfortuntely this nturl generliztion of hr-grmmrs is much too generl (even restricted to systems where there is lwys single morphism to mtch the context): the grph rewriting systems generte non recursive grphs. The first oservtion towrd this result is the following: the trnsition grph of Turing Mchine is recursive: given two configurtions of the mchine it is trivil to check tht they

9 8 Christophe Morvn re connected in the trnsition grph. The second oservtion is tht the ccessile restriction (restriction to rechle configurtions) of this grph is non-recursive; if it were recursive it would imply the decidility of ccessiility for Turing mchines. Proposition 3.2. Let M e Turing mchine; u, nd u 1 two configurtions of M, there exists effectively contextul grph rewriting system S which genertes, from finite xiom A, set of grphs isomorphic to the ccessile component of the trnsition grph of M, from its initil configurtion. Furthermore ech vertex in ijection with u nd u 1 is mrked y colour c nd c 1 respectively (ech grph in S ω contins single pir of such vertices). Proof (sketch). Let M e Turing mchine, with tpe lphet Σ = {,1},nd sttes in the finite set Q. For simplifiction we ssume the tpe is filled initilly y zeros, nd tht M opertes on such tpe, we lso ssume tht the tpe is only infinite on the right, finlly configurtion ends with 1 or stte symol. A trnsition of M is tuple (p,a,q,b,δ) where p,q Q re respectively the current nd next stte of M, A Σ is the tpe letter immeditely on the right of the reding hed, δ { 1,+1} represent the movement of the hed to the left or right, nd B is the letter replcing A fter the move. Let = (p,q,1,, 1) e trnsition of M. 1 X 1 X 1 r r 1 1 p 1 1 p n X 1 X 1 X X 1 1 # root end p 1 q r, root p 1 end nxt q X 1 X 1 Rules r nd r 1 generte complete tree corresponding to configurtions of M, ech pth leding from the root to n rc lelled # corresponds to configurtion of the mchine. For ech trnsition of M, there is one or two rules 2 similr to r, simulting the rewriting step from configurtion to the next one. The context of such rule is formed y the rcs,p,1 nd q,,1 the rewriting consist simply in removing the non-terminl nd producing nxt. Before pplying these rules the trnsition is simply moving long single pth (reclling the root nd the end). The rule corresponding to nxt performs the sme pth long the second nd forth vertices. The rule tht ensures termintion nd thus the restriction to single connected component is the following: root chk # end τ root # r chk # end # new The left hnd-side of this rule witnesses tht the computtion hs reched the end of the originl configurtion, the non-terminl new records the position of the root nd the position of the extremity of the new configurtion, the right hnd-side from new strts over new 2 There re two rules when δ = 1 depending on the symol preceding the reding hed.

10 Contextul Grph Grmmrs Chrcterising Rtionl Grphs 9 computtion. There is τ-lelled rc etween the two vertices corresponding to the respective configurtions. Ultimtely the grph is formed simply y τ lelled rcs. The xiom is this finite grph: X new root p # end Colours c nd c 1 re simply dded y single rule hving for context tree corresponding to oth configurtions. If it were decidle whether there is n τ-rc etween c nd c 1, it would enle to decide the existence of n rc in the (non-recursive) ccessile component rechle in the trnsition grph of M from the initil configurtion. Proposition 3.2 my e reformulted into following corollry. Corollry 3.3. Deterministic contextul grph rewriting systems generte non recursive grphs. Oviously from Turing mchine, M, nd two configurtions, the existence of n rc etween these configurtions in the ccessile component of the trnsition grph of M might e checked if it could e checked in the grph generted y the system derived from Proposition Contextul hyper-edge-replcement grph grmmrs We present, now, more restrictive contextul rewriting system which will e used to chrcterise rtionl grphs. Definition 3.4. A contextul hyper-edge-replcement hypergrph grmmr (chr-grmmr for short) is tuple (C,N,T,R c,h ), where C,N nd T re finite rnked lphets of respectively contextul, non-terminl nd terminl symols; R c is deterministic contextul grph rewriting system where, for ech rule H c fx 1...x (f) H c H, the grph H c is formed only y rcs lelled in C, nd H y rcs lelled in T N, nd H is the xiom: deterministic regulr grph formed y rcs with lels in C, nd single non-terminl hyperrc. Given chr-grmmr G = (C,N,T,R c,h ), the set G ω is defined similrly s for hr-grmmr s R ω c(h ). Oserve tht, for ech rule in R c, the context grph (H c ) is not modified: no rc is removed, nd no rc is dded, thus successive rewritings preserve the xiom H. Furthermore, this definition imposes tht the xiom is deterministic regulr grph. This ensures tht for ech rule r R c (with non-terminl A) nd ech occurrence of A in the grph, there is t most single morphism which mps the context of the left-hnd side of r to the neighourhood of A. This restriction my e checked, since verifying tht given grph grmmr genertes deterministic grph is decidle (direct consequence of Proposition 3.13 in [Cu7]). Lter in this pper we will discuss other structurl restrictions (for the xiom), nd see tht it is difficult to llow grphs tht re not trees. We will lso hve to impose stronger restrictions on the rules R c in order chieve chrcteristion.

11 1 Christophe Morvn We first show tht n X -ry tree s xiom is sufficient to otin ech grph of Rt(Σ X X ). Proposition 3.5. Ech rtionl grph is generted y chr-grmmr. Like for Proposition 3.2, the proof is in the full pper. We sketch this strightforwrd construction. Proof (sketch). Let G e rtionl grph in Σ X X (nd T trnsducer representing it), let H e the complete X -ry tree lelled on X (with non-terminl p on the root). For ech stte p of T, we hve the following rule r p. p L(p) u 1 u 2 u n v 1 v 2 v n r p u1 u 2 u n v 1 v 2 v n q 1 q 2 q m Here, we suppose tht there re trnsitions p u i/v i qi for some sttes (q i ) i [m], nd lso L(p) represent ll lels produced t stte p (if p is terminl stte). Now ech pir of pth in H correspond to pth of pirs in T. Thus oth grphs re the sme Tree-seprted contextul grmmrs generte rtionl grphs This susection identifies restrictions on chr-grmmr which enle converse inclusion for Proposition 3.5. A chr-grmmr (C,N,T,R c,h ) is clled tree-chr-grmmr if the xiom H is tree, nd the left-hnd side of ech rule of R c is formed y trees rooted in the vertices of the non-terminl (some vertices of this non-terminl my e non-root vertices of theses trees). Furthermore, if ech of these trees possesses single vertex elonging to the non-terminl (its root) this grmmr is clled tree-seprted-chr-grmmr. Grphs generted y the ltter re cptured y rtionl grphs: Proposition 3.6. Any grph generted from tree-seprted-chr-grmmr, is isomorphic to grph in Rt(Σ X X ). There re severl difficulties to estlish this result: the xiom is not complete tree, so we need to ensure tht n rc is never set on vertex tht does not exist. Hyperrcs of rity greter thn 2 need to e tken into ccount. Finlly, there my e twists: in the right-hnd side of rule, the pth from the gol of the originl non-terminl my led to the source of some other non-terminl.

12 Contextul Grph Grmmrs Chrcterising Rtionl Grphs 11 In order to prove Proposition 3.6 we first stte two technicl lemms (whose proofs re postponed to the ppendix). Lemm 3.7. The set of pth lels from the root of regulr tree leding to some colour (rc of rity 1) is regulr set of words. Lemm 3.8. Any tree-seprted-chr-grmmr G cn e effectively trnsformed into treeseprted-chr-grmmr G generting the sme set of grphs nd such tht, for ech rule r of G, ech non-terminl ppering in the right-hnd side of r hs t most one vertex in ech tree of the context grph. We re now le to sketch the proof of Proposition 3.6. Proof (sketch). We first suppose the xiom is some complete n-ry tree. Lemm 3.8 enles tht ech non-terminl hs t most single vertex in ech sutree of the right-hnd side of ech rule. Then the sttes of the trnsducer re defined y ordered pirs of vertices of the non-terminls, nd the trnsitions from the pths in the right-hnd sides. Terminl sttes re defined y pirs of vertices of terminl rcs (source, trget). Second, if the regulr tree is not complete tree, we use Lemm 3.7 to compute regulr set of pths reching leves: P. Then, it is not sufficient to mke n intersection with the set P P, since some rewriting my not occur from the sence of some vertex long the rewritings. Thus, we synchronize the trnsducer with the set P: ech stte A (u1,u 2 ) checks tht the complete context for the rule of A is ville. Comining Proposition 3.6 nd 3.5 we stte the min result of this pper (oserve tht the grmmr which proves Proposition 3.5 is tree-seprted-chr-grmmr). Theorem 3.9. The fmily of rtionl grphs, nd the grphs generted y tree-seprted-chrgrmmrs coincide. Now, slightly modifying the rules presented in the proof Proposition 3.2 enles to extend it. The rules r nd r 1 generte the xiom, nd the only rule tht does not stisfy tree-seprtedchr-grmmr restrictions is r chk. From this oservtion we otin the following result. Proposition 3.1. Tree-chr-grmmrs generte non-recursive grphs. This result proves tht in some sense tree-seprted-chr-grmmrs re the most generl context-sensitive grph rewriting system cpturing rtionl grphs nd nothing more.

13 12 Christophe Morvn 4. Applictions nd conclusion Applictions We first reformulte Theorem 4.12 of [MS1] in the context of tree-seprted-chr-grphs. Theorem 4.1. [MS1] The set of pths etween two colours in tree-seprted-chr-grphs coincide with context-sensitive lnguges. A mjor interest of hving grph chrcteristion of lnguges is tht it enles simple proofs for lnguge properties. In this susection we provide direct pplictions of tree-seprtedchr-grmmrs to reprove simple results for csl. Proposition 4.2. Let G 1 nd G 2 e two tree-seprted-chr-grphs: the itertion of G 1, the conctention nd synchronistion product of G 1 nd G 2 re tree-seprted-chr-grphs. These results re proved constructing compound xiom nd compound rules. Using Theorem 4.1, Proposition 4.2 proves the following results: Corollry 4.3. The csl re closed under conctention nd Kleene str; the intersection of two csl is csl. One of the most stunning result for csl is closure under complementtion [Sze88, Imm88]. It would e interesting to reprove this result using grph pproch. Unfortuntely, proving closure under complementtion with grphs is relted to closure under deterministion. But here, lnguges recognised y deterministic tree-seprted-chr-grphs re deterministic csl. If they contined ll csl it would prove Kurdod s conjecture [Kur64] on the equivlence etween deterministic nd non-deterministic csl. Our conjecture is tht deterministic rtionl grphs do not recognise ll csl. Thus, using this grph chrcteristion to prove closure under complement would e similr to proving the closure under complement of Bchi utomt: it would not use the grph structure. Conclusion In this pper we hve presented fmily of infinite grphs generted y contextul grph grmmrs. This fmily chrcterises rtionl grphs. We lso hve exmined severl vrints which generte non-recursive grphs. Elorting on techniques from hr-grmmr we hope to provide toolox for mnipulting these grphs nd then eing le to improve the knowledge of csl. An interesting question is the chrcteristion of the grphs of higher order pushdown utomt in terms of grph rewriting systems. Such chrcteristion could enle deeper understnding of the structure of these ojects.

14 Contextul Grph Grmmrs Chrcterising Rtionl Grphs 13 References [Ber79] J. Berstel. Trnsductions nd context-free lnguges. Teuner, [BG] A. Blumensth nd E. Grädel. Automtic Structures. In 15th IEEE Symposium on Logic in Computer Science LICS 2, pges 51 62, 2. [Cu96] D. Cucl. On trnsition grphs hving decidle mondic theory. In Iclp 96, volume 199 of LNCS, pges , [Cu7] D. Cucl. Deterministic grph grmmrs. In Texts in logics nd gmes 2, pges Amsterdm University Press, 27. [CK1] D. Cucl nd T. Knpik. An internl presenttion of regulr grphs y prefix-recognizle ones. Theory of Computing Systems, 34(4), 21. [CM6] A. Cryol nd A. Meyer. Context-sensitive lnguges, rtionl grphs nd determinism. Logicl Methods in Computer Science, 2(2), 26. [CM6] A. Cryol nd C. Morvn. On rtionl trees. In Zoltán sik, editor, CSL 6, volume 427 of LNCS, pges , 26. [Cou9] B. Courcelle. Hndook of Theoreticl Computer Science, chpter Grph rewriting: n lgeric nd logic pproch. Elsevier, 199. [Imm88] N. Immermn. Nondeterministic spce is closed under complementtion. SIAM Journl on computing, 17(5): , Octoer [KP99] T. Knpik nd E. Pyet. Synchroniztion product of liner ounded mchines. In FCT, volume 1684 of LNCS, pges , [Kur64] S.-Y. Kurod. Clsses of lnguges nd liner-ounded utomt. Informtion nd Control, 7(2):27 223, June [Mor] C. Morvn. On rtionl grphs. In J. Tiuryn, editor, Fosscs, volume 1784 of LNCS, pges , 2. [MS85] D. Muller nd P. Schupp. The theory of ends, pushdown utomt, nd second-order logic. Theoreticl Computer Science, 37:51 75, [MS1] C. Morvn nd C. Stirling. Rtionl grphs trce context-sensitive lnguges. In MFCS, volume 2136 of LNCS, pges , 21. [Ris3] C. Rispl. The synchronized grphs trce the context-sensitive lnguges. In ENTCS, volume 68, pges 55 7, 23. [Roz97] G. Rozenerg, editor. Hndook of Grph Grmmrs nd Computing y Grph Trnsformtions, Volume 1: Foundtions. World Scientific, [Sch97] A. Schürr. Progrmmed grph replcement systems. In Rozenerg [Roz97], pges [Sze88] R. Szelepcsényi. The method of forced enumertion for nondeterministic utomt. Act Informtic, 26(3): , Novemer 1988.

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

Formal Languages and Automata

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

More information

Lecture 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

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

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

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

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

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

On Rational Graphs. Christophe Morvan. IRISA, Campus de Beaulieu, Rennes, France

On Rational Graphs. Christophe Morvan. IRISA, Campus de Beaulieu, Rennes, France On Rtionl Grphs Christophe Morvn IRISA, Cmpus de Beulieu, 35042 Rennes, Frnce christophe.morvn@iris.fr Astrct. Using rtionlity, like in lnguge theory, we define fmily of infinite grphs. This fmily is strict

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

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

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

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

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

CONTEXT-SENSITIVE LANGUAGES, RATIONAL GRAPHS AND DETERMINISM

CONTEXT-SENSITIVE LANGUAGES, RATIONAL GRAPHS AND DETERMINISM Logicl Methods in Computer Science Vol. 2 (2:6) 2006, pp. 1 24 www.lmcs-online.org Sumitted Jn. 31, 2005 Pulished Jul. 19, 2006 CONTEXT-SENSITIVE LANGUAGES, RATIONAL GRAPHS AND DETERMINISM ARNAUD CARAYOL

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

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

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

More general families of infinite graphs

More general families of infinite graphs More generl fmilies of infinite grphs Antoine Meyer Forml Methods Updte 2006 IIT Guwhti Prefix-recognizle grphs Theorem Let G e grph, the following sttements re equivlent: G is defined y reltions of the

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

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

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

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

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

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

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

The Caucal Hierarchy of Infinite Graphs in Terms of Logic and Higher-order Pushdown Automata

The Caucal Hierarchy of Infinite Graphs in Terms of Logic and Higher-order Pushdown Automata The Cucl Hierrchy of Infinite Grphs in Terms of Logic nd Higher-order Pushdown Automt Arnud Cryol 1 nd Stefn Wöhrle 2 1 IRISA Rennes, Frnce rnud.cryol@iris.fr 2 Lehrstuhl für Informtik 7 RWTH Achen, Germny

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

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

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

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

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

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

BACHELOR THESIS Star height

BACHELOR THESIS Star height BACHELOR THESIS Tomáš Svood Str height Deprtment of Alger Supervisor of the chelor thesis: Study progrmme: Study rnch: doc. Štěpán Holu, Ph.D. Mthemtics Mthemticl Methods of Informtion Security Prgue 217

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

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

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

1.3 Regular Expressions

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

More information

Finite 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

Thoery of Automata CS402

Thoery of Automata CS402 Thoery of Automt C402 Theory of Automt Tle of contents: Lecture N0. 1... 4 ummry... 4 Wht does utomt men?... 4 Introduction to lnguges... 4 Alphets... 4 trings... 4 Defining Lnguges... 5 Lecture N0. 2...

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

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

Homework 3 Solutions

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

More information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

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

More information

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

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

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

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

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings... Tle of contents: Lecture N0.... 3 ummry... 3 Wht does utomt men?... 3 Introduction to lnguges... 3 Alphets... 3 trings... 3 Defining Lnguges... 4 Lecture N0. 2... 7 ummry... 7 Kleene tr Closure... 7 Recursive

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

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

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

Finite-State Automata: Recap

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

More information

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

Context-Free Grammars and Languages

Context-Free Grammars and Languages Context-Free Grmmrs nd Lnguges (Bsed on Hopcroft, Motwni nd Ullmn (2007) & Cohen (1997)) Introduction Consider n exmple sentence: A smll ct ets the fish English grmmr hs rules for constructing sentences;

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

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

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

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

More information

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

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

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

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

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

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

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

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

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

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

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

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

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

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

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

More information

ɛ-closure, Kleene s Theorem,

ɛ-closure, Kleene s Theorem, DEGefW5wiGH2XgYMEzUKjEmtCDUsRQ4d 1 A nice pper relevnt to this course is titled The Glory of the Pst 2 NICTA Resercher, Adjunct t the Austrlin Ntionl University nd Griffith University ɛ-closure, Kleene

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

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

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

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

More information

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 Tle of Contents: Week 1: Preliminries (set lger, reltions, functions) (red Chpters 1-4) Weeks

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

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

CDM Automata on Infinite Words

CDM Automata on Infinite Words CDM Automt on Infinite Words 1 Infinite Words Klus Sutner Crnegie Mellon Universlity 60-omeg 2017/12/15 23:19 Deterministic Lnguges Muller nd Rin Automt Towrds Infinity 3 Infinite Words 4 As mtter of principle,

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

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA) Finite Automt (FA or DFA) CHAPTER Regulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, equivlence of NFAs DFAs, closure under regulr

More information

Name Ima Sample ASU ID

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

More information

Domino Recognizability of Triangular Picture Languages

Domino Recognizability of Triangular Picture Languages Interntionl Journl of Computer Applictions (0975 8887) Volume 57 No.5 Novemer 0 Domino Recognizility of ringulr icture Lnguges V. Devi Rjselvi Reserch Scholr Sthym University Chenni 600 9. Klyni Hed of

More information

Free groups, Lecture 2, part 1

Free groups, Lecture 2, part 1 Free groups, Lecture 2, prt 1 Olg Khrlmpovich NYC, Sep. 2 1 / 22 Theorem Every sugroup H F of free group F is free. Given finite numer of genertors of H we cn compute its sis. 2 / 22 Schreir s grph The

More information

SWEN 224 Formal Foundations of Programming WITH ANSWERS

SWEN 224 Formal Foundations of Programming WITH ANSWERS T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Time Allowed: 3 Hours EXAMINATIONS 2011 END-OF-YEAR SWEN 224 Forml Foundtions of Progrmming

More information

Hierarchy of pushdown graphs

Hierarchy of pushdown graphs Hierrchy o pushdown grphs Didier Cucl CNRS / LIGM University Pris- Est Frnce The hierrchy o pushdown grphs recursive trnsition grphs Corresponding hierrchies o lnguges, terms, ordinls, ininite words higher

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

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions

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

Fundamentals of Computer Science

Fundamentals of Computer Science Fundmentls of Computer Science Chpter 3: NFA nd DFA equivlence Regulr expressions Henrik Björklund Umeå University Jnury 23, 2014 NFA nd DFA equivlence As we shll see, it turns out tht NFA nd DFA re equivlent,

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

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

Random subgroups of a free group

Random subgroups of a free group Rndom sugroups of free group Frédérique Bssino LIPN - Lortoire d Informtique de Pris Nord, Université Pris 13 - CNRS Joint work with Armndo Mrtino, Cyril Nicud, Enric Ventur et Pscl Weil LIX My, 2015 Introduction

More information

Marking shortest paths on pushdown graphs does not preserve MSO decidability

Marking shortest paths on pushdown graphs does not preserve MSO decidability Mrking shortest pths on pushdown grphs does not preserve MSO decidility Arnud Cryol, Olivier Serre To cite this version: Arnud Cryol, Olivier Serre Mrking shortest pths on pushdown grphs does not preserve

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

Revision Sheet. (a) Give a regular expression for each of the following languages:

Revision Sheet. (a) Give a regular expression for each of the following languages: Theoreticl Computer Science (Bridging Course) Dr. G. D. Tipldi F. Bonirdi Winter Semester 2014/2015 Revision Sheet University of Freiurg Deprtment of Computer Science Question 1 (Finite Automt, 8 + 6 points)

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