Postprint.

Size: px
Start display at page:

Download "Postprint."

Transcription

1 Postprint This is the ccepted version of pper presented t Eighth Workshop on Non-Clssicl Models of utomt nd pplictions(ncm 2016). Cittion for the originl pulished pper: ensch, S., Kutri, M., Mlcher,. (2016) Extended Uniformly Limited T0L Lnguges nd Mild Context-Sensitivity. In: Henning ordihn, Rudolf Freund, enedek Ngy, nd yörgy Vszil (ed.), Eight Workshop on Non-Clssicl Models of utomt nd pplictions (NCM 2016): Short Ppers (pp ). Wien: Institut für Computersprchen N.. When citing this work, cite the originl pulished pper. Permnent link to this version:

2 EXTENDED UNIFORMLY LIMITED T0L LNUES ND MILD CONTEXT-SENSITIVITY Sun ensch () Mrtin Kutri () ndres Mlcher () () Deprtment of Computing Science, Umeå University, Umeå, Sweden () Institut für Informtik, Universität iessen, rndtstr. 2, iessen, ermny strct We study the fixed memership prolem for k-uniformly-limited nd propgting ET0L systems (kulept0l systems). To this end, the lgorithm given in [7] is pplied. It follows tht kulept0l lnguges re prsle in polynomil time. Since kulept0l lnguges re semiliner [1] nd kulept0l systems generte certin non-context-free lnguges, which cpture the non-context-free phenomen occurring in nturl lnguges, this is the lst uilding lock to show tht kulept0l lnguges, for k 2, elong to the fmily of mildly context-sensitive lnguges. 1. Introduction Context-free lnguges re prsle in polynomil time nd there re severl memership lgorithms sed on the concept of dynmic progrmming for context-free lnguges [6, 15]. For context-sensitive lnguges, on the other hnd, there re no known polynomil time lgorithms for the memership prolem. Extended Lindenmyer systems without interction (E0L systems) cn e considered s prllel counterprts of context-free grmmrs nd E0L lnguges re known to e prsle in polynomil time s well [10]. However, for ET0L lnguges, tht is, lnguges generted y tled E0L systems, the memership complexity is NP-complete [12]. Reserch hs studied mny lnguge fmilies tht lie etween context-free (or E0L) nd context-sensitive (or ET0L), (see, for instnce [4]). In [7], for exmple, the uthors study the memership complexity for context-free lnguges generted y context-free grmmrs which re extended so tht context-free productions re pplied to fixed numer k of symols t ech derivtion step. The uthors use results from scheduling theory nd dynmic progrmming to

