Regular Expressions for Muller Context-Free Languages

Size: px
Start display at page:

Download "Regular Expressions for Muller Context-Free Languages"

Transcription

1 ct Cyernetic 23 (2017) Regulr Expressions for Muller Context-Free Lnguges Kitti Gelle nd zolcs ván strct Muller context-free lnguges (MCFLs) re lnguges of countle words, tht is, leled countle liner orders, generted y Muller context-free grmmrs. Equivlently, they re the frontier lnguges of (nondeterministic Muller-)regulr lnguges of infinite trees. n this rticle we survey the known results regrding MCFLs, nd show tht lnguge is n MCFL if nd only if it cn e generted y so-clled µη-regulr expression. Keywords: Muller context-free lnguges, well-ordered induction, regulr expressions 1 ntroduction word, lso clled rrngement in [9], is the isomorphism type of leled liner order. Thus, this notion is generliztion of finite nd ω-words, permitting e.g. lelings of the integers of the rtionls. Finite utomt on ω-words hve y now vst literture, see [21] for comprehensive tretment. Finite utomt cting on well-ordered words longer thn ω hve een investigted in [1, 6, 7, 24, 25], to mention few references. Recently, the theory of utomt on well-ordered words hs een extended to utomt on ll countle words, including scttered nd dense words. n [2, 5, 4], oth opertionl nd logicl chrcteriztions of the clss of lnguges of countle words recognized y finite utomt were otined. Context-free grmmrs generting ω-words were introduced in [8] nd susequently studied in [3, 19]. Context-free grmmrs generting ritrry countle words were defined in [10, 11]. ctully, two types of grmmrs were defined, context-free grmmrs with üchi cceptnce condition (CFG), nd context-free grmmrs with Muller cceptnce condition (MCFG). These grmmrs generte the üchi nd the Muller context-free lnguges of countle words, revited s CFLs nd MCFLs. Every CFL is clerly n MCFL, ut there exists n This work ws supported y NKF grnt no University of zeged, Hungry, E-mil: {kgelle,szivn}@inf.u-szeged.hu DO: /ctcy

2 350 Kitti Gelle nd zolcs ván MCFL of well-ordered words tht is not CFL, for exmple the set of ll countle well-ordered words over some lphet. n fct, it ws shown in [10] tht for every CFL L of well-ordered words there is n integer n such tht the order type of the underlying liner order of every word in L is ounded y ω n. n this pper we survey the results on Muller context-free lnguges, nd we give n opertionl ( regulr-expression-like ) chrcteriztion of this clss. 2 Nottion 2.1 Liner orderings (strict) liner ordering is pir (, <) where < is strict totl ordering on, tht is, n irreflexive, trnsitive nd trichotomous reltion. et-theoreticl properties of the domin set, such s finiteness, memership nd crdinlity re lifted to the ordering (, <) thus we cn sy e.g. tht liner ordering is countle, finite etc. n order to ese nottion, we will omit the ordering < from the pir nd identify the ordering (, <) with its domin, if the ordering reltion is not importnt or is cler from the context. n this pper we will (unless stted otherwise) only del with countle orderings. good reference for liner orderings is [23]. n emedding of liner ordering (, <) into liner ordering (J, ) is (necessrily) injective mpping h : J preserving the ordering, i.e. x < y implying h(x) h(y). We write (, <) (J, ) if cn e emedded into J. Clerly, this reltion is preorder ( reflexive nd trnsitive reltion) etween orderings. surjective emedding is clled n isomorphism etween the orderings nd J; if there exists n isomorphism etween nd J, then they re clled isomorphic. somorphism of liner orderings is n equivlence reltion, the clsses of which re clled order types. Well-known isomorphism types re the order type ω of the nturl numers N, the type ω of the negtive integers, the type ζ of integers nd the type η of rtionls. ince isomorphism is comptile with emeddility, we cn sy tht n order type α cn e emedded into n order type β, written s α β. Note tht this reltion is not ntisymmetric in generl s the orderings (0, 1) nd [0, 1] cn e emedded into ech other ut they re not isomorphic s the ltter one hs lest element while the former one does not. The ordering (, <) is su-ordering of (J, ) if J nd < is the restriction of onto. n ordering is well-ordering if it hs no su-ordering of type ω, is scttered if it hs no su-ordering of type η, qusi-dense if it is not scttered nd dense if it hs t lest two elements nd for ny x < y there exists some z with x < z < y. ll dense countle orderings hve the type η, possily enriched with either lest or gretest element (or oth). Order types of well-orderings re clled ordinls. mongst the clss of ordinls, the emeddility reltion itself is well-ordering, moreover, ech ordinl α is either successor ordinl α = β + 1 for some ordinl β, in which cse there is no other ordinl etween α nd β, or is limit ordinl with α = β, i.e. is the lest upper ound of the set of ordinls strictly β<α smller thn α with respect to the emeddility reltion <. Note tht lthough

3 Regulr Expressions for Muller Context-Free Lnguges 351 the ordinls themselves form proper clss, whenever α is n ordinl, then the clss of ordinls smller thn β is set nd whenever X is set of ordinls, then their lest upper ound X exists nd is n ordinl. Moreover, the clss of countle ordinls is the lest clss which contins the order types 0 nd 1 nd is closed under tking ω-sums, tht is, tking suprem of ω-chins. When (, ) is some linerly ordered index set nd for ech i, (J i, < i ) is liner order, then their ordered sum (J, <) = i (J i, < i ) hs the disjoint union J = {(i, j) : i, j J i } s domin with (i, j) < (i, j ) if either i i or i = i nd j < i j. n prticulr, (J 1, < 1 ) + (J 2, < 2 ) denotes the sum (J i, < i ). t is cler i {1,2} tht well-ordered sum of well-ordered orderings is well-ordered, nd scttered sum of scttered orderings is scttered. The sum opertion is lso comptile with the isomorphism, thus it cn e extended to order types. For exmple, ω + ω = ζ nd η + η = η η = η where 1 is the order type of the singleton orderings; in generl, n is the order type of the n-element orderings for n N 0 = {0, 1,...}. f α is the order type of nd β is the order type of ech J i, i, then β α stnds for the order type of the sum i J i. Hence, product of ordinls is n ordinl. Ordinls re lso equipped with n exponenttion opertor ut we will only use finite powers of the form α n, with n eing n integer, tht is, α 0 = 1 nd α n+1 = α n α. Husdorff clssified the scttered order types into n infinite hierrchy. We mke use of the following vrint [17] of this hierrchy: let V D 0 e the clss of ll finite order types, nd when α is some ordinl, then let V D α consist of the clss of ll order types tht cn e written s i where ech i is memer of V D βi i ζ for some ordinl β i < α. Husdorff s theorem sttes tht (countle) order type is scttered if nd only if it is contined in V D α for some (countle) ordinl α. The Husdorff-rnk rnk(o) of scttered order type o is the lest ordinl α with o V D α. 2.2 Words, tree domins, trees n lphet is finite nonempty set of symols, or letters. lphets re usully denoted Σ, Γ in this pper, nd letters re denoted y,, c,.... Σ-leled liner ordering is tuple w = (dom(w), l w ) where dom(w) = (, <) is some liner ordering nd l w : Σ is the leling function of w. We usully identify w with l w nd write w(i) for l w (i), i dom(w). Two words u nd v re isomorphic if there is n isomorphism h : dom(u) dom(v) which preserves lso the lels, tht is, u(i) = v(h(i)) for ech i dom(u). word over Σ is n isomorphism clss of countle Σ-leled liner orderings. For convenience, when u is word, we tke representnt of u nd use the nottion dom(u), l u referring the domin nd leling of the representnt. Order theoretic properties re lifted to words. The set of ll countle, ω- nd finite words over Σ re respectively denoted Σ #, Σ ω nd Σ. n prticulr, ε denotes the empty word (hving the empty set s domin). Note tht s for ny Σ, there is unique η-word u such tht for ny x < y dom(u) nd