3 2 Sun ensch, Mrtin Kutri, ndres Mlcher show tht the memership for these extended context-free lnguges is decidle in polynomil time. The uthors in [14], for instnce, introduced restricted version of ET0L systems, nmely k-uniformly-limited ET0L systems (revited kulet0l systems). In these systems the prllel rewriting mechnism of Lindenmyer systems is limited such tht not ll symols in word w hve to e rewritten, ut min{k, w } symols, where k is positive integer. Note tht, if k = 1, we hve context-free grmmr (see [14]). The crucil differences etween these two grmmr formlisms re, tht (i) the extended context-free grmmrs in [7] re extended with respect to their sequentil rewriting mechnisms (tht is, from rewriting one symol to rewriting k symols) nd kulet0l systems re limited with respect tht their prllel sustitution mechnisms (tht is, from sustituting ll symols to sustituting k symols), nd (ii) in [7] the lengths of ll sententil forms (fter rewriting the strt symol) re t lest k. In mthemticl linguistics, reserchers lso hve een investigting lnguge fmilies tht lie etween the context-free lnguge fmily nd the context-sensitive lnguge fmily in the Chomsky hierrchy. concept tht cptures such lnguge fmilies is mild context-sensitivity. The notion of mild context-sensitivity ws first mentioned in [8], where the uthor proposed tht clss of grmmrs (nd their ssocited lnguges) modeling the syntx of nturl lnguges should hve the following three chrcteristics. First, it should descrie certin non-context-free structures in order to cpture the non-context-free phenomen occurring in nturl lnguges. Second, it should hve the constnt growth property (the constnt growth property is oeyed y every semiliner lnguge) nd, third, it should e prsle in polynomil time. Note, tht the concept mildly context-sensitive cptures fmily of fmilies of lnguges, not single lnguge fmily. For forml definition of mildly context-sensitive grmmr formlisms see [2]. In the literture there hve een mny investigtions of mildly context-sensitive sequentil grmmr formlisms nd their lnguges (see, for instnce, [9, 13]). There hve een less investigtions of mildly context-sensitive prllel grmmr formlisms. In [1] the uthor investigtes some restricted versions of limited prllel Lindenmyer systems with respect to their mild contextsensitivity. In this pper, we pply the fixed memership lgorithm given in [7] to propgting kulet0l lnguges (revited kulept0l lnguges). It follows tht kulept0l lnguges re prsle in polynomil time. Moreover, it is known tht kulept0l lnguges re semiliner [1]. dditionlly, kulept0l systems generte non-context-free lnguges, such s { n n c n n 1 }, { n m c n d m n, m 1 }, nd { ww w {, } + }, which cpture the non-context-free phenomen occurring in nturl lnguges. From ll this, we conclude tht kulept0l lnguges, for k 2, elong to the fmily of mildly context-sensitive lnguges. 2. Definition nd Preliminries We ssume the reder to e fmilir with the sic notions of Lindenmyer systems without interction such s in [11]. In generl we hve the following conventions: The set of positive integers is denoted y N nd if we wnt to include 0, we write N 0. The crdinlity of set is denoted y #. Let V = { 1, 2,..., n } e some lphet, where the order of the symols

4 Extended kulpt0l Lnguges nd Mild Context-Sensitivity 3 is fix. y V + we denote the set of nonempty words; if the empty word λ is included, then we use the nottion V. The length of word w in V is the numer of letters in w nd written s w. The length of the empty word λ is 0. n ET0L system is qudruple = (Σ, H, ψ, ), where Σ is n lphet, ψ Σ is the xiom, Σ is the terminl lphet, nd H is finite set of finite sustitutions from Σ into Σ. sustitution h in H is clled tle. For x in Σ we write x y if y h(x). y Mxr() we denote the length of the longest right-hnd side of production in. In generl, we write u w if nd only if w h(u), for u nd w in Σ nd some h in H. If the tle should e noted explicitly, we write u w. The reflexive trnsitive closure of the derivtion reltion h is denoted y. The lnguge generted y is L() = { w ψ w }. n ET0L system is clled propgting (EPT0L system, for short) if for ll sustitutions h in H nd ll x Σ, we hve λ / h(x). In derivtion of kulet0l system t ech step of the rewriting process exctly min{k, w } symols of the word w considered hve to e rewritten. Tht is, if w < k then ll symols hve to e rewritten, ut if w k then there re ( ) w k possiilities to rewrite the word w. Formlly, k-uniformly-limited ET0L system (kulet0l system, for short) ([14]) is quintuple = (Σ, H, ψ,, k), where k N nd (Σ, H, ψ, ) is n ET0L system. The derivtion reltion h H. of kulet0l system is defined s follows. Let u, w Σ nd 1. If u k then u w if we cn write u = v 1 x 1 v 2 x 2 x k v k+1 nd w = v 1 z 1 v 2 z 2 z k v k+1 with x i Σ, v j Σ, z i h(x i ), i = 1,..., k, j = 1,..., k If u < k then u w if w h(u). sententil form of kulet0l system = (Σ, H, ψ,, k) is word w Σ with ψ w. propgting kulet0l (kulept0l, for short) is defined the sme wy s for ET0L systems. The uthors in [14] introduced the notion of pseudo-synchroniztion for kulet0l grmmrs. kulet0l system is clled pseudo-synchronized if for every nd for every w Σ the following holds: if w then w / ; tht is, there re no productions of the form w, for nd w. Theorem 2.1 ([14], Theorem 3.1) To every kule(p)t0l system = (Σ, H, ψ,, k), there exists n equivlent pseudo-synchronized kule(p)t0l system = (Σ, H, S,, k) such tht L() = L( ).

5 4 Sun ensch, Mrtin Kutri, ndres Mlcher In the following we ssume kulept0l system to e pseudo-synchronized without explicitly mentioning. The reder is ssumed to e fmilir with the sic notions of trees, forests, root, prent, child, ncestor, descendnt, internl node nd lef. Let v e node. The depth of v is its distnce from the root of its tree, plus 1. The height of v is the distnce to its furthest descendnt. Leves hve height zero nd roots hve depth one. Let F e forest. The height of F is the mximl height of its roots. y F we denote the numer of nodes in F nd y #F we denote the numer of trees in F. The re forest of F is otined y deleting ll leves in F ; the re forest of F is denoted y re(f ). The child forest of F is otined y deleting ll roots from F. To ech derivtion of kulept0l system one cn ssocite derivtion tree t in similr fshion s it is done for context-free grmmrs. Moreover, if node is leled with symol Σ, nd the lel of its children (from left to right) form the word w, then w is production in tle of the kulept0l system. derivtion forest is forest contining tree for ech symol of the xiom. The roots of the trees re leled y these symols. We illustrte some of these notions y the following exmple. Exmple 2.2 (derivtion forest) Let = (Σ, H, ψ,, k) e the kulept0l system with Σ = {,,, }, = {, }, ψ =, k = 3, H = {h 1, h 2 }, where the set of tles is given y h 1 = {,,, }, h 2 = {,,, }. Consider the following derivtion, in which we mrk the symols which re rewritten with dot. Tle h 1 is used in the first two derivtion steps nd then Tle h 2 is pplied to terminte the derivtion: ȦḂ ȦḂ ḂḂ Ȧ ȧḃḃ. The derivtion forest for is illustrted in Figure 1. Figure 1: Derivtion forest of derived y the kulept0l system given in Exmple 2.2.

6 Extended kulpt0l Lnguges nd Mild Context-Sensitivity 5 In the following we will divide the derivtions of kulept0l system into two phses. The sententil forms w in derivtion of kulept0l cn e divided into phse in which ech w < k nd into the phse in which ech w k. In the first phse ll symols hve to e rewritten nd in the second phse exctly k symols hve to e rewritten. The derivtion steps in the first phse correspond to derivtion steps in n EPT0L derivtion nd the second phse is clled k-derivtion of kulept0l system. Note tht in propgting kulet0l the lengths of the sententil forms do not decrese. In the following we define k-derivtion of kulept0l system nd its k-derivtion forest. Definition 2.3 (k-derivtion forest) Let = (Σ, H, ψ,, k) e kulept0l system. k- derivtion in is sequence of words w 1,..., w l+1, such tht, for ll 1 i l, w i w i+1 nd w i k, 1 i l + 1. The length of the derivtion w 1,..., w l+1 is l nd the ith step is w i w i+1. k-derivtion forest is derivtion forest tht corresponds to k-derivtion. Exmple 2.4 (k-derivtion forest) Note tht the derivtion forest given in Exmple 2.2 is not k-derivtion forest, since ψ < k. Figure 2 illustrtes k-derivtion forest for the k- derivtion Ȧ Ḃ ȦḂḂ Ȧ ȧḃḃ s derived y the kulept0l system given in Exmple 2.2. Figure 2: k-derivtion forest of derived y the kulept0l system given in Exmple 2.2. Next we turn to define schedules on forests following [7]. Let F e forest. We ssume tht there re k processors tht correspond to rewriting k symols in ech derivtion step. Every node in F is interpreted s tsk. We ssume tht ll tsks re unit-length (tht is, they tke the sme time to e executed). The prent-child reltion in F specifies the precedence constrints (tht is, the prent nodes re scheduled efore its children nodes). k-schedule is then sequence of slots, where ech slot contins up to k tsks. Ech slot hs corresponding time unit. Ech slot indictes which of the t most k tsks re to e scheduled in the corresponding time unit. Ech slot is filled with symols tht occur on the left hnd side of production in tle h H of given kulept0l system = (Σ, H, ψ,, k). Figure 3 illustrtes these notions. Definition 2.5 (k-schedule [7]) Let F e forest nd let k 1. k-schedule of F is function σ mpping the nodes of F onto the set {1,..., l}, for some l F, such tht