4 352 Kitti Gelle nd zolcs ván letter Σ there is some z dom(u) with x < z < y nd u(z) =, this u eing clled the perfect shuffle of Σ, nd every countle Σ-word v is suword of thus u (tht is, dom(v) is su-ordering of dom(u) nd l v is the restriction of l u to dom(v)), thus Σ # is indeed set. lnguge over Σ is n ritrry suset of Σ #. Lnguges will usully e denoted y K, L,.... When (, <) is liner ordering nd for ech i, w i is Σ-word, then their product or (con)ctention is the word w = w i with domin dom(w i ) nd i i the leling of l w eing the source tupling of the lelings l wi, tht is, for (i, j), i, j dom(w i ) let w(i, j) e w i (j). Product is extended to lnguges in the expected wy: when (, <) is the indexing ordering nd to ech i, L i Σ # is lnguge, then L i consists of those words w i where w i L i for ech i. i inry products re simply written s u v or K L, or simply uv nd KL. When α is some order type, then L α is the lnguge L, nd L stnds for the union i α of the lnguges L n, n eing nturl numer. lso, L + stnds for L n. tree domin is prefix closed nonempty (ut possily infinite) suset T of N. Tht is, whenever x i is in T for x N nd i N, then so is x, in which cse x is the prent of x i nd x i is child of x. Memers of T re lso clled nodes of T. f x y T for x, y N, then x is clled n ncestor of x y nd x y is descendnt of x, denoted x x y. f y is nonempty, then we tlk out proper ncestor / descendnt, denoted x x y. Nodes of T hving no child re clled leves of T, the other nodes re clled inner nodes of T. Clerly, ε is memer of every tree domin. usets of tree domin T which re tree domins themselves re clled prefixes of T. pth π of T is prefix in which every node hs t most one child. Clerly, to every pth π there exists unique word u π in N ω = N N ω such tht π = {x N : x u π }. We will use π nd u π interchrgly. When T is tree domin nd x T, then the su-tree domin of T is T x = {y N : xy T }. t is cler tht T x is lso tree domin, nd is pth if so is T. (Σ-)tree over some lphet Σ is leled tree domin t, tht is, pir (dom(t), l t ) where dom(t) is tree domin nd l t : dom(t) Σ is leling function. imilrly to the cse of words, we often identify t with l t nd write t(x) in plce of l t (x) for x dom(t). Notions of tree domins (nodes, pths, su-tree domins etc.) re lifted to trees; the sutree of t rooted t some node x dom(t) hs the domin dom(t) x nd leling y t(xy). When X dom(t) is set of nodes of t, then lels(t, X) = {t(x) : x X} is the set of lels occurring on the nodes elonging to X, nd inflels(t, X) is the set of lels occurring infinitely mny times. n prticulr, if π is pth of t, then letter Σ elongs to inflels(t, π) if nd only if for ech x π there exists some descendnt y π of x with t(y) =. When t is cler from the context, we just write lels(x) nd inflels(x), respectively. For ny infinite pth π, there exists -miniml node x of π with inflels(π x ) = lels(π x ), this node x is denoted hed(π). Clerly, i n>0

5 Regulr Expressions for Muller Context-Free Lnguges 353 inflels(π) = inflels(π x ) lels(π x ) lels(π) for every pth π nd node x π. 2.3 Muller context-free grmmrs nd lnguges Muller context-free grmmr or MCFG for short, is tuple G = (N, Σ, P,, F) where N nd Σ re the disjoint lphets of nonterminls (or vriles) nd terminls, respectively, N is the strt symol, P is the finite set of productions (or rules) of the form α with N nd α (N Σ) +, nd F P (N) is the Muller cceptnce condition. Here P (N) = {N N} is the power set of N. Oserve tht we explicitly disllow rules of the form ε here; this mkes the tretment of lef lels more uniform, nd s it turns out, such rules cn e mimicked y introducing fresh nonterminl, rules nd nd dding {} to the cceptnce condition. Nevertheless, in our exmples we will mke use of rules ε in order to help redility. n (N Σ)-tree t is loclly consistent (with G) if it stisfies the following condition: ech inner node x of t is leled y some nonterminl nd the set of children of x is {x 1,..., x n} for some integer n > 0 with t(x 1)t(x 2)... t(x n) eing production in P. loclly consistent tree is complete if its leves re leled in Σ. The leves of ny tree domin re linerly ordered y the lexicogrphic ordering < l, tht is, u < l v if nd only if u = u 1 i u 2 nd v = u 1 j u 3 for some words u 1, u 2, u 3 N nd integers i < j. The frontier word of tree t is the word fr(t) hving the set of leves s domin, ordered lexicogrphiclly, nd leling inherited from t. Tht is, dom(fr(t)) = {x dom(t) : x is lef of t} nd fr(t)(x) = t(x) for ech lef x. loclly consistent tree t is derivtion tree of G if for ech infinite pth π of t the set inflels(π) elongs to the cceptnce condition F. Given symol X N Σ, we let (G, X) denote the set of ll complete derivtion trees t of G whose root symol t(ε) is X. We write G α for symol N Σ nd word α (N Σ) # if α is the frontier word of some derivtion tree of G hving root symol. The lnguge generted y G is L(G) = {w Σ # : G w}. lnguge L Σ # of Σ-words is Muller context-free lnguge, or MCFL for short, if L = L(G) for some MCFG G. n fct, Muller context-free lnguges re precisely the frontier lnguges of (nondeterministic Muller-)regulr lnguges of infinite trees. Exmple 1. f G = ({, }, Σ, P,, {{}}), with P = { : Σ} { ε,, }, then L(G) consists of ll the well-ordered words over Σ. ndeed, ssume t 1, t 2,... re derivtion trees. Then so is the tree t depicted in Figure 1 with frontier word fr(t 1 )fr(t 2 ).... Thus, L(G) contins the empty word (y ε), the words of length 1 (y nd ), nd is closed under tking ω-products. ince the lest clss of order types which contins 0, 1 nd which