7 6 Sun ensch, Mrtin Kutri, ndres Mlcher time l processor 1 processor 2. processor k slot 1 slot 2 slot l Figure 3: n illustrtion of k-schedule of length l with k processors. Ech cell will e filled with one symol from n lphet #σ 1 (i) k for ll 1 k l, 2. for ech pir of nodes v 1, v 2 in F, if v 2 is successor of v 1, then σ(v 2 ) > σ(v 1 ). The length of σ is l nd σ 1 (i) is clled the ith slot of σ. The tsks of slot i re scheduled t time i (tht is, #σ 1 (i) out of the k processors re ssigned tsk t tht time). There re k #σ 1 (i) idle periods in slot i (tht is, periods in which not ll k processors re used). schedule σ hs p(σ) idle periods, where p(σ) = l (k #σ 1 (i)) = l k F. i=1 schedule σ is optiml for F if there is no schedule σ of F with p(σ ) p(σ). Note tht optiml schedules hve miniml length. The numer of idle periods of F, denoted p(f ), is the numer of idle periods in n optiml schedule for F. If p(σ) = 0 in schedule σ, then σ is clled perfect Figure 4: The tle on the left side is k-schedule, k = 3, for the derivtion forest given in Figure 1; the schedule is optiml nd hs one idle period. The tle on the right side is k-schedule, k = 3, for the k-derivtion forest given in Figure 2; it is perfect schedule. Oserve tht the re forests of k-derivtion forests hve perfect k-schedules. If v 1,..., v k re symols tht re rewritten in step i during k-derivtion, then v 1,..., v k occur in the ith slot of the corresponding perfect schedule. Lemm 2.6 ([7]) derivtion forest is k-derivtion forest if nd only if its re forest hs perfect schedule. Lemm 2.7 (first nd second phse) Let = (Σ, H, ψ,, k) e kulept0l system nd let ψ w 1 w l w n = w e derivtion of w in, where ψ < k, w i < k, for 1 i l 1 nd w l k.

8 Extended kulpt0l Lnguges nd Mild Context-Sensitivity 7 word w is in L() if nd only if there exists derivtion ψ w, such tht 1. there is derivtion tree t of w l from ψ, nd 2. there is k-derivtion tree s of w from w l, such tht p(re(s)) = 0. We refer to the derivtion from ψ to w l s the first phse nd to the derivtion from w l to w s the second phse. If ψ k, then the derivtion hs no first phse. Proof. ll slots in k-schedule for k-derivtion re filled with tsks nd there re no idle periods. The following lgorithm is for otining Highest Level First (HLF) k-schedule for forest. Roughly speking, the lgorithm uilds n HLF k-schedule for forest F y scheduling the nodes on the longest pths in tree in F. lgorithm 2.8 ([7]) 1. If F consists of t lest k trees, then σ 1 (1) contins the roots of the k highest trees (for trees of equl height the choice is ritrry). 2. Otherwise, σ 1 (1) is the set of ll the roots. 3. The til of the schedule is constructed similrly, with the nodes in σ 1 (1) deleted from F. The k-schedules in Figure 4 re not HLF k-schedules. n HLF k-schedule is given in Figure Figure 5: n HLF k-schedule for the k-derivtion forest given in Figure 2. Theorem 2.9 ([3, 5]) ny HLF schedule for forest is optiml. 3. Polynomil Memership lgorithm We divide the memership testing into the two phses of derivtion of kulept0l system (see Lemm 2.7). The first phse ends when the length of the sententil form is t lest k. Since there re t most ( Σ + 1) k 1 different sententil forms whose length is less thn k nd the systems re propgting, testing memership in the first phse cn e done in constnt time. For the second phse we use the lgorithm in [7] for extended context-free grmmrs, where k nonterminl symols re replced in ech derivtion step. The lgorithm in [7] is ottom-up nd keeps trck of ll the derivtion trees deriving suwords of the input word, similr to the CYK lgorithm. These derivtion trees re prmeterized nd we otin polynomil