6 354 Kitti Gelle nd zolcs ván t 1 t 2 t () Tree for Exmple 1 () Tree for Exmple 2 Figure 1: Derivtion trees corresponding to Exmples 1 nd 2 is closed under ω-sums is the clss of ll countle ordinls (see e.g. [23]), L(G) contins ll the well-ordered words over {, }. For the other direction, ssume t is derivtion tree hving frontier word contining n infinite descending chin... < l u 2 < l u 1. Then let us define the pth v 0, v 1,... in t: v 0 = ε nd v i+1 is v i 1 if this node is n ncestor of infinitely mny u j nd v i 2 otherwise (which hppens if v i corresponds to the production nd the node v i 1 (which is leled ) hs no descendnt of the form u j t ll). Note tht for ech u j there exists unique v ij such tht v ij is n ncestor of u j nd v ij+1 is not, since the length of the words v i grows without ound. Now these nodes v ij correspond to the production nd v ij+1 = v ij 1, so tht the successor of v ij long the pth is leled y. Hence v 0, v 1,..., is pth π in t such tht inflels(π) contins, which is contrdiction since the only ccepting set is {}. Exmple 2. f G = ({, }, Σ, P,, {{}}), with P = { : Σ} { ε,, }, then L(G) consists of ll the scttered words over Σ. ndeed, the derivtion tree depicted on Figure 1 shows tht L(G) is closed under ω + ( ω)-products of words. ince ε L(G), the lnguge is thus closed under ω-products nd ω-products s well, thus closed under ζ-products. ince the one-letter words elong to L(G), we get y Husdorff s Theorem tht L(G) consists of ll the scttered Σ-words. We note tht if insted of the Muller condition we define üchi-type cceptnce condition, then we get weker device: the resulting clss of üchi contextfree lnguges is strictly contined within the clss of MCFLs, see [11, 10]. 3 MO-definle properties re decidle The logic usully rising when deling with regulr structures is tht of mondic second-order logic, or MO. n [13] the following generl decidility theorem ws

7 Regulr Expressions for Muller Context-Free Lnguges 355 proved: Theorem 1. The following prolem is decidle: given n MCFG G generting Σ-words nd n MO formul ϕ evluted Σ-words, does it hold tht w = ϕ for every w L(G)? Thus in prticulr, it is decidle whether G genertes scttered, or wellordered, or dense words only. We sketch the outline of the proof. First, to ech MCFG G = (N, Σ, P,, F) we ssocite the grmmr G = (N P, Σ, P, ) where P contins the following set of productions: For ech nonterminl N, there is production ( α 1 )( α 2 )... ( α n ) in P where α 1,..., α n re the productions in P hving on their left-hnd side, in some fixed order. For ech production X 1... X n, there is production ( X 1... X n ) X 1... X n in P. Tht is, we cn rewrite nonterminl to the sequence of its lterntives, nd rewrite production to its right-hnd side. Thus, ech nonterminl of G hs exctly one lterntive (it is ssumed tht for ech nonterminl there is t lest one production hving left-hnd side ), thus there is exctly one loclly consistent tree of G hving root symol. We cll this unique tree t G the grmmr tree of G. Exmple 3. For the MCFG of Exmple 1, this tree t G is depicted in Figure 2. ε ε ε ε Figure 2: Grmmr tree of the MCFG of Exmple 1

8 356 Kitti Gelle nd zolcs ván The cruicl fct is tht the grmmr tree is regulr tree, hving finitely mny (more precisely, t most Σ + N + P ) sutrees. y [22], the MO theory of regulr tree is decidle, tht is, given regulr tree t (which is t G in our cse) nd n MO formul ψ, it is decidle whether t ψ holds. s t G cn e effectively constructed from G, it remins to construct formul ψ from G nd ϕ such tht t G ψ holds if nd only if for ech w L(G) we hve w ϕ. nformlly, the formul ψ constructed in [13] hs the semntics whenever T is derivtion tree of G, its frontier word stisfies ϕ. Now derivtion trees re encoded s susets of dom(t G ) s follows: suset X dom(t G ) encodes derivtion tree of G if the following conditions ll hold: X contins the root node. f some x X is leled y some nonterminl N, then exctly one child of x elongs to X. f some x X is leled y some production α, then ll the children of x elong to X. On ech infinite pth π X, the set of symols from N occurring infinitely mny times elongs to F. These properties cn e expressed in MO nd such set encodes derivtion tree in the ovious wy. Exmple 4. Figure 3 shows (prt of ) derivtion tree t of the grmmr of Exmple 1 nd the corresponding suset T of dom(t G ) (s nodes in oldfce). Then, given set X of nodes of t G, we cn define the suset Y X of the leves in X nd the lexicogrphic ordering over this Y is lso MO-definle. Hence the formul whenever X is suset of dom(t G ) encoding derivtion tree, nd Y is the set of leves within X, then the word corresponding to Y stisfies ϕ is expressile in MO (moreover, is effectively computle from G nd ϕ), thus proving Theorem 1. 4 norml form The generl decidility theorem of the previous section does not give us n exct complexity result s model checking MO is decidle, ut nonelementry in generl. n this section we give complexity results for severl decision prolems (nd severl undecidility results s well) regrding MCFLs, surveying the results of [11]. The decidle properties surveyed here re MO-definle, thus their decidility is immedite from Theorem 1. For exmple, L(G) is empty if nd only if every memer w of L(G) stisfies the flse formul. (On the other hnd, universlity is not definle this wy nd indeed, universlity of MFCGs is lredy undecidle for singleton lphets.) ( slightly modified vrint of) the norml form of MCFGs introduced in [11] is the following:

9 Regulr Expressions for Muller Context-Free Lnguges 357 ε ε ε ε Figure 3: prt of derivtion tree t of Exmple 1 nd the corresponding suset T of t G Definition 1. n MCFG G = (N, Σ, P,, F) is in norml form if either P is empty, or P consists of the single production ε, or for ech N there exists nonempty word w with G w nd words u, v with G uv. Moreover, to ech F F there exists pth π of some derivtion tree t with inflels(π) = F. n the terminology of [11], ech nonterminl hs to e +-productive nd rechle, nd ech ccepting set hs to e vile. uch norml form of ny MCFG is computle: Theorem 2 ([11]). For ny MFCG G, n equivlent MCFG G in norml form cn e computed in PPCE. The resulting grmmr G hs size polynomilly ounded y the size of G. We sketch the lgorithm here. The strightforwrd modifiction of the corresponding lgorithms for ordinry context-free grmmrs works: first we check for ech symol X whether X is productive (is there complete derivtion tree with root symol X t ll). However, the complexity of this prolem is PPCEcomplete due to the fct tht the emptiness prolem of Muller regulr tree lnguges, given y nondeterministic Muller tree utomton, is PPCE-complete. ince there is polynomil-time trnsformtion from n MCFG to corresponding Muller tree utomton nd vice vers, we gin PPCE-completeness for deciding productiveness of individul nonterminls, nd emptiness of MCFLs s well: Proposition 1. [11] Deciding whether L(G) = is PPCE-complete. Then, we cn throw wy ll the non-productive nonterminls nd get rid of ll the productions tht hve non-productive nonterminl on either of its sides.

10 358 Kitti Gelle nd zolcs ván fter tht, this set is further reduced to the set of rechle nonterminls, which cn e done y the usul fixed-point construction for CFGs, s for ech rechle nonterminl there is finite (not necessrily complete) derivtion tree with root symol nd occurring s lef lel. Then we cn throw wy ll the nonrechle nonterminls. This cn e done in polynomil time. n the next step, nonterminl genertes nonempty word if nd only if there is finite (not necessrily complete) derivtion tree rooted tht hs some letter Σ occurring s lef lel. This cn lso e decided in polynomil time y solving rechility prolem. Then, we cn simply erse ll the symols from the right-hnd sides from which only the empty word cn e generted (nd if the right-hnd side of rule ecomes empty, then erse the rule itself s well), rriving to grmmr in the required norml form, prt from viility of ech F F. (This wy we might lose the word ε from L(G) if we need the nonempty word, we cn llow the production ε to e present, ut in tht cse should not pper on the right-hnd side of ny rule, s in the clssicl cse.) The norml form cn e generted in PPCE. Then, L(G) contins nonempty word if nd only if there re still productions in G. Proposition 2 ([11]). t cn e decided in PPCE whether L(G) contins nonempty word. Now for retining only the vile ccepting sets, the following ssocited grph Γ G is hndy: Definition 2. Given n MCFG G = (N, Σ, P,, F), we define the following edgeleled multigrph Γ G : the vertices of Γ G re the nonterminls, nd there is n edge from to leled (α, β) for α, β (N Σ) if αβ is production of G. Now if G lredy contins only productive nd rechle nonterminls, then set F F is vile if nd only if the sugrph of Γ G induced y F is strongly connected, which is efficiently decidle, finishing the construction of the norml form. However, lnguge universlity (nd thus lnguge inclusion nd equivlence) is undecidle lredy for singleton lphets (contrry to the cse of context-free grmmrs, where undecidility holds only for lphets of size t lest two): Proposition 3 ([10]). t is undecidle whether L(G) = Σ # for n MCFG G, even when Σ is singleton lphet. n fct, the prolem is undecidle lredy for üchi context-free grmmrs. The key for proving this is reduction from the universlity prolem of context-free lnguges of finite words over the inry lphet {, }: first we encode y ω nd y ω. Then, the lnguge L of those words in # not elonging to { ω, ω } is MCFG nd thus, s MCFLs re effectively closed under homomorphisms nd finite unions, we get tht L(G) = {, } for the CFG G if nd only if L(G ) = # for some MCFG G effectively constructed from G.

11 Regulr Expressions for Muller Context-Free Lnguges Lnguges of finite words Given n MCFG G = (N, Σ, P,, F) in norml form, one cn decide in (low-degree) polynomil time whether L(G) consists of finite words only. (Note tht decidility is cler s the property of eing scttered is MO-definle.) The key oservtion here is tht L(G) contins n infinite word if nd only if there is some F F nd n edge α,β in Γ G with αβ ε nd, F which cn e verified efficiently. lso, it is quite strightforwrd to see tht lnguge L Σ is context-free if nd only if it is n MCFL: for one direction we only hve to set F =. For the other direction somewht more cre is needed since the frontier word of n infinite tree cn e empty. However, it cn e decided in PPCE whether G ε holds for nonterminl : we only hve to remove the productions from G hving some terminl symol occurring on the right-hnd side (tht is, we retin the productions of the form X α with α N ), nd pply n emptyness check for the generted lnguge. Then, for ech generting ε we cn include the production ε nd the resulting (clssicl) context-free grmmr will generte L(G) Σ if G is in norml form. Thus, Proposition 4 ([11]). lnguge L Σ is context-free if nd only if it is Muller context-free. lso, since emptiness of CFGs is efficiently decidle, we hve: Proposition 5 ([11]). t is decidle in PPCE whether n MCFG genertes t lest one finite word. 4.2 Lnguges of well-ordered words Given n MCFG G = (N, Σ, P,, F) in norml form, one cn decide in (lowdegree) polynomil time whether L(G) consists of well-ordered words only. gin, decidility itself is lredy cler, since the property is MO-definle. Proposition 6 ([11]). For n MFCG G in norml form, L(G) contins word which is not well-ordered if there is some set F F, nonterminls, F nd n edge α,β in Γ G with β ε. To see this, suppose there is derivtion tree t of G with frontier word not hving well-ordered domin. Then there exists n infinite descending chin... < x 3 < x 2 < x 1 < x 0 of leves of t. trting from the root, one cn then uild up n infinite pth π = y 0, y 1,... such tht for ech node u of π, n infinite numer of these leves x i re descendnts of u. (This property holds for the root, nd t ech step we set y i+1 to e the first child of y i which is n ncestor of some x j.) Then, s ech such lef x i hs some finite depth, there exists n y j for ech x i such tht y j is n ncestor of x i ut y j+1 is not; it is esy to see tht in this cse x i is on the right side of π.