9 8 Sun ensch, Mrtin Kutri, ndres Mlcher size chrcteriztion. There my e fmily of derivtion forests for given word. The prmeterized trees re clled frmes nd the prmeters re the root symol, the strt nd end position of the suword in w, the height of the sutree nd the numer of its nodes. The lgorithm computes then the numer of idle periods for frme collection y using the medin. In [5] the medin ws used to present polynomil time scheduling lgorithm for forests nd other grphs ssuming constnt numer of processors. Note tht the numer of idle periods for vrious frme collections hve to e computed. Intuitively, ll those k-derivtion trees which re higher thn the medin re hrd to schedule, wheres ll other k-derivtion trees re esy to schedule. There re only polynomil numer of frme collections tht re hrd to schedule nd this chieves polynomil time lgorithm for solving memership for constnt k nd constnt kulept0l system. Definition 3.1 (k-medin [7]) The k-medin of forest F is one plus the height of the kth highest tree of F. If F contins less thn k trees, then the medin is zero. The k-high forest of F is the set of ll those trees in F which re strictly higher thn the medin. The k-low forest is the set of the remining trees. The k-high forest nd k-low forest of forest F re denoted y High k (F ) nd Low k (F ), respectively. Theorem 3.2 ([7]) Let F e forest nd σ e k-schedule for High k (F ) with q idle periods. Then there is schedule σ for the whole forest F, such tht: 1. if q Low k (F ), then the length of σ is s most s long s the length of σ; 2. if q < Low k (F ), then σ hs idle periods only in its lst slot. Lemm 3.3 ([7]) ssume tht the HLF schedules for High k (F ) hve q idle periods. Then the HLF schedules for F hve 1. q Low k (F ) idle periods if q Low k (F ), 2. F mod k idle periods, otherwise. The following lemm is resttement for kulept0l derivtions nd restricts the length of derivtion for word w in kulept0l lnguge polynomilly in n. Lemm 3.4 Let = (Σ, H, ψ,, k) e kulept0l system nd let w with w = n. Then w L() if nd only if there exists derivtion tree t of w from ψ, such tht the height of t is t most f(n) = nk 2k (#Σ) k(k+1)/2 nd t nf(n). The ound on the totl numer of nodes t follows from the fct tht in ech tree level, there cn e t most n nodes. The following definition is resttement for kulept0l systems nd its k-derivtion trees. The k-derivtion trees re prmeterized into frmes.

10 Extended kulpt0l Lnguges nd Mild Context-Sensitivity 9 Definition 3.5 Let e kulept0l nd let w = 1 n, where 1,..., n nd w k. frme R (of w) is quintuple (, l, r, h, c), such tht Σ is the root of R, 1 l r n, nd there is k-derivtion tree t of l r from in, such tht its re tree hs height h nd c nodes. If the derivtion tree is of height zero, tht is, is terminl symol, then c = 0 nd h = 1. tree t s ove is clled frme tree for R. The height of frme R is h nd the size of R, denoted R, is c. n ordered set R of frmes (, l, r, h, c) is clled frme collection, where ll in R occur on the left hnd side of production in tle h H of given kulept0l system. The height of R is the mximum of the frme heights in R nd the size of R is the sum of the sizes of the frmes in R. If F is forest, such tht the ith tree in F is frme tree for the ith frme in R, for 1 i #F = #R, then F is clled frme forest of R (see Exmple 3.6 for n exmple). Exmple 3.6 The forest in Figure 2 is frme forest for the frme collection R: R = {(, 1, 4, 3, 8), (, 5, 7, 3, 6)}. The notions of k-medin, k-high collection (k-high forest), nd k-low collection (k-low forest) re defined similrly for frme collections. In prticulr, the numer of idle periods for frme collection is given y p(r) = min{p(re(f )) F is frme forest of R}. The following is resttement of Lemm 2.7 for frmes. Lemm 3.7 Let = (Σ, H, ψ,, k) e kulept0l system nd let ψ w 1 w l w n = w e derivtion of w in, where ψ < k, w i < k, for 1 i l 1 nd w l k. Furthermore, let S w l e n dditionl rule for, where S is new symol in Σ \ nd S w l new production in new tle h new in H. word w is in L() if nd only if there exists derivtion ψ 1. there is derivtion tree t of w l from ψ, nd w, such tht 2. there exists frme R = (S, 1, n, h, c), for some h nd c, such tht p(r) = 0. If ψ k, then let S ψ e n dditionl rule in new tle in H of. Definition 3.8 (child collection [7]) Let R = (, l, r, h, c) e frme of word w, nd let R = {R 1,..., R j } e frme collection of w, where R i = ( i, l i, r i, h i, c i ) for ll 1 < i j. We

11 10 Sun ensch, Mrtin Kutri, ndres Mlcher sy tht R is child collection of R if: 1 j H, l = l 1, r j = r, nd l i = r i for ll 2 i j, h = 1 + mx{h 1,..., h j }, nd c = 1 + j c i. child collection of frme collection R is otined y choosing child collection for ech of the frmes in R nd tking their union. i=1 y Lemm 3.4, we only consider those frmes R = (, l, r, h, c) with ounded length. Since there re t most #Σ choices for, nd n choices for ech l nd r nd since f(n) in Lemm 3.4 is liner function, the following ound is otined. Corollry 3.9 ([7]) There re O(n 5 ) frmes to e computed while testing memership for word of length n. The following corollry is resttement of Lemm 3.3 for frmes. Corollry 3.10 ([7]) Let R e frme collection. Then p(r) = { p(high k (R)) Low k (R) if p(high k (R)) Low k (R), R mod k, otherwise. y definition, k-high collection consists of t most k 1 frmes nd y Corollry 3.9 t most O(n 5(k 1) ) idle periods of k-high collections hve to e computed. Lemm 3.11 ([7]) Let j e the numer of frmes in frme collection I, where I = High k (I). Then { 0 if I is empty, p(i) = k j + min{ p(r ) R is child collection of I }, otherwise. The lgorithm in [7] first constructs ll the frmes for the input word w, nd then, computes the numer of idle periods for ech possile high collection. The numer of idle periods for ech frme of word w is computle in polynomil time. The numer of idle periods of vrious frme collections is computed, y incresing height, using the recurrences stted in Corollry 3.10 nd Lemm Finlly, it is tested whether there exists frme tht covers ll of w, tht is, frme of the form (S, 1, w, h, c) nd tht hs k 1 idle periods. The lgorithm does not only decide memership ut lso provides the informtion necessry to construct k-derivtion for n input word w (see [7]). Theorem 3.12 ([7]) lgorithm 1 runs in time polynomil in n, O(n 5(k 1)(Mxr()+1)+1 ), if oth k nd re constnt.

12 Extended kulpt0l Lnguges nd Mild Context-Sensitivity 11 lgorithm 1: djusted memership lgorithm from [7] for the second phse in kulept0l derivtions Dt: kulept0l = ({ 1,..., m }, H, S,, k), where H contins new tle h new with S w s its single production, nd word w = p1 pn. Result: ccept if w L(), otherwise reject. egin /* test if w = w nd S directly derives w in one derivtion step; */ if S w then ccept; /* construct ll the frmes of w, of height h; */ for i := 1 to n do ( pi, i, i, 1, 0) is frme; for h := 0 to f(n) do forll the g H do forll the 1 2 j g do forll the 1 l 0... l j n do forll the h 1,..., h j with mx{h 1,..., h j } = h 1 do forll the 0 c 1,..., c j nf(n) do if ( i, l i 1, l i, h i, c i ) is frme or 1 i j then (, l 0, l j, h, c 1 + c c j + 1) is frme; /* compute the numer of idle periods for ll collections up to k 1 frmes; */ p({}) := 0; for h := 1 to f(n) do forll the frme collections R of height h, consisting of up to k 1 frmes, ech of positive height do q := ; forll the child collections R of R do forll the High k (R ) where ll in the frmes occur on the left hnd side of production in tle g H do I := High k (R ); /* Since the height of I is h 1, we cn recur on p(i ); */ if p(i ) Low k (R ) then p(r ) := p(i ) Low k (R ) else p(r ) := R mod k; q := min{q, p(r )}; p(r) := k #R + q; /* This is the memership test; */ for h := 1 to f(n) do for c := 2 to n f(n) do if (S, 1, n, h, c) is frme nd p((s, 1, n, h, c)) = k 1 then ccept else reject;

13 12 Sun ensch, Mrtin Kutri, ndres Mlcher References [1] S. ENSCH, Prllel systems s mildly context-sensitive grmmr formlisms. Ph.D. thesis, Universität Potsdm, Potsdm, ermny, [2] H. ORDIHN, Mildly context-sensitive grmmrs. In: C. MRTÍN-VIDE, V. MITRN,. PĂUN (eds.), Forml Lnguges nd ppliction, Studies in Fuzziness nd Soft Computing 148. Springer, erlin, 2004, [3] J. RUNO, Deterministic nd stochstic scheduling prolems with tree-like precedence constrints. NTO Conference (1981). [4] J. DSSOW,. PĂUN, Regulted Rewriting in Forml Lnguge Theory. Springer, [5] D. DOLEV, M. WRMUTH, Scheduling flt grphs. SIM Journl on Computing 14 (1985) 3, [6] J. ERLEY, n efficient context-free prsing lgorithm. Communictions of the CM 13 (1970) 2, [7] J. ONCZROWSKI, M. K. WRMUTH, pplictions of scheduling theory to forml lnguge theory. Theoreticl Computer Science 37 (1985), [8]. K. JOSHI, Tree djoining grmmrs: how much context-sensitivity is required to provide resonle structurl descriptions? In: D. R. DOWTY, L. KRTTUNEN,. M. ZWICKY (eds.), Nturl Lnguge Prsing. Psychologicl, Computtionl, nd Theoreticl Perspectives. Cmridge University Press, New York, 1985, [9]. K. JOSHI, K. VIJY-SHNKER, D. J. WEIR, The convergence of mildly context-sensitive grmmr formlisms. In: T. WSOW, P. SELLS (eds.), The Processing of Linguistic Structure. MIT Press, 1991, [10] J. OPTRNY, K. CULIK II, Time complexity of recognition nd prsing of E0L lnguges. In:. LINDENMYER,. ROZENER (eds.), utomt, Lnguges, Development. North- Hollnd, msterdm, 1976, [11]. ROZENER,. SLOM, The Mthemticl Theory of L-Systems. cdemic Press, New York, [12] J. VN LEEUWEN, The memership question for ET0L lnguges is polynomilly complete. Informtion Processing Letters 3 (1967), [13] K. VIJY-SHNKER, D. J. WEIR, The equivlence of four extensions of context-free grmmrs. Mthemticl Systems Theory 27 (1994) 6, [14] D. WÄTJEN, E. UNRUH, On extended k-uniformly limited T0L systems nd lnguges. Informtion Processing nd Cyernetics EIK 26 5/6 (1990), [15] D. H. YOUNER, Recognition nd prsing of context-free lnguges in time n 3. Informtion nd Control 10 (1967),

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

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

Formal Languages and Automata

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

More information

Minimal DFA. minimal DFA for L starting from any other

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

More information

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

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

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

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

1 Nondeterministic Finite Automata

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

More information

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

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

More information

Mildly Context-Sensitive Grammar Formalisms: Introduction

Mildly Context-Sensitive Grammar Formalisms: Introduction CFG nd nturl lnguges (1) Mildly Context-ensitive Grmmr Formlisms: Introduction Lur Kllmeyer Heinrich-Heine-Universität Düsseldorf A context-free grmmr (CFG) is set of rewriting rules tht tell us how to

More information

First Midterm Examination

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

More information

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

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

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

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

More information

Hamiltonian Cycle in Complete Multipartite Graphs

Hamiltonian Cycle in Complete Multipartite Graphs Annls of Pure nd Applied Mthemtics Vol 13, No 2, 2017, 223-228 ISSN: 2279-087X (P), 2279-0888(online) Pulished on 18 April 2017 wwwreserchmthsciorg DOI: http://dxdoiorg/1022457/pmv13n28 Annls of Hmiltonin

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)