12 360 Kitti Gelle nd zolcs ván Hence, for this π it holds tht F = inflels(π) is contined within nontrivil strongly connected component of Γ G, moreover, there is n edge α,β with, F nd β ε, the other direction eing lso strightforwrd, simply y following closed pth in F visiting ech edge t lest once, iterting ω times nd complete the resulting derivtion tree (which lredy hs n infinite descending chin mong its leves due to β ε). Now if L(G) contins well-ordered words only, one cn compute n intervl of ordinls contining ll the order types of L(G): Proposition 7 ([16]). f the MCFG G genertes well-ordered words only, then oth the minimum nd the supremum of the order types of the memers of L(G) re effectively computle ordinls. For the minimum, first we note tht to ech nonterminl, if there is finite word w with G w, then the length n of the shortest such word is computle. Then we cn replce ech occurrence of these nonterminls y n : the minimum order types for the nonterminls in the resulting grmmr will coincide with those of G. Let us fix for ech symol X complete derivtion tree t X with root symol X, minimizing the order type of fr(t X ). t turns out tht the memers of N cn e prtilly ordered y some properties of these trees t X nd tht these trees t X cn e chosen in wy tht ech sutree of t X is some t Y for Y N Σ. The key construction to see this is the following. When t is complete derivtion tree of such n MCFG G, then we cll t simple if it is either finite or hs some infinite pth π with inflels(π) = lels(π) nd moreover, ech production corresponding to the nodes of π occur infinitely mny times on π. s uv P for some, F F implies v = ε, this pth π hs to e the rightmost pth of t. Then, the order type of fr(t) is the ω-sum of the order types of the frontiers of the sutrees of t eing djcent to π (tht is, rooted t some node x not on π whose prent is on π). s ech left-hnd side occurs infinitely mny times, we get tht ech nonterminl djcent to π hs strictly smller minimum. Thus, if t X is simple, then we cn define t X fter eing defined ech t Y where the minimum order type of Y is strictly smller thn tht of X, nd the order type of its frontier is computle. Now if t X is not simple, then the order type of its frontier is the sum of the order types corresponding to its direct children. Now ll these order types ut the lst hve to e smller then the order type of fr(t X ) nd the lst child hs to hve one level closer for eing simple (nd this level is finite), estlishing the inductive cse. Thus, stndrd itertive lgorithm recomputing the minim from the current estimtions eventully termintes nd produces the minimum ordinls (in Cntor norml form, sy). For the supremum, the cse nlysis is slightly more involved. First, one seeks for reproductive nonterminls: is clled reproductive if G α for some α in which occurs infinite times. t turns out tht is reproductive if nd only if there is production X 1... X n nd n ccepting set F F with, F nd X i G uv for some i [n] nd u, v Σ, which is decidle.

13 Regulr Expressions for Muller Context-Free Lnguges 361 Then, if is reproductive, then it is esy to see tht ritrrily lrge countle ordinls cn e generted from, thus in tht cse, the supremum in question is ω 1, the smllest uncountle ordinl. lso, if G uv for some reproductive nonterminl, then the sme holds for s well. Otherwse, to ech production of the ove form, the nonterminls X i elong to strongly connected component strictly elow the component of, gin setting strightforwrd induction rgument: the reder is referred to [16] for the technicl detils. s ω-lnguges re lso well-ordered, we note tht nd lnguge of ω-words is context-free in the sense of Cohen nd Gold [8] if nd only if it is n MCFL [11], nd moreover, it is decidle whether n MCFG genertes only well-ordered words hving order type t most ω. 4.3 Lnguges of scttered words nlogously for the cse of well-ordered words, it is decidle whether n MCFG G genertes scttered words only, s this property is lso MO-definle. Proposition 8 ([11]). t is decidle in polynomil time whether n MCFG G in norml form genertes scttered words only. The key oservtion is the following: L(G) contins qusi-dense word if nd only if there exists finite derivtion tree t, two leves x nd y of t nd vile ccepting set F F such tht lels(π x ) = lels(π y ) = F nd t(x) = t(y) = t(ε) where π x nd π y respectively denote the pths from the root to x nd y. s this property is further equivlent to the existence of some production αβcγ with,, C F for vile F F, we hve n efficient decision procedure. For lnguges of scttered words, the min ingredient of mny proofs is tht of the Husdorff-rnk. siclly, given derivtion tree t, we cn tg ech node x of t y the rnk of fr(t x ). Then, consider the suset D of the nodes tgged y the sme ordinl s the root. s n infinite sum of scttered orderings of the sme rnk α hs rnk strictly greter thn α, this suset D cnnot contin n infinite ntichin, yielding tht D is finite union of pths. Then, one cn prtilly order the set of derivtion trees primrily y the rnk of their frontier, secondry y the numer of pths covering their respective sets D, nd third, y the depth of the first node of D hving t lest two children in D. The defined ordering ecomes then well-ordering of the derivtion trees, llowing us to pply well-founded induction. The first such ppliction is the following gp theorem of MCFLs of scttered words: Proposition 9 ([11]). The supremum of the Husdorff-rnk of the memers of L(G) is computle when G genertes scttered words only. Moreover, this supremum is either ω 1 or some nturl numer. The key oservtion for this result is gin tht reproductive nonterminls, nd only those, cn produce words of ritrrily lrge (countle) rnk, nd for the others, simple induction works over the strongly connected components of Γ G.