More information

The Minimum Label Spanning Tree Problem: Illustrating the Utility of Genetic Algorithms

The Minimum Label Spanning Tree Problem: Illustrating the Utility of Genetic Algorithms The Minimum Lel Spnning Tree Prolem: Illustrting the Utility of Genetic Algorithms Yupei Xiong, Univ. of Mrylnd Bruce Golden, Univ. of Mrylnd Edwrd Wsil, Americn Univ. Presented t BAE Systems Distinguished

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

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

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

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

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

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

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

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

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

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is

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

Let's start with an example:

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

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Quadratic Forms. Quadratic Forms

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

More information

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

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs Prm University, Mth. Deprtment Summry of lecture 9 Algorithms nd Dt Structures Disjoint sets Summry of this lecture: (CLR.1-3) Dt Structures for Disjoint sets: Union opertion Find opertion Mrco Pellegrini

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

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

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

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

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

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

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

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

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

Some Theory of Computation Exercises Week 1

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

More information

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

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

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

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

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

Zero-Sum Magic Graphs and Their Null Sets

Zero-Sum Magic Graphs and Their Null Sets Zero-Sum Mgic Grphs nd Their Null Sets Ebrhim Slehi Deprtment of Mthemticl Sciences University of Nevd Ls Vegs Ls Vegs, NV 89154-4020. ebrhim.slehi@unlv.edu Abstrct For ny h N, grph G = (V, E) is sid to

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

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

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

Normal Forms for Context-free Grammars

Normal Forms for Context-free Grammars Norml Forms for Context-free Grmmrs 1 Linz 6th, Section 6.2 wo Importnt Norml Forms, pges 171--178 2 Chomsky Norml Form All productions hve form: A BC nd A vrile vrile terminl 3 Exmples: S AS S AS S S

More information

Handout: Natural deduction for first order logic

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

More information

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

QUADRATURE is an old-fashioned word that refers to

QUADRATURE is an old-fashioned word that refers to World Acdemy of Science Engineering nd Technology Interntionl Journl of Mthemticl nd Computtionl Sciences Vol:5 No:7 011 A New Qudrture Rule Derived from Spline Interpoltion with Error Anlysis Hdi Tghvfrd

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

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

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

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

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science CSCI 340: Computtionl Models Trnsition Grphs Chpter 6 Deprtment of Computer Science Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t

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

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

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

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

More information

The transformation to right derivation is called the canonical reduction sequence. Bottom-up analysis

The transformation to right derivation is called the canonical reduction sequence. Bottom-up analysis Bottom-up nlysis Shift-reduce prsing. Constructs the derivtion tree from ottom to top. Reduces the string to the strt symol. Produces reverse right derivtion. Exmple: G(E): 1. E E + T 2. T 3. T T * F 4.

More information

Designing Information Devices and Systems I Spring 2018 Homework 7

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

More information

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