14 362 Kitti Gelle nd zolcs ván nterestingly, it is lso known [14] tht n MCFL consisting only of sctterred words is CFL if nd only if the second cse pplies, i.e. if it hs finite upper ound n on the Husdorff-rnk of its memers. n order to define the regulr expression-like expressions cpturing these MCFLs, we will lso consider pirs of words over n lphet Σ, equipped with finite conctention nd n ω-product opertion. For pirs (u, v), (u, v ) in Σ # Σ #, we define the product (u, v) (u, v ) to e the pir (uu, v v), nd when for ech i ω, (u i, v i ) is in Σ # Σ #, then we let (u i, v i ) e the word ( )( ) u i v i. Let i ω i ω i ω P (Σ # Σ # ) denote the set of ll susets of Σ # Σ #. Then P (Σ # Σ # ) is equipped with the opertions of set union, conctention L L = {(u, v) (u, v ) : (u, v) L, (u, v ) L } nd Kleene str L = {ɛ} L L 2. We lso define n ω-power opertion P (Σ # Σ # ) P (Σ # ) y L ω consisting of the words of the form (u i, v i ) with (u i, v i ) L for ech i ω. i ω The motivtion ehind this notion is the following. f t is derivtion tree with distinguished lef x leled y some nonterminl, nd frontier word fr(t) = uv, then this frontier word is represented y the pir (u, v). Now if we sustitute tree s with root symol in plce of the distinguished lef, hving frontier word fr(s) = u v, yielding the tree t, then we hve fr(t ) = uu v v which is (u, v) (u, v ) ccording to the product opertion we defined on pirs. imilrly, if the root of t is lso leled, then we cn iterte sustituting t in plce of the distinguished lef: if we iterte finite numer of times, then the Kleene str contins the pir representnt of the resulting tree; if we iterte ω times, then the frontier is u ω v ω = (u, v) ω. Then, let the set of µωt s -expressions over the lphet Σ e defined y the following grmmr (with T eing the initil nonterminl): T ::= ε x T + T T T µx.t P ω P ::= T T P + P P P P Here, Σ nd x X for n infinite countle set of vriles. n occurrence of vrile is free if it is not in the scope of µ-opertion, nd ound, if it is not free. closed expression does not hve free vrile occurrences. The semntics of these expressions re defined s expected using the monotone functions over P (Σ # ) nd P (Σ # Σ # ) introduced erlier. The chrcteriztion theorem of [12] sttes tht these notions correspond to ech other: Theorem 3 ([12]). lnguge L is n MCFL of scttered words if nd only if it cn e denoted y some closed µωt s -expression. The direction tht such expressions lwys denote MCFLs is done y strightforwrd construction, while the converse direction is gin done vi the wellordering of the derivtion trees we introduced erlier.

15 Regulr Expressions for Muller Context-Free Lnguges Opertionl chrcteriztion of generl MCFLs n this section we give n opertionl chrcteriztion of MCFLs in generl, using the opertionl chrcteriztion of Muller regulr lnguges of infinite trees given in [18, 20] which we reproved using slightly different methods in [15]. There, we introduced for ech rnked lphet Σ (tht is, ech symol Σ hs some rity n 0; the set of n-ry symols of Σ is denoted Σ n ) the set of µηregulr tree expressions (tree expressions for short) over Σ s the lest set stisfying ll the following conditions: f Σ n, n 0 nd E 1,..., E n re tree expressions over Σ, then (E 1,..., E n ) is tree expression over Σ. When n = 0, we write in plce of (). f E nd F re tree expressions over Σ, then so is (E + F ). f E is tree expression over Σ {x} for the nullry symol x, nd F is tree expression over, then (E x F ) is tree expression over Σ. f E is tree expression over Σ {x} for the nullry symol x, then (µx.e) nd (ηx.e) re tree expressions over Σ. n order to define the semntics of these expressions, we hve to define the opertions of x-product, µx nd ηx on tree lnguges, for which we use cuts nd decompositions of trees. o let Σ e n lphet nd let Σ stnd for the disjoint copy {â : Σ} of Σ. The htted symols re of rity zero. Given tree t, nd suset X dom(t) of its nodes, the X-cut of t is the following Σ Σ-tree t/x: node x elongs to dom(t/x) if nd only if x is node of t which is not proper descendnt of ny non-root memer of X, i.e. dom(t/x) = dom(t) {y u X {ε} dom(t) : u y}. The leling of t/x is defined s follows: for node x dom(t/x) let (t/x)(x) e t(x) if x / X {ε} nd t(x) if x X {ε}. Tht is, we cut the tree t the nodes of X nd dd ht to the symols occurring t the cut-points. Exmple 5. Figure 4 shows tree t with frontier ω ω. Choosing the set X to contin ll the inner nodes of t, ll the trees of the form (t x )/(X x ) re the sme (shown on the right hnd side of the Figure). Figure 5 shows (finite) tree t which gets decomposed into set of six trees. Now when K is lnguge of Σ Σ-trees nd L is lnguge of -trees for some lphets Σ nd, then K[ Σ/L] is the following lnguge of Σ -trees: tree t elongs to K[ Σ/L] if there exists some suset X dom(t) such tht t/x elongs to K nd for ech x X, t x elongs to L. (Usully is either Σ or Σ Σ). Tht is, if we cn cut t such tht the retined prt of the tree elongs to K nd ll the sutrees tht re cut down elong to L. Oserve tht if there exists such n X, then the suset X of -miniml elements of X is lso fine (s t/x = t/x then, nd the condition for the sutrees is lso vlid), thus in tht cse we cn ssume tht t is cut y some ntichin of its nodes.

16 364 Kitti Gelle nd zolcs ván  Figure 4: tree nd t one of its possile decompositions. Given tree lnguge L over Σ Σ, the function K L[ Σ/K] is monotone function (with respect to lnguge inclusion), which mps the poset of Σ Σ-tree lnguges to itself, thus it hs lest fixed point tht cn e reched y the Kleene itertion L 0 =, L α = L[ Σ/L β ] for successor ordinls α = β + 1 nd L α = L β β<α for limit ordinls α, tht is, there exists some (lest) ordinl α such tht L α is the lest fixed point of this function. This lest fixed point is denoted L µ nd is Σ-tree lnguge. t is reltively esy to show tht Σ-tree t elongs to L µ if nd only if there is some suset X t of its nodes such tht there is no infinite chin x 1 x 2... in X nd for ech x X, the tree (t x )/(X x ) elongs to L. The lst opertion on trees is the η-product. Given Σ Σ-tree lnguge L, the lnguge L η is lnguge of Σ-trees: tree t elongs to L η if nd only if there is some X dom(t) of its nodes such tht for ech x X, the tree (t x )/(X x ) elongs to L. Tht is, now n ritrry set of cut-points in the domin. Now if L is lnguge of Σ {x}-trees for nullry symol x, then µx.l nd ηx.l re the tree lnguges L µ nd L η where L is the following lnguge of Σ Σtrees: tree t elongs to L if nd only if its projection defined y, â x elongs to L. Tht is, the Σ {x}-tree t we get from t y releling ech htted symol to x. imilrly, if K is lnguge of Σ {x}-trees nd L is some -tree lnguge, then let K x L e the lnguge K[ Σ/L]. Exmple 6. When K consists of the tree single tree (x, Â), then Kη contins single tree with root symol nd frontier x ω. Then, K η x {Â} contins single tree with root symol nd frontier Âω. Finlly, the frontier lnguge of (K η x {Â} {(), (Â, Â)})µ contins ll the nonempty well-ordered words over the singleton lphet {}. fter these definitions we re redy to define the semntics of tree expressions in the expected wy. tree expression E denotes tree lnguge E, set of Σ-trees defined s follows:

17 Regulr Expressions for Muller Context-Free Lnguges 365 Â Â Figure 5: decomposition of finite tree. (E 1,..., E n ) consists of those Σ-trees t whose root symol is leled, the root hve exctly the children 1,..., n nd for ech i [n], t i E i. (E+F ) = E F, E xf = E x F, µx.e = µx. E nd ηx.e = ηx. E. Now using the terms of [15], tree lnguge is Muller-regulr if nd only if it cn e denoted y some µη-regulr tree expression. Hence it is esy to derive µη-regulr word expressions for MCFLs s MCFLs re exctly the frontier lnguges of Mullerregulr tree lnguges. For this, we hve to define opertions corresponding to the x, µx nd ηx-opertions ove. nformlly, for x we cn define the sustitution opertion: K[x/L] contins those words we get from memers of K in which we replce ech occurrence of x y some word in L; then, µx.l is the lest fixed point of the monotone function X L[x/X]; nd, memers of ηx.l re the Σ-words which we get y strting from the word x, then replcing ech occurrence of x y some memer of L, nd repet this process the words occurring s limits of this (possily infinite) replcement sequence re memers of ηx.l. To tret the cse of ηx.l formlly, we introduce the clss of generlized Σ-trees s follows. generlized tree domin is modified tree domin where we do not restrict the set of children of ny node to e finite linerly ordered set, ut llow

18 366 Kitti Gelle nd zolcs ván x x x Figure 6: n L-x-sustitution tree. ritrry countle liner orders. Nevertheless, ech node hs to hve finite depth. More formlly, given prtilly ordered set P = (P, <), P -tree domin is suset D of P stisfying the following conditions: D is nonempty nd prefix-closed. For ech node d D, the set {p P : d p D} of the children of d is linerly ordered suset of P. When n lphet Σ is lso given, then P -Σ-tree is mpping t : dom(t) Σ from P -tree domin to Σ, tht is, Σ-leled P -tree domin nd the frontier word of t is the Σ-word fr(t) whose domin is the set of the leves of t (those nodes hving no children) equipped with the lexicogrphic ordering: p 1... p n < l p 1... p m if nd only if for some i m, n we hve p i < p i nd for ech j < i, p j = p j. Oserve tht this ordering is totl on the leves since for two different leves u = p 1... p n nd v = p 1... p m neither of them cn e prefix of the other, hence there exists unique lest index i m, n with p i p i ; nd s the set of the children of the node p 1... p i 1 is linerly ordered, it hs to e either the cse p i < p i or p i < p i. Oserve lso tht if ech node hs countle children set, the fr(t) is countle word. Given lnguge L ( Σ {x} ) #, we define the lnguges µx.l nd ηx.l over Σ s follows. Let P = dom(u) e the disjoint union of the domins of u L ll the words elonging to L. Then, n L-x-sustitition tree is P - ( Σ {x} ) -tree stisfying the following conditions: the root is not lef node, ech inner node is leled y x, ech lef node is leled in Σ nd for ech inner node u, the word formed y the lels of the children of u elongs to L. Exmple 7. Figure 6 depicts n L-x-sustitution tree where L is the lnguge { ω, (x) ω }. Then, let ηx.l contin the frontier words of the L-x-sustitution trees, nd let µx.l contin the frontier words of those L-x-sustitution trees hving no infinite pths. Exmple 8. Figure 7 depicts n L-x-sustitution tree for L = {x}. This tree shows tht ω ω is memer of ηx.l (ut does not, in fct, elong to µx.l s

19 Regulr Expressions for Muller Context-Free Lnguges 367 x x x x Figure 7: The word ω ω elongs to ηx.{x}. it hs n infinite pth. For this lnguge, µx.l =. n contrst, µx.{x, c} is { n c n : n 0} nd ηx.{x, c} is µx.{x, c} { ω ω }.) These opertions µ nd η on lnguges over words correspond to the opertions µ nd η on tree lnguges in the sense fr(µx.l) = µx.fr(l) nd fr(ηx.l) = ηx.fr(l) for ech tree lnguge L. We lso mke use of the x product opertion: when K (Σ {x}) # nd L # for the lphets Σ nd, then K x L (Σ ) # contins those words one cn get from word u in K y replcing ech occurrence of x in u y some memer of L. Or more techniclly, the frontier words of those (K L)-x-sustitution trees of depth t most two in which the word formed y the children of the root symol elongs to K nd ech word formed y the children of the depth-one inner nodes elongs to L. n prticulr, the tree depicted in Figure 6 shows its frontier ( ω ) ω elongs to (x) ω x ω. Then lso, fr(k x L) = fr(k) x fr(l) for ritrry tree lnguges K nd L. y the chrcteriztion of Muller regulr tree lnguges we get the following chrcteriztion: Theorem 4. lnguge L Σ # is n MCFL if nd only if it cn e generted from the singleton lnguges of one-letter words y finite numer of conctention, inry union, x-product, µx nd ηx-opertions. References [1] edon, Nicols. Finite utomt nd ordinls. Theor. Comput. ci., 156(1 2): , [2] edon, Nicols, ès, lexis, Crton, Olivier, nd Rispl, Chloé. Logic nd Rtionl Lnguges of Words ndexed y Liner Orderings, pges pringer erlin Heidelerg, erlin, Heidelerg, 2008.

20 368 Kitti Gelle nd zolcs ván [3] osson, Luc. Context-free sets of infinite words. n Weihruch, Klus, editor, Theoreticl Computer cience, volume 67 of Lecture Notes in Computer cience, pges 1 9. pringer, [4] ruyère, Véronique nd Crton, Olivier. utomt on liner orderings. J. Comput. yst. ci., 73(1):1 24, [5] ès, lexis nd Crton, Olivier. Kleene theorem for lnguges of words indexed y liner orderings. n de Felice, Cleli nd Restivo, ntonio, editors, Developments in Lnguge Theory, volume 3572 of Lecture Notes in Computer cience, pges pringer, [6] üchi, J. Richrd. The mondic second order theory of ω1, pges pringer erlin Heidelerg, erlin, Heidelerg, [7] Chouek, Ycov. Finite utomt, definle sets, nd regulr expressions over ω n -tpes. Journl of Computer nd ystem ciences, 17(1):81 97, [8] Cohen, Rin. nd Gold, rie Y. Theory of ω-lnguges.. Chrcteriztions of ω-context-free lnguges. J. Comput. yst. ci., 15(2): , [9] Courcelle, runo. Frontiers of infinite trees. T, 12(4), [10] Ésik, Zoltán nd ván, zolcs. üchi context-free lnguges. Theor. Comput. ci., 412(8-10): , [11] Ésik, Zoltán nd ván, zolcs. On Müller context-free grmmrs. Theor. Comput. ci., 416:17 32, [12] Ésik, Zoltán nd ván, zolcs. Opertionl chrcteriztion of scttered MCFLs. n él, Mrie-Pierre nd Crton, Olivier, editors, Developments in Lnguge Theory - 17th nterntionl Conference, DLT 2013, Mrne-l- Vllée, Frnce, June 18-21, Proceedings, volume 7907 of Lecture Notes in Computer cience, pges pringer, [13] Ésik, Zoltán nd ván, zolcs. MO-definle properties of Muller contextfree lnguges re decidle. n Câmpenu, Cezr, Mne, Florin, nd hllit, Jeffrey, editors, Descriptionl Complexity of Forml ystems - 18th FP WG 1.2 nterntionl Conference, DCF 2016, uchrest, Romni, July 5-8, Proceedings, volume 9777 of Lecture Notes in Computer cience, pges pringer, [14] Ésik, Zoltán nd Okw, toshi. On context-free lnguges of scttered words. n Yen, Hsu-Chun nd rr, Oscr H., editors, Developments in Lnguge Theory - 16th nterntionl Conference, DLT 2012, Tipei, Tiwn, ugust 14-17, Proceedings, volume 7410 of Lecture Notes in Computer cience, pges pringer, [15] Gelle, Kitti nd ván, zolcs. Expressions for regulr lnguges of infinite trees. Mnuscript, 2017.

21 Regulr Expressions for Muller Context-Free Lnguges 369 [16] ván, zolcs nd Mészáros, Ágnes. Müller context-free grmmrs generting well-ordered words. n Dömösi, Pál nd ván, zolcs, editors, utomt nd Forml Lnguges, 13th nterntionl Conference, FL 2011, Derecen, Hungry, ugust 17-22, 2011, Proceedings., pges , [17] Khoussinov, khdyr, Ruin, sh, nd tephn, Frnk. utomtic liner orders nd trees. CM Trns. Comput. Logic, 6(4): , Octoer [18] Mostowski, ndrzej Wlodzimierz. Regulr expressions for infinite trees nd stndrd form of utomt. n ymposium on Computtion Theory, pges , [19] Nivt, Murice. ur les ensemles de mots infins engendrés pr une grmmire lgérique. T, 12(3), [20] Niwinski, Dmin. Fixed points vs. infinite genertion. n Proceedings of the Third nnul EEE ymposium on Logic in Computer cience (LC 1988), pges EEE Computer ociety Press, July [21] Perrin, Dominique nd Pin, Jen-Éric. nfinite words: utomt, semigroups, logic nd gmes, [22] Rin, Michel O. Decidility of second-order theories nd utomt on infinite trees. ull. mer. Mth. oc., 74(5): , [23] Rosenstein, Joseph G. Liner orderings. cdemic Press New York, [24] Wojciechowski, Jerzy. Clsses of trnsfinite sequences ccepted y finite utomt. Fundment nformtice, 7: , [25] Wojciechowski, Jerzy. Finite utomt on trnsfinite sequences nd regulr expressions. Fundment nformtice, 8: , 1985.

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

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

p-adic Egyptian Fractions

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

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

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

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA

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

More information

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

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

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

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

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

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

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

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

More information

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

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

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

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

TREE AUTOMATA AND TREE GRAMMARS

TREE AUTOMATA AND TREE GRAMMARS TREE AUTOMATA AND TREE GRAMMARS rxiv:1510.02036v1 [cs.fl] 7 Oct 2015 by Joost Engelfriet DAIMI FN-10 April 1975 Institute of Mthemtics, University of Arhus DEPARTMENT OF COMPUTER SCIENCE Ny Munkegde, 8000

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

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

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

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

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

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

The size of subsequence automaton

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

More information

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

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v. 1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings,

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

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

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

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

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

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

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

I. Theory of Automata II. Theory of Formal Languages III. Theory of Turing Machines

I. Theory of Automata II. Theory of Formal Languages III. Theory of Turing Machines CI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 16: Non-Context-Free Lnguges Chpter 16: Non-Context-Free Lnguges I. Theory of utomt II. Theory of Forml Lnguges III. Theory of Turing Mchines

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

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

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

More information

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

FABER Formal Languages, Automata and Models of Computation

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

More information

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

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

More information

CS 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

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

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

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

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

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

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

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

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

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

Review of Gaussian Quadrature method

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

More information

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

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

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

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

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

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch. Overview H9 Vertlerouw H 9: Prsing: op-down & LL(1) do 3 mei 2001 56 heo Ruys h. 8 - Prsing 8.1 ontext-free Grmmrs 8.2 op-down Prsing 8.3 LL(1) Grmmrs See lso [ho, Sethi & Ullmn 1986] for more thorough

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

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

Exercises with (Some) Solutions

Exercises with (Some) Solutions Exercises with (Some) Solutions Techer: Luc Tesei Mster of Science in Computer Science - University of Cmerino Contents 1 Strong Bisimultion nd HML 2 2 Wek Bisimultion 31 3 Complete Lttices nd Fix Points

More information

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

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

More information

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

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

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

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

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

Separating Regular Languages with First-Order Logic

Separating Regular Languages with First-Order Logic Seprting Regulr Lnguges with First-Order Logic Thoms Plce Mrc Zeitoun LBRI, Bordeux University, Frnce firstnme.lstnme@lri.fr Astrct Given two lnguges, seprtor is third lnguge tht contins the first one

More information

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

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

More information

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

MTH 505: Number Theory Spring 2017

MTH 505: Number Theory Spring 2017 MTH 505: Numer Theory Spring 207 Homework 2 Drew Armstrong The Froenius Coin Prolem. Consider the eqution x ` y c where,, c, x, y re nturl numers. We cn think of $ nd $ s two denomintions of coins nd $c

More information

Symbolic enumeration methods for unlabelled structures

Symbolic enumeration methods for unlabelled structures Go & Šjn, Comintoril Enumertion Notes 4 Symolic enumertion methods for unlelled structures Definition A comintoril clss is finite or denumerle set on which size function is defined, stisfying the following

More information

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir CSCI 2400 Models of Computtion, Section 3 Solutions to Homework 4 Problem 1. ll the solutions below refer to the Pumping Lemm of Theorem 4.8, pge 119. () L = f n b l k : k n + lg Let's ssume for contrdiction

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