Sofa Uversty St. Klmet Ohrdsk Faculty of Mathematcs ad Iformatcs Departmet of Mathematcal Logc ad Applcatos Uversal Leveshte Automata. Buldg ad Propertes A thess submtted for the degree of Master of Computer Scece by Petar Nkolaev Mtak supervsor: Dr. Stoya Mhov Sofa, 2005
Cotets 1 Itroducto. 2 2 Leveshte dstaces. Propertes. 3 3 Nodetermstc fte Leveshte automata for fxed word. 8 4 Determstc fte Leveshte automata for fxed word. 13 5 Uversal Leveshte automata. 28 6 Buldg of A,ɛ, A,t ad A,ms. 48 6.1 Summarzed pseudo code...................... 48 6.2 Detaled pseudo code......................... 49 6.3 Complexty.............................. 58 6.4 Some fal results........................... 59 7 Mmalty of A,ɛ, A,t ad A,ms. 59 8 Some propertes of A,ɛ. 72 1
1 Itroducto. Oe possble measure for the proxmty of two strgs s the so-called Leveshte dstace (kow also as edt dstace), based o prmtve edt operatos. Prmtve edt operatos are replacemet of oe symbol wth aother (substtuto), deleto of a symbol, serto of a symbol ad others. The dstace betwee two strgs w ad v s defed as the mmal umber of the prmtve edt operatos that trasform w to v. Ths master thess gves a detaled formal revew of the so-called uversal Leveshte automato. The put word for ths automato s a sequece of bt vectors (w, v) whch s computed by gve two words w ad v. The automato recogzes (w, v) ff the dstace betwee w ad v s ot greater tha. The greatest advatage of the uversal Leveshte automata A,χ s obtaed whe we have to extract from a dctoary all words v that are close eough to a gve word w. If the dctoary s repeseted as a fte determstc automato D we ca traverse parallelly the two automata A,χ ad D to fd all these words. Descrpto of ths algorthm ad ts modfed verso called forward-backward method, whch s extremely fast practce, ca be foud [MSFASLD]. Short revew of the cotets Secto 2 - defto of three dfferet Leveshte dstaces based o the umber of edt operatos. Secto 3 - defto of the odetermstc Leveshte automato A ND,χ (w) cossts of all strgs x such that the dstace betwee w ad x s ot greater tha. (w) ad proof that the laguage of A ND,χ Secto 4 - defto of the determstc Leveshte automato A D,χ proof that the laguages of A ND,χ Leveshte automato A,χ (w) ad (w) ad A D,χ (w) are equal. The uversal s defed secto 5. Secto 6 - the algorthm s mmal. Secto 8 - some prop- for ts buldg. Secto 7 - proof that A,χ ertes of A,ɛ. Remarks The am of ths master thess s to revew the determstc Leveshte automata ad the uversal Leveshte automata preseted by ther authors Mhov ad Schulz [SMFSCLA] ad [MSFASLD]. The ma efforts ths master thess are cocetrated o the strct proofs ad the detals. Ths paper s a draft trasato of the orgal text wth addtoal commets ad more fgures. The orgal ca be foud at [ORIG]. The term Leveshte dstaces s used the text for d ɛ L, dt L ad dms L, although for the words w 1 = abcd, w 2 = abdc ad w 3 = bdac the tragle equalty s ot satsfed for d t L. dt L (abcd, abdc) = 1, dt L (abdc, bdac) = 2, but (abcd, bdac) = 4. d t L 2
2 Leveshte dstaces. Propertes. Let Σ be a fte set of letters. Defto 1 d ɛ L : Σ Σ N Let v, w, v, w Σ ad a, b Σ. 1) v = ɛ or w = ɛ d ɛ def L (v, w) = max( v, w ) 2) v 1 ad w 1 Let v = av ad w = bw. d ɛ def L (v, w) = m( f(a = b, d ɛ L (v, w ), ), 1 + d ɛ L (v, bw ), 1 + d ɛ L (av, w ), 1 + d ɛ L (v, w ) ) Notatos Here ad what follows the value of the expresso f(codto, V alueif CodtoIsT rue, V alueif CodtoIsF alse) s V alueif CodtoIsT rue f Codto s satsfed ad V alueif CodtoIsF alse otherwse. x deotes the legth of x. The fucto d ɛ L s called Leveshte dstace. dɛ L (v, w) s called Leveshte dstace betwee the words v ad w. The Leveshte dstace betwee the words v ad w s the mmal umber of prmtve edt operatos that trasform v to w. The prmtve edt operatos are deleto of a letter, serto of a letter ad substtuto of oe letter wth aother. Defto 2 : Σ N Σ Let k N, x 1, x 2,..., x k Σ ad t N. { x 1 x 2...x k t def ɛ f t k = x t+1 x t+2...x k otherwse Treatg the trasposto of two letters also as a prmtve edt operato we receve the followg defto of Leveshte dstace exteded wth trasposto: Defto 2 d t L : Σ Σ N Let v, w, v, w Σ ad a, b, a 1, b 1 Σ. 1) v = ɛ or w = ɛ d t def L (v, w) = max( v, w ) 2) v 1 ad w 1 Let v = av ad w = bw. 3
d t def L (v, w) = m( f(a = b, d t L (v, w ), ), 1 + d t L (v, bw ), 1 + d t L (av, w ), 1 + d t L (v, w ), f(a 1 < v & b 1 < w & a = b 1 & a 1 = b, 1 + d t L (v 2, w 2), ) ) Notatos We use c < d to deote that c s a prefx of d f c ad d are words. The fucto d t L s called Leveshte dstace exteded wth trasposto. Whe mergg of two letters to oe ad splttg of oe letter to two other letters are cosdered as prmtve edt operatos we use the followg defto of Leveshte dstace exteded wth merge ad splt: Defto 3 d ms L : Σ Σ N Let v, w, v, w Σ ad a, b Σ. 1) v = ɛ or w = ɛ d ms def L (v, w) = max( v, w ) 2) v 1 ad w 1 Let v = av ad w = bw. d ms L def (v, w) = m( f(a = b, d ms L (v, w ), ), 1 + d ms L (v, bw ), 1 + d ms L (av, w ), 1 + d ms L (v, w ), f( w 2, 1 + d ms L (v, w 2), ), f( v 2, 1 + d ms L (v 2, w ), ) ) The fucto d ms L splt. d ms L s called Leveshte dstace exteded wth merge ad Notatos We use χ as a metasymbol. For example d χ L deotes dɛ L, dt L or f χ {ɛ, t, ms}. Proposto 1 Let χ {ɛ, t, ms} ad v, w Σ. The d χ L (v, w) = 0 v = w. Proof ) Let v = w = x. Usg ducto o x we prove that d χ L (x, x) = 0. 1) x = 0 d χ L (x, x) = dχ L (ɛ, ɛ) = 0 2) Iducto hypothess: d χ L (x, x) = 0 Let a Σ. We prove that d χ L (ax, ax) = 0: d χ L (ax, ax) = m( f(a = a, dχ L (x, x), ),... ) = 4
m( f(a = a, 0, ),... ) = 0 ) Wth ducto o v we prove that d χ L (v, w) = 0 v = w. 1) v = ɛ. Let d χ L (v, w) = 0. dχ L (v, w) = max( v, w ) = 0. Hece w = ɛ. 2) Iducto hypothess: w Σ (d χ L (v, w) = 0 v = w) Let a Σ ad w Σ. We have to prove that d χ L (av, w) = 0 av = w. Let d χ L (av, w) = 0. From the defto of dχ L t follows that w 1. Let b Σ, w Σ ad w = bw. From the defto of d χ L t follows that a = b ad d χ L (v, w ) = 0. The ducto hypothess mples that v = w. Therefore av = w. Proposto 2 Let χ {ɛ, t, ms} ad v, w Σ. The d χ L (v, w) = dχ L (w, v). The proof of the Proposto 2 s straghtforward. Remark As we kow Proposto 1 ad Proposto 2, t remas to prove the tragle equalty for d χ L ( dχ L (v, w) dχ L (v, x) + dχ L (x, w) ) to show that d χ L s dstace. But ths property s used owhere ths paper. That s why we do t prove t. Defto 4 Let χ {ɛ, t, ms}. L χ Lev : N Σ P (Σ ) L χ def Lev (, w) = {v d χ L (v, w) } We ca fd the deftos of L ɛ Lev, Lt Lev ad Lms Lev [SMFSCLA]. Proposto 3 Let χ {ɛ, t, ms}. Let a Σ ad v, w Σ. The d χ L (v, w) = k dχ L (av, w) k + 1. Proof Let d χ L (v, w) = k. 1) w = ɛ d χ L (av, w) = dχ L (av, ɛ) = k + 1 2) w 1 Form the defto of d χ L t follows that dχ L (av, w) 1 + dχ L (v, w) = k + 1. Proposto 4 Let χ {ɛ, t, ms}. Let a, w 1 Σ ad v, w Σ. The d χ L (v, w) = k dχ L (av, w 1w) k + 1. Proof Let d χ L (v, w) = k. From the defto of dχ L t follows that dχ L (av, w 1w) 1 + d ms L (v, w) = k + 1. Proposto 5 Let χ {ɛ, t, ms}. Let w 1 Σ ad v, w Σ. The d χ L (v, w) = k dχ L (v, w 1w) k + 1. Proof Proposto 5 follows drectly from Proposto 3 ad Proposto 2. 5
Proposto 6 Let χ {ɛ, t, ms}. Let w 1 Σ ad v, w Σ. The d χ L (v, w) = k dχ L (w 1v, w 1 w) k. d ms L Proof Let d χ L (v, w) = k. From the defto of dχ L t follows that dχ L (w 1v, w 1 w) (v, w) = k. Proposto 7 > 0. The Let χ {ɛ, t, ms}. Let w Σ, w = w 1 w 2...w p, p 1 ad L χ Lev (, w) Σ.Lχ Lev ( 1, w) Σ.L χ Lev ( 1, w 2w 3...w p ) L χ Lev ( 1, w 2w 3...w p ) w 1.L χ Lev (, w 2w 3...w p ). Proof From Propertes 3, 4, 5 ad 6 t follows respectvely that L χ Lev (, w) Σ.Lχ Lev ( 1, w), L χ Lev (, w) Σ.Lχ Lev ( 1, w 2w 3...w p ), L χ Lev (, w) Lχ Lev ( 1, w 2w 3...w p ) ad L χ Lev (, w) w 1.L χ Lev (, w 2w 3...w p ). Therefore L χ Lev (, w) Σ.Lχ Lev ( 1, w) Σ.L χ Lev ( 1, w 2w 3...w p ) L χ Lev ( 1, w 2w 3...w p ) w 1.L χ Lev (, w 2w 3...w p ). We show how to exted A = Σ.L χ Lev ( 1, w) Σ.L χ Lev ( 1, w 2w 3...w p ) L χ Lev ( 1, w 2w 3...w p ) w 1.L χ Lev (, w 2w 3...w p ) to L χ Lev (, w). Frst we defe Rχ as a exteso of A ad afterwards we prove that R χ = L χ Lev. Defto 5 Let χ {ɛ, t, ms}. R χ : N + Σ + P (Σ ) Let w Σ, w = w 1 w 2...w p, p 1 ad 1. 1) χ = ɛ R ɛ (, w) def = Σ.L ɛ Lev ( 1, w) Σ.L ɛ Lev ( 1, w 2w 3...w p ) L ɛ Lev ( 1, w 2w 3...w p ) w 1.L ɛ Lev (, w 2w 3...w p ) 6
2) χ = t 3) χ = ms R t (, w) def = Σ.L t Lev ( 1, w) Σ.L t Lev ( 1, w 2w 3...w p ) L t Lev ( 1, w 2w 3...w p ) w 1.L t Lev (, w 2w 3...w p ) f( w 2, w 2 w 1.L t Lev ( 1, w 3...w p ), φ). R ms (, w) def = Σ.L ms Lev ( 1, w) Σ.L ms Lev ( 1, w 2w 3...w p ) L ms Lev ( 1, w 2w 3...w p ) w 1.L ms Lev (, w 2w 3...w p ) Σ.Σ.L ms Lev ( 1, w 2w 3...w p ) f( w 2, Σ.L ms Lev ( 1, w 2), φ). Proposto 8 Let w Σ, w = w 1 w 2...w p, p 1 ad 1. The L χ Lev (, w) = Rχ (, w). Proof ) 1) χ = ɛ From Proposto 7 t follows that L ɛ Lev (, w) Rɛ (, w). 2) χ = t We have to prove that ( t ) w 2 L t Lev (, w) w 2w 1.L t Lev ( 1, w 3...w p ). Let w 2 ad v L t Lev ( 1, w 3...w p ). Hece d t L (v, w 3...w p ) 1. From the defto of d t L t follows that dt L (w 2w 1 v, w 1 w 2 w 3...w p ) 1 + d t L (v, w 3...w p ). From ( t ) ad Proposto 7 t drectly follows that L t Lev (, w) R t (, w). 3) χ = ms We have to prove that ( ms 1 ) L ms Lev (, w) Σ.Σ.Lms Lev ( 1, w 2...w p ) ad ( ms 2 ) w 2 L ms Lev (, w) Σ.Lms Lev ( 1, w 3...w p ). 3.1) Frst we prove ( ms 1 ) Let v L ms Lev ( 1, w 2...w p ) ad a, b Σ. Hece d ms L (v, w 2...w p ) 1. From the defto of d ms L t follows that dms L (abv, w 1w 2...w p ) 1+d ms L (v, w 2...w p ). 3.2) We prove ( ms 2 ) Let w 2, v L ms Lev ( 1, w 3...w p ) ad a Σ. Hece d ms L (v, w 3...w p ) 1. From the defto of d ms L t follows that dms L (av, w 1w 2 w 3...w p ) 1 + d ms L (v, w 3...w p ). From ( ms 1 ), ( ms 2 ) ad Proposto 7 t drectly follows that L ms Lev (, w) R ms (, w). 7
Therefore L χ Lev (, w) Rχ (, w). ) Let v L χ Lev (, w) ad dχ L (v, w) = k. 1) v = ɛ d χ L (v, w) = w = k d χ L (v, w 2...w p ) = w 2...w p = k 1 1 Therefore v L χ Lev ( 1, w 2...w p ). 2) v 1 Let v = t ad v = v 1 v 2...v t. Hece d χ L (v, w) = m( f(v 1 = w 1, d χ L (v 2...v t, w 2...w p ), ), 1 + d χ L (v 2...v t, w), 1 + d χ L (v, w 2...w p ), 1 + d χ L (v 2...v t, w 2...w p ),...) = k 2.1) v 1 = w 1 & d χ L (v 2...v t, w 2...w p ) = k I ths case v w 1.L χ Lev (, w 2...w p ). 2.2) d χ L (v 2...v t, w) = k 1 1 I ths case v Σ.L χ Lev ( 1, w). 2.3) d χ L (v, w 2...w p ) = k 1 1 I ths case v L χ Lev ( 1, w 2...w p ). 2.4) d χ L (v 2...v t, w 2...w p ) = k 1 1 I ths case v Σ.L χ Lev ( 1, w 2...w p ). Therefore L ɛ Lev (, w) Rɛ (, w). 2.5) χ = t ad w 2 & v 2 & v 1 = w 2 & v 2 = w 1 & d t L (v 2, w 2) = k 1 1 I ths case v Σ.Σ.L t Lev ( 1, w 2...w p ). Therefore L t Lev (, w) Rt (, w). 2.6) χ = ms ad w 2 & d ms L (v 2...v t, w 3...w p ) = k 1 1 I ths case v Σ.L ms Lev ( 1, w 2). 2.7) χ = ms ad v 2 & d ms L (v 3...v t, w 2...w p ) = k 1 1 I ths case v Σ.Σ.L ms Lev ( 1, w 2...w p ). Therefore L ms Lev (, w) Rms (, w). So L χ Lev (, w) Rχ (, w). 3 Nodetermstc fte Leveshte automata for fxed word. Notatos We deote the tuples <<, 0 >, e >, <<, 1 >, e > ad <<, 2 >, e > wth #e, #e t ad #e s correspodgly. Defto 6 Let χ {ɛ, t, ms}. Let w Σ ad N. We defe the odetermstc fte Leveshte automato A ND,χ (w). A ND,χ (w) def = < Σ, Q ND,χ 8, I ND,χ, F ND,χ, δ ND,χ >
Notatos Suppose that γ : A B s partal fucto. We use the expresso!γ(π) order to deote that γ(π) s defed ad!γ(π) - to deote that γ(π) s ot defed. The specal expresso < π 1, a, π 2 > δ ND,χ used for the trasto partal fucto δ ND,χ : Q ND,ɛ Σ {ɛ} P (Q ND,ɛ ) meas that!δ ND,χ (π1, a) & π 2 δ ND,χ (π1, a). Let w = p ad w = w 1 w 2...w p. 1) χ = ɛ Q ND,ɛ def ND,ɛ def = { #e 0 p & 0 e } I = {0 #0 } F ND,ɛ def = {p #e 0 e } Let a Σ {ɛ} ad q 1, q 2 Q ND,ɛ 2) χ = t Q ND,t def ND,t def I = Q ND,ɛ = {0 #0 } def. < q 1, a, q 2 > δ ND,ɛ def q 1 = #e & q 1 = #e+1 & a Σ or q 1 = #e & q 1 = + 1 #e+1 or q 1 = #e & q 1 = + 1 #e & a = w +1 { #e t 0 p 2 & 1 e } F ND,t = F ND,ɛ Let a Σ {ɛ} ad q 1, q 2 Q ND,t 3) χ = ms Q ND,ms def ND,ms def I = Q ND,ɛ = {0 #0 } def. def < q 1, a, q 2 > δ ND,t < q 1, a, q 2 > δ ND,ɛ or q 1 = #e & q 2 = #e+1 t & a = w +2 or q 1 = #e t & q 2 = + 2 #e & a = w +1 { #e s 0 p 1 & 1 e } F ND,ms = F ND,ɛ Let a Σ {ɛ} ad q 1, q 2 Q ND,ms. def < q 1, a, q 2 > δ ND,ms < q 1, a, q 2 > δ ND,ɛ or q 1 = #e & q 2 = + 2 #e+1 & a Σ or q 1 = #e & q 2 = + 1 #e s & a Σ or q 1 = #e s & q 2 = + 1 #e & a Σ The exteded trasto fucto δ ND,χ for A ND,χ s defed as usual. Frst we defe the ɛ-closure Cl ɛ : Q ND,ɛ P (Q ND,ɛ ): Cl ɛ (q) def = {q} {π k 0 η 1, η 2,..., η k (< q, ɛ, η 1 >, < η 1, ɛ, η 2 >,..., < η k, ɛ, π > δ ND,χ )} 9
We defe ɛ-closure for set of states ( Cl ɛ : P (Q ND,ɛ ) P (Q ND,ɛ ) ) the followg way: Cl ɛ (A) def = Cl ɛ (π) π A Let v Σ ad a Σ. We defe recursvely the partal fucto : Q ND,ɛ Σ P (Q ND,ɛ ): δ ND,χ δ ND,χ def (q, ɛ) δ ND,χ def (q, va) = = Cl ɛ (q)! f!δ ND,χ (q, v)! f!δ ND,χ (q, v) & π δ ND,χ Cl ɛ ( π δ ND,χ (q,v) δ ND,χ (π, a)) otherwse (q,v) δ ND,χ (π, a) = φ I what follows we use the expresso < π 1, v, π 2 > δ ND,χ to deote that!δ ND,χ (π1, v) & π 2 δ ND,χ (π1, v). Remark these otatos the word w wll be clear from the cotext. Q ND,χ Descrpto of A ND,ɛ, F ND,χ ad δ ND,χ deped o the word w. Whe we use ca be foud [MSFASLD]. Fg. 1 A ND,ɛ 2 (w 1 w 2...w 5 ) (Σ ɛ deotes Σ {ɛ}.) The trastos the automato A ND,χ (w) correspod wth the defto of R χ : A ND,ɛ the trastos < #e, a, #e+1 > (a Σ) correspod to 10
Σ.L ɛ Lev ( 1, w). The trastos < #e, a, + 1 #e+1 > (a Σ) - to Σ.L ɛ Lev ( 1, w 2 w 3...w p ). The trastos < #e, ɛ, #e+1 > - to L ɛ Lev ( 1, w 2w 3...w p ). Ad the trastos < #e, w, + 1 #e > - to w 1.L ɛ Lev (, w 2w 3...w p ). Later we prove that L(A ND,χ (w)) = L ɛ Lev (, w). Fg. 2 A ND,t 2 (w 1 w 2...w 5 ) Fg. 3 A ND,ms 2 (w 1 w 2...w 5 ) 11
Proposto 9 Let χ {ɛ, t, ms}. Let N ad w Σ. Let #e Q ND,χ. The L( #e ) = L χ Lev ( e, w +1...w p ). ( L(π) = {w π F ND,χ (< π, w, π > δ ND,χ )} ) The propertes L( #e ) = L ɛ Lev ( e, w +1...w p ), L( #e ) = L t Lev ( e, w +1...w p ) ad L( #e ) = L ms Lev ( e, w +1...w p ) are formulated [SMFSCLA]. Proof Iducto o. 1) = p L(p #e ) = {x x Σ & x e} = L χ Lev ( e, ɛ) 2) 0 p 1 Iducto hypothess: (IH 1 ) j 1 e(l( + j #e ) = L χ Lev ( e, w +j+1...w p )) We prove wth ducto o e that L( #e ) = L χ Lev ( e, w +1...w p ). 2.1) e = L( # ) = w +1.L( + 1 # ) = IH1 w +1.L χ Lev (0, w +2...w p ) = w +1...w p = L χ Lev (0, w +1...w p ) = L χ Lev ( e, w +1...w p ) 2.2) 0 e 1 Iducto hypothess: (IH 2 ) L( #e+1 ) = L χ Lev ( e 1, w +1...w p ) 2.2.1) χ = ɛ L( #e ) = Σ.L( #e+1 ) Σ.L(+1 #e+1 ) L(+1 #e+1 ) w +1.L(+1 #e ) = IH1,2 Σ.L ɛ Lev ( e 1, w +1...w p ) Σ.L ɛ Lev ( e 1, w +2...w p ) L ɛ Lev ( e 1, w +2...w p ) w +1.L ɛ Lev ( e, w +2...w p ) = R ɛ ( e, w +1...w p ) = Proposto 8 L ɛ Lev ( e, w +1...w p ) 2.2.2) χ = t L( #e ) = Σ.L( #e+1 ) Σ.L( + 1 #e+1 ) L( + 1 #e+1 ) w +1.L( + 1 #e ) f( p 2, w +2 w +1.L( + 1 #e+1 ), φ) = IH1,2 Σ.L t Lev ( e 1, w +1...w p ) Σ.L t Lev ( e 1, w +2...w p ) L t Lev ( e 1, w +2...w p ) w +1.L t Lev ( e, w +2...w p ) f( w +1...w p 2, w +2 w +1.L t Lev ( e 1, w +3...w p ), φ) = R t ( e, w +1...w p ) = Proposto 8 L t Lev ( e, w +1...w p ) 2.2.3) χ = ms 12
L( #e ) = Σ.L( #e+1 ) Σ.L( + 1 #e+1 ) L( + 1 #e+1 ) w +1.L( + 1 #e ) Σ.Σ.L( + 1 #e+1 ) f( p 2, Σ.L( + 2 #e+1 ), φ) = IH1,2 Σ.L ms Lev ( e 1, w +1...w p ) Σ.L ms Lev ( e 1, w +2...w p ) L ms Lev ( e 1, w +2...w p ) w +1.L ms Lev ( e, w +2...w p ) Σ.Σ.L ms Lev ( e 1, w +2...w p ) f( w +1...w p 2, Σ.L ms Lev ( e 1, w +3...w p ), φ) = R ms ( e, w +1...w p ) = Proposto 8 L ms Lev ( e, w +1...w p ) Corollary Let χ {ɛ, t, ms}, w Σ ad N. Proposto 9 mples that (w)) = L(0 #0 ) = L χ Lev (, w). L(A ND,χ 4 Determstc fte Leveshte automata for fxed word. I ths secto we show a specal way for determzato of A ND,χ (w). As a result we receve the determstc automato A D,χ (w). Defto 7 Let χ {ɛ, t, ms}. ND,ɛ def Q ND,t def Q ND,ms def Q = { #e, e Z} = Q ND,ɛ { #e t, e Z} = Q ND,ɛ { #e s, e Z} Let N. We defe δe D,χ : Q ND,χ {0, 1} P (Q ND,χ ). Let b {0, 1}, k N ad b = b 1 b 2...b k. 1) χ = ɛ δe D,ɛ ( #e, b) def = { + 1 #e } f 1 < b { #e+1, + 1 #e+1 } f b = 0 k & b ɛ & e < { #e+1, + 1 #e+1, + j #e+j 1 } f 0 < b & j = µz[b z = 1] { #e+1 } f b = ɛ & e < φ otherwse µz[a] deotes the least z such that A s satsfed. 2) χ = t 2.1) 13
δe D,t ( #e, b) def = 2.2) 3) χ = ms 3.1) δe D,ms ( #e, b) def = A ND,χ 3.2) δ D,ms e ( #e s The fucto δ D,χ e { + 1 #e } f 1 < b { #e+1, + 1 #e+1, + 2 #e+1, #e+1 t } f 01 < b { #e+1, + 1 #e+1, + j #e+j 1 } f 00 < b & j = µz[b z = 1] { #e+1, + 1 #e+1 } f b = 0 k & b ɛ & e < { #e+1 } f b = ɛ & e < φ otherwse δe D,t ( #e t {, b) def { + 2 = #e } f 1 < b φ otherwse { + 1 #e } f 1 < b { #e+1, #e+1 s, + 1 #e+1, + 2 #e+1 } f 00 < b 01 < b { #e+1, #e+1 s, + 1 #e+1 } f 0 = b & e < { #e+1 } f ɛ = b & e < φ otherwse, b) def = { + 1 #e } s called fucto of the elemetary trastos. Defto 8 Let χ {ɛ, t, ms}. Let w Σ, N ad (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >. We defe w [ ] : Q ND,χ Σ. Let w = w 1 w 2...w p ad π Q ND,χ. 1) π = #e Q ND,χ w [ #e ] = w +1 w +2...w +k where k = m( e + 1, p ) 2) π = #e t w [ #e t ] = w [ #e ] 3) π = #e s Q ND,t Q ND,ms w [ #e s ] = w [ #e ] The word w [π] s called relevat subword of w for π ([SMFSCLA]). Defto 9 β : Σ Σ {0, 1} β(x, w 1 w 2...w p ) = b 1 b 2...b p where b = 1 x = w. β(x, w 1 w 2...w p ) s called characterstc vector of x wth respect to the word w 1 w 2...w p. Defto 10 Let χ {ɛ, t, ms}. Let w Σ, N ad (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >. A ND,χ 14
We defe δe D,χ : Q ND,χ Σ P (Q ND,χ ). δe D,χ (π, x) def = δe D,χ (π, β(x, w [π] )) The deftos of δe D,ɛ, δe D,t ad δe D,ms are gve [SMFSCLA]. Defto 11 Let χ {ɛ, t, ms}. We defe < χ s Q ND,ɛ Q ND,χ. 1) χ = ɛ #e < ɛ #f def s j f > e & j f e 2) χ = t #e < t #f def s j #e < ɛ s j #f #e < t s j #f t 3) χ = ms #e < ms s def f > e & j + 1 f e #f def j #e < ms s j s #f #e < ɛ s j #f def #e < ɛ s j #f The relato < χ s s defed such way that π 1 < χ s π 2 L(π 1 ) L(π 2 ). That s why, whe we determze A ND,χ, for each state A of the receved determstc automato t wll be true that (*) q 1, q 2 A(q 1 χ s q 2 ). As we take to accout that q δe D,χ (q, x) < q, x, q > δ ND,χ ad q1 χ s q 2 & < q 2, x, q 2 > δ ND,χ q 1 δe D,χ (q 1, x)(q 1 χ s q 2) ad also (*), we ca defe the trasto fucto δ D,χ for the determstc automato: δ D,χ (A, x) = q A δd,χ e (q, x) where B removes from B each π for whch there s such q B that q < χ s π. Remark π 1 < χ s π 2 correspods to π 1 subsumes π 2 from [SMFSCLA]. We do t defe whe #e t < t s π or #e s < ms s π,.e. our defto of < χ s mples that #e t t s π ad #e s ms s π for each #e t s ad π. We do t defe whe #e t < t s π or #e s < ms s π because every good defto of #e t < χ s π or #e s < χ s π wll satsfy the property #e t < t s π + 1 #e < χ s π or #e s < ms s π #e < χ s π correspodgly. If we keep md that #e t δe D,t (A, x) + 1 #e δe D,t (A, x), #e s δe D,t (A, x) #e δe D,t (A, x) ad look at the defto of, we shall see easly that each good defto of #e t < t s π or #e s < ms s π leads to the same automata A D,χ ad A,χ as our defto. The set {π π Q ND,ɛ 2 & 3 #0 ɛ s π} whe A ND,ɛ 2 (w 1 w 2...w 5 ) =< Σ, Q ND,ɛ 2, I ND,ɛ, F ND,ɛ 2, δ ND,ɛ 2 > s depcted o fg. 4. 15
Fg. 4 A ND,ɛ 2 (w 1 w 2...w 5 ) =< Σ, Q ND,ɛ 2, I ND,ɛ, F ND,ɛ 2, δ ND,ɛ 2 >, The elemets of {π π Q ND,ɛ 2 & 3 #0 ɛ s π} are bold. We ca easly prove the followg proposto. Proposto 10 Let χ {ɛ, t, ms}. The χ s a partal order. Defto 12 Let χ {ɛ, t, ms}. Let w Σ ad N ad (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >. : P (P (Q ND,χ )) P (Q ND,χ ) def A = {π π A & π A(π < χ s π)} A ND,χ s defed [SMFSCLA]. Proposto 11 Let χ {ɛ, t, ms}. Let w Σ, w = p ad N. The (w)) = L(< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >) where F ND,χ = { #e p e}. L(A ND,χ Proof Let #e be such that p e. It follows from the defto of that < #e, ɛ, + 1 #e+1 > δ ND,χ, < + 1 #e+1, ɛ, + 2 #e+2 > δ ND,χ,... < p 1 #e+p 1, ɛ, p #e+p > δ ND,χ. Hece < #e, ɛ, p #e+p > δ ND,χ. Therefore L(A ND,χ (w)) L(< Σ, Q ND,χ δ ND,χ Obvously F ND,χ Hece L(A ND,χ F ND,χ. (w)) L(< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >)., I ND,χ, F ND,χ, δ ND,χ >). 16
Therefore L(A ND,χ (w)) = L(< Σ, Q ND,χ I what follows we presume that A ND,χ, I ND,χ, F ND,χ, δ ND,χ >). (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >. Fg. 5 A ND,t 2 (w 1 w 2...w 5 ) =< Σ, Q ND,t 2, I ND,t, F ND,t 2, δ ND,t 2 > Defto 13 Let χ {ɛ, t, ms}. Let w Σ ad N ad (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >. Let M Q ND,χ ad π. M s called state wth base posto π ff π M(π χ s π ) & π 1, π 2 A ND,χ Q ND,ɛ M(π 1 χ s π 2 ). Defto 14 Let χ {ɛ, t, ms}. Let w Σ ad N. We defe the determstc fte automato A D,χ (w). A D,χ (w) def = < Σ, Q D,χ Let w = p ad w = w 1 w 2...w p. ρ : [0, p] P (P (Q ND,χ )) ρ() def = {M M s state wth base posto #0 } D,χ def I def F D,χ δ D,χ = {0 #0 } Q D,χ def = ( 0 p, I D,χ, F D,χ, δ D,χ > ρ())\{φ} = {M M Q D,χ & π M(π F ND,χ )} : Q D,χ Σ Q D,χ 17
{ δ D,χ (M, x) def = π M δd,χ e (π, x) f π M δd,χ e (π, x) φ! otherwse The fte automata A D,ɛ SCLA]. Correctess of the defto 1) We prove that (w), A D,t (w) ad A D,ms (w) are defed [SMF- M ρ() & 0 p 1 & x Σ π M(δ D,χ e (π, x) ρ( + 1)) Let M ρ(), 0 p 1, x Σ ad π M. We prove that δe D,χ (π, x) ρ( + 1): 1.1) χ = ɛ Let π = j #f. Hece #0 ɛ s j #f ad j f. 1.1.1) δe D,ɛ (π, x) = {j + 1 #f } j +1 (+1) f. Hece +1 #0 ɛ s j +1 #f. Therefore δ D,ɛ (π, x) ρ(+1). 1.1.2) δe D,ɛ (π, x) = {j #f+1, j + 1 #f+1, j + z #f+z 1 } for some z such that z > 1 Obvously π 1, π 2 δe D,ɛ (π, x)(π 1 ɛ s π 2 ). It follows from j f that j ( + 1) f + 1, j + 1 ( + 1) f + 1 ad j + z ( + 1) f + z 1. Therefore + 1 #0 ɛ s j #f+1, + 1 #0 ɛ s j + 1 #f+1 ad + 1 #0 ɛ s j + z #f+z 1. Hece δe D,ɛ (π, x) ρ( + 1). 1.1.3) δe D,ɛ φ δ D,t (π, x) = {j #f+1, j+1 #f+1 } or δ D,ɛ e Obvously δe D,ɛ (π, x) ρ( + 1). 1.2) χ = t 1.2.1) π = j #f I ths case #0 t s j #f ad j f. 1.2.1.1) δe D,t (π, x) = {j + 1 #f } j + 1 ( + 1) f. Hece + 1 #0 t s j + 1 #f ad δ D,t 1.2.1.2) δ D,t e (π, x) = {j #f+1 } or δ D,ɛ e (π, x) = e (π, x) ρ( + 1). (π, x) = {j #f+1, j + 1 #f+1, j + 2 #f+1, j #f+1 t } I ths case π δe D,t (π, x)(π = k #l (t) l = f + 1). Therefore π 1, π 2 e (π, x)(π 1 t s π 2 ). It follows from j f that j ( + 1) f + 1, j + 1 ( + 1) f + 1, j + 2 ( + 1) f + 1 ad j + 1 f + 1. Hece + 1 #0 t s j #f+1, + 1 #0 t s j + 1 #f+1, + 1 #0 t s j + 2 #f+1 ad + 1 #0 t s j #f+1 t. Therefore δe D,t (π, x) ρ( + 1). 1.2.1.3) δe D,t (π, x) = {j #f+1, j + 1 #f+1, j + z #f+z 1 } for some z such that z > 2 Obvously π 1, π 2 δe D,t (π, x)(π 1 t s π 2 ). It follows from j f that j + z ( + 1) f + z 1. Therefore δe D,t (π, x) ρ( + 1). 1.2.1.4) δe D,t (π, x) = {j #f+1, j + 1 #f+1 } or δe D,t (π, x) = φ Obvously δe D,t (π, x) ρ( + 1). 1.2.2) π = j #f t 18
I ths case #0 t s j #f t ad j + 1 f. 1.2.2.1) δe D,t (π, x) = {j + 2 #f } j + 2 ( + 1) f. Hece + 1 #0 t s j + 2 #f ad δe D,t (π, x) ρ( + 1). 1.2.2.2) δe D,t (π, x) = φ Obvosly φ ρ( + 1). 1.3) χ = ms 1.3.1) π = j #f I ths case #0 ms s j #f ad j f. 1.3.1.1) δe D,ms (π, x) = {j + 1 #f } j + 1 ( + 1) f. Hece + 1 #0 ms s j + 1 #f ad δe D,ms (π, x) ρ( + 1). 1.3.1.2) δe D,ms (π, x) = {j #f+1, j s #f+1, j + 1 #f+1, j + 2 #f+1 } I ths case π δe D,ms (π, x)(π = k #l (s) l = f + 1). Therefore π 1, π 2 δe D,ms (π, x)(π 1 ms s π 2 ). It follows from j f that j ( + 1) f + 1, j + 1 ( + 1) f + 1 ad j + 2 ( + 1) f + 1. Hece + 1 #0 ms s j #f+1 + 1 #0 ms s ρ( + 1). 1.3.1.3) δe D,ms (π, x) = φ or δ D,ms e j + 1 #f+1 ad + 1 #0 ms s (π, x) = {j #f+1, j #f+1 s Obvously δe D,ms (π, x) ρ( + 1). 1.3.2) π = j s #f. I ths case #0 ms s j s #f ( + 1) f. Hece + 1 #0 ms s 2) We prove that j + 2 #f+1. Therefore δ D,ms e (s), (π, x), j + 1 #f+1 } or δe D,ms (π, x) = {j #f+1 } ad j f. δe D,ms j + 1 #f ad δ D,ms (π, x) = {j + 1 #f }. j + 1 e (π, x) ρ( + 1). M s state wth base posto p #e & 0 e 1 & x Σ π M(δe D,χ (π, x) s state wth base posto p #e+1 ). Let M be state wth base posto p #e, 0 e 1 ad x Σ. Let π M. We have to prove that δe D,χ (π, x) s state wth base posto p #e+1. 2.1) χ = ɛ Let π = j #f. Hece p #e ɛ s j #f, j p f e ad f e. 2.1.1) δe D,ɛ (π, x) = {j + 1 #f } It follows from j p f e that j + 1 p f (e + 1). Therefore p #e+1 ɛ s j + 1 #f ad δe D,ɛ (π, x) s state wth base posto p #e+1. 2.1.2) δe D,ɛ (π, x) = {j #f+1, j + 1 #f+1, j + z #f+z 1 } for some z such that z > 1 Obvously π 1, π 2 δe D,ɛ (π, x)(π 1 ɛ s π 2 ). It follows from j p f e that j p f +1 (e+1), j+1 p f +1 (e+1) ad j +z p f +z 1 (e+1). Hece p #e+1 ɛ s j #f+1, p #e+1 ɛ s j + 1 #f+1 ad p #e+1 ɛ s j + z #f+z 1. Therefore δe D,ɛ (π, x) s state wth base posto p #e+1. 2.1.3) δe D,ɛ (π, x) = {j #f+1, j+1 #f+1 } or δe D,ɛ (π, x) = {j #f+1 } or δe D,ɛ (π, x) = φ Obvously δe D,ɛ (π, x) s state wth base posto p #e+1. 2.2) χ = t 2.2.1) π = j #f I ths case p #e t s j #f, j p f e ad f e. 2.2.1.1) δ D,t e (π, x) = {j + 1 #f } 19
It follows from j p f e that j + 1 p f (e + 1). Therefore p #e+1 t s j + 1 #f ad δe D,t (π, x) s state wth base posto p #e+1. 2.2.1.2) δe D,t (π, x) = {j #f+1, j + 1 #f+1, j + 2 #f+1, j #f+1 t } I ths case π δe D,t (π, x)(π = k #l (t) l = f + 1). Therefore π 1, π 2 δ D,t e (π, x)(π 1 t s π 2 ). It follows from j p f e that j p f + 1 (e + 1), j+1 p f +1 (e+1), j +2 p f +1 (e+1) ad j+1 p f +1 (e+1). Hece p #e+1 t s j #f+1, p #e+1 t s j + 1 #f+1, p #e+1 t s j + 2 #f+1 ad p #e+1 t s j #f+1 t. Therefore δe D,t (π, x) s state wth base posto p #e+1. 2.2.1.3) δe D,t (π, x) = {j #f+1, j + 1 #f+1, j + z #f+z 1 } for some z such that z > 2 Obvously π 1, π 2 δe D,t (π, x)(π 1 t s π 2 ). It follows from j p f e that j + z p f + z 1 (e + 1). Therefore δe D,t (π, x) s state wth base posto p #e+1. 2.2.1.4) δe D,t (π, x) = {j #f+1, j + 1 #f+1 } or δe D,t (π, x) = φ Obvously δe D,t (π, x) s state wth base posto p #e+1. 2.2.2) π = j #f t. Therefore p #e t s j #f t, j + 1 p f e ad f e. 2.2.2.1) δe D,t (π, x) = {j + 2 #f } It follows from j + 1 p f e that j + 2 p f (e + 1). Therefore p #e+1 t s j + 2 #f ad δe D,t (π, x) s state wth base posto p #e+1. 2.2.2.2) δe D,t (π, x) = φ Obvously φ s state wth base posto p #e+1. 2.3) χ = ms 2.3.1) π = j #f I ths case p #e ms s j #f ad j p f e ad f e. 2.3.1.1) δe D,ms (π, x) = {j + 1 #f } It follows from j p f e that j + 1 p f (e + 1). Therefore p #e+1 ms s j + 1 #f ad δe D,ms (π, x) s state wth base posto p #e+1. 2.3.1.2) δe D,ms (π, x) = {j #f+1, j s #f+1, j + 1 #f+1, j + 2 #f+1 } I ths case π δe D,ms (π, x)(π = k #l (s) l = f + 1). Therefore π 1, π 2 δe D,ms (π, x)(π 1 ms s π 2 ). It follows from j p f e that j p f +1 (e+1), j+1 p f +1 (e+1) ad j+2 p f +1 (e+1). Hece p #e+1 ms s j #f+1 (s), p #e+1 ms s j + 1 #f+1 ad p #e+1 ms s j + 2 #f+1. Therefore δe D,ms (π, x) s state wth base posto p #e+1. 2.3.1.3) δe D,ms (π, x) = {j #f+1, j s #f+1, j + 1 #f+1 } or δe D,ms (π, x) = {j #f+1 } or δe D,ms (π, x) = φ Obvously δe D,ms (π, x) s state wth base posto p #e+1. 2.3.2) π = j s #f I ths case p #e ms s j s #f, j p f e, f e ad δe D,ms (π, x) = {j +1 #f }. It follows from j p f e that j + 1 p f (e + 1). Therefore p #e+1 ms s j + 1 #f ad δe D,ms (π, x) s state wth base posto p #e+1. 3) We prove that A {M M s state wth base posto #e } 20
A s state wth base posto #e. Let A {M M s state wth base posto #e }. It follows from the defto of that A A. Therefore π A( #e χ s π). It follows from the defto of that π 1, π 2 A(π 1 χ s π 2 ). Therefore A s state wth base posto #e. 1), 2) ad 3) mply that δ D,χ The propertes for correctess of δ D,ɛ SCLA]. s well defed., δ D,t ad δ D,ms ca be foud [SMF- Proposto 12 Let χ {ɛ, t, ms}. Let w Σ, w = p, N ad A ND,χ (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >. The #e F ND,χ & π χ s #e π F ND,χ. Proof Let #e F ND,χ ad π = j #f χ s #e. Hece j e f ad p e. Therefore p j f (e f ( j)). Therefore p j f ad π F ND,χ. Proposto 13 Let χ {ɛ, t, ms}. Let w Σ, w = p, N ad (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ >. Let x Σ, s N, ξ 0 = j #f (s) A ND,χ ad ξ 1, ξ 2...ξ s, η 2 Q ND,χ j < p & < ξ 0, ɛ, ξ 1 > δ ND,χ < ξ s, x, η 2 > δ ND,χ j + 1 #f χ s η 2.. The & < ξ 1, ɛ, ξ 2 > δ ND,χ &... & < ξ s 1, ɛ, ξ s > δ ND,χ & < j #f t Remark Proposto 13 does ot hold for ξ 0 = j #f t, x, j + 2 #f > δ ND,t ad j + 1 #f t s j + 2 #f. because we may have Proof Let j < p, < j #f δ ND,χ (s), ɛ, ξ 1 > δ ND,χ ad < ξ s, x, η 2 > δ ND,χ. 1.1) χ = ɛ ξ 0 = j #f It follows from the defto of δ ND,ɛ s #f+1+s, j + 1 + s #f+s }. Therefore j + 1 #f ɛ s η 2. 1.2) χ = t ξ 0 = j #f It follows from the defto of δ ND,t, < ξ 1, ɛ, ξ 2 > δ ND,χ,..., < ξ s 1, ɛ, ξ s > that η 2 {j + s #f+1+s, j + 1 + that η 2 {j + s #f+1+s, j + 1 + s #f+1+s, j + 1 + s #f+s, j + s #f+1+s t }. Therefore j + 1 #f t s η 2 1.3) χ = ms 1.3.1) ξ 0 = j #f It follows from the defto of δ ND,ms s #f+1+s, j + 1 + s #f+s, j + s #f+1+s s 1.3.2) ξ 0 = j #f s that η 2 {j + s #f+1+s, j + 1 +, j + 2 + s #f+s }. Therefore j + 1 #f ms s η 2. 21
I ths case we have that s = 0 ad η 2 = j + 1 #f. Therefore j + 1 #f ms s η 2. Proposto 14 Let χ {ɛ, t, ms}. Let w Σ, N ad (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ A ND,χ N, ξ 0 = η 2 ad ξ 1, ξ 2...ξ s, η 2 Q ND,χ η 1 χ s η 2 & < ξ 0, ɛ, ξ 1 > δ ND,χ < ξ s, x, η 2 > δ ND,χ η 1 δ D,χ e (η 1, x)(η 1 χ s η 2).. The & < ξ 1, ɛ, ξ 2 > δ ND,χ >. Let η 1, η 2 Q ND,χ, x Σ, s &... & < ξ s 1, ɛ, ξ s > δ ND,χ & Fg. 6 Remark Usg Proposto 14 we ca easly prove that η 1 χ s η 2 L(η 1 ) L(η 2 ). Proof Let w = p ad η 1 = #e. 1) χ = ɛ Let η 2 = j #f. 1.1) δe D,ɛ ( #e, x) = { + 1 #e } 1.1.1) j < p We have from Proposto 13 that j + 1 #f ɛ s η 2. It follows from #e ɛ s j #f that + 1 #e ɛ s j + 1 #f. Therefore + 1 #e ɛ s η 2. 1.1.2) j = p 22
We have from the defto of δ ND,ɛ that f <, η 2 = p #f ad η 2 = p #f+1. Therefore p f e ad f e. Hece p ( + 1) (f + 1) e. Therefore + 1 #e ɛ s p #f+1 = η 2. 1.2) δe D,ɛ ( #e, x) = { #e+1, + 1 #e+1, + z #e+z 1 } ad 0 < β(x, w [ #e ]) ad z = µz [β(x, w [ #e ]) z = 1] 1.2.1) j < p We have from Proposto 13 that j + 1 #f ɛ s η 2. It follows from #e ɛ s j #f that + 1 #e ɛ s j + 1 #f. Therefore + 1 #e ɛ s η 2. 0 < β(x, w [ #e ]) mples that + 1 #e η 2. Therefore + 1 #e < ɛ s η 2. Obvously γ Q ND,ɛ ( + 1 #e < ɛ s γ ɛ s η 2 & π( + 1 #e < ɛ s π < ɛ s γ) γ { #e+1, + 1 #e+1, + 2 #e+1 }). 1.2.1.1) γ Q ND,ɛ ( + 1 #e < ɛ s γ ɛ s η 2 & π( + 1 #e < ɛ s π < ɛ s γ) & γ { #e+1, + 1 #e+1 }). { #e+1, + 1 #e+1 } δe D,ɛ ( #e, x). Therefore there s γ δe D,ɛ ( #e, x) such that γ ɛ s η 2. 1.2.1.2) γ Q ND,ɛ ( + 1 < ɛ s γ ɛ s η 2 & π( + 1 #e < ɛ s π < ɛ s γ) γ { #e+1, + 1 #e+1 }). Therefore γ Q ND,ɛ ( + 1 < ɛ s γ ɛ s η 2 & π( + 1 #e < ɛ s π < ɛ s γ) γ = + 2 #e+1 ). Therefore η 2 = + m e+m 1 for some m such that m > 1 ad β(x, w [ #e ]) m = 1. z = µz [β(x, w [ #e ]) z = 1] mples that z m. Therefore + z #e+z 1 ɛ s η 2. 1.2.2) j = p We have from the defto of δ ND,ɛ that f <, η 2 = p #f ad η 2 = p #f+1. It follows from #e ɛ s p #f that #e+1 ɛ s p #f+1. 1.3) δe D,ɛ ( #e, x) = { #e+1, + 1 #e+1 } ad β(x, w [ #e ]) = 0 k for some k such that k > 0. We prove that η 1 δe D,ɛ (η 1, x)(η 1 ɛ s η 2) a way aalogous to 1.2). 1.4) δe D,ɛ ( #e, x) = { #e+1 } ad = p ad e <. 1.4.1) η 2 = p #f ad f < Obvously #e+1 ɛ s p #f+1 = η 2. 1.4.2) η 1 < ɛ s η 2 ad η 2 = j #f ad j < p We have from Proposto 13 that j +1 #f ɛ s η 2. It follows from p #e < ɛ s j #f that j p f e ad f > e. Therefore j + 1 p f (e + 1) ad p #e+1 ɛ s j + 1 #f ɛ s η 2. 1.5) δe D,ɛ ( #e, x) = φ Obvously e = ad η 1 = η 2 ad ( = p or 0 = β(x, w [ #e ]) ). Therefore η 2(< ξ 0, ɛ, ξ 1 > δ ND,ɛ & < ξ 1, ɛ, ξ 2 > δ ND,ɛ &... & < ξ s 1, ɛ, ξ s > δ ND,ɛ & < ξ s, x, η 2 >). Cotradcto. (Ths case s mpossble.) 2) χ = t 2.1) η 2 = j #f 2.1.1) δe D,t ( #e, x) = { + 1 #e } 2.1.1.1) j < p We have from Proposto 13 that j + 1 #f t s η 2. It follows from #e t s j #f that + 1 #e t s j + 1 #f. Therefore + 1 #e t s η 2. 2.1.1.2) j = p 23
We have from the defto of δ ND,t that f <, η 2 = p #f ad η 2 = p #f+1. Therefore p f e ad f e. Hece p ( + 1) (f + 1) e. Therefore + 1 #e t s p #f+1 = η 2. 2.1.2) δ D,ms e ( #e, x) = { #e+1, +1 #e+1, +2 #e+1, #e+1 t } ad 01 < β(x, w [ #e ]) 2.1.2.1) j < p We have from the Proposto 13 that j + 1 #f t s η 2. It follows from #e t s j #f that + 1 #e t s j + 1 #f. Ad from 01 < β(x, w [ #e ]) - that η 2 + 1 #f. Therefore + 1 #e < t s η 2. Let η 1 Q ND,t be such that + 1 < t s η 1 t s η 2 ad π( + 1 #e < t s π < t s η 1) (obvously such η 1 exsts). It follows from the defto of < t s that η 1 { #e+1, + 1 #e+1, + 2 #e+1, #e+1 t that η 1 { 2 #e+1 t, 1 #e+1 cotradcto). 2.1.2.2) j = p We have from the defto of δ ND,t } (f we suppose t } the s = 0, η 2 { 2 #e, 1 #e }, η 1 t s η 2, that f <, η 2 = p #f ad η 2 = p #f+1. It follows from #e t s p #f that #e+1 t s p #f+1. 2.1.3) δe D,t ( #e, x) = { #e+1, + 1 #e+1, + z #e+z 1 } ad 00 < β(x, w [ #e ]) ad z = µz [β(x, w [ #e ]) z = 1] The proof that η 1 δe D,t (η 1, x)(η 1 t s η 2) s aalogous to the proof 1.2). 2.1.4) δe D,t ( #e, x) = { #e+1, + 1 #e+1 } The proof that η 1 δe D,t (η 1, x)(η 1 t s η 2) s aalogous to the proof 1.2). 2.1.5) δe D,t ( #e, x) = { #e+1 } ad = p ad e < I ths case the proof s aalogous to the oe 1.4). 2.1.6) δe D,ms ( #e, x) = φ Lke 1.5) we prove that ths case s mpossble. 2.2) η 2 = j #f t We have from the defto of δ ND,t β(x, w [ j #f t ]). It follows from #e < t s j #f 2.2.1) δe D,t ( #e, x) = { + 1 #e } that s = 0, η 2 = j + 2 #f ad 1 < t that j + 1 f e ad f > e. We have from j + 1 f e that j + 2 ( + 1) f e. Therefore + 1 #e t s j + 2 #f. 2.2.2) δe D,t ( #e, x) = { #e+1, + 1 #e+1, + 2 #e+1, #e+1 t } It follows from j + 1 f e that j + 2 f (e + 1) (j + 1 < ) or j +2 (+1) f (e+1) ( = j +1) or j +2 (+2) f (e+1) ( < j +1). Therefore #e+1 t s j + 2 #f or + 1 #e+1 t s j + 2 #f or + 2 #e+1 t s j + 2 #f. 2.2.3) δe D,t ( #e, x) = { #e+1, + 1 #e+1, + z #e+z 1 } ad 00 < β(x, w [ #e ]) ad z = µz [β(x, w [ #e ]) z = 1] It follows from j + 1 f e that j + 2 ( + 1) f e. Hece + 1 #e < t s j + 2 #f. The proof that η 1 δe D,t (η 1, x)(η 1 t s η 2) s aalogous to 1.2). 2.2.4) δe D,t ( #e, x) = { #e+1, + 1 #e+1 } ad β(x, w [ #e ]) = 0 k for some k such that k > 0 Lke 2.2.2) we prove that #e+1 t s j + 2 #f or + 1 #e+1 t s j + 2 #f. (It follows from β(x, w [ #e ]) = 0 k ad 1 < β(x, w [ j #f t ]) that j + 1 ). 2.2.5) δe D,t ( #e, x) = { #e+1 } ad = p < 24
j #f (s) We have from j + 1 f e that j + 2 f (e + 1) 2.2.6) δe D,t ( #e, x) = φ Obvously ths case s mpossble. 3) χ = ms Let η 2 = j #f (s). 3.1) δe D,ms ( #e, x) = { + 1 #e } 3.1.1) j < p We have from Proposto 13 that j + 1 #f ms s that + 1#e ms s j + 1 #f. Therefore + 1 #e ms 3.1.2) j = p η 2. It follows from #e ms s s η 2. We have from the defto of δ ND,ms that f <, η 2 = p #f ad η 2 = p #f+1. Therefore p f e ad f e. Hece p ( + 1) (f + 1) e. Therefore + 1 #e ms s p #f+1 = η 2. 3.2) δe D,ms ( #e, x) = { #e+1, #e+1 s, +1 #e+1, +2 #e+1 } ad (00 < β(x, w [ #e ]) or 01 < β(x, w [ #e ])) 3.2.1) j < p j #f (s) We have from Proposto 13 that j + 1 #f ms s that + 1#e ms η 2. It follows from #e ms s s j + 1 #f. Ad from 00 < β(x, w [ #e ]) or 01 < β(x, w [ #e ]) - that η 2 + 1 #f. Therefore + 1 #e < ms s that + 1 < ms s η 1 ms s η 2. Let η 1 Q ND,ms be such π < ms s η 1) (obvously such that η 1 { #e+1, #e+1 s, +, + 1 #e+1 s } the s = 0, η 2, cotradcto). η 2 ad π( + 1 #e < ms s η 1 exsts). It follows from the defto of < ms s 1 #e+1, + 2 #e+1 }. (f we suppose that η 1 { 1 #e+1 s η 2 { 1 #e, + 1 #e }, η 1 ms s 3.2.2) j = p We have from the defto of δ ND,ms that f <, η 2 = p #f ad η 2 = p #f+1. It follows from #e ms s p #f that #e+1 ms s p #f+1. 3.3) δe D,ms ( #e, x) = { #e+1, #e+1 s, + 1 #e+1 } ad 0 < β(x, w [ #e ]) The proof that η 1 δe D,ms (η 1, x)(η 1 ms s η 2) s aalogous to the proof 3.2). 3.4) δe D,ms ( #e, x) = { #e+1 } ad = p ad e <. Lke 1.4) we prove that η 1 δe D,ms (η 1, x)(η 1 ms s η 2). 3.5) δe D,ms ( #e, x) = φ Obvously ths case s mpossble. Proposto 15 Let χ {ɛ, t, ms}. Let w Σ, N, A ND,χ (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ > ad A D,χ (w) =< Σ, Q D,χ, I D,χ, F D,χ, δ D,χ >. The L(A ND,χ (w)) L(A D,χ (w)). Proof Let x 1...x k L(A ND,χ (w)) 1) x 1...x k = ɛ. Let π 0, π 1,..., π r Q ND,χ, r N be such states that π 0 = 0 #0, < π 0, ɛ, π 1 > δ ND,χ, < π 1, ɛ, π 2 > δ ND,χ,..., < π r 1, ɛ, π r > δ ND,χ ad π r F ND,χ (t follows from ɛ L(A ND,χ (w)) that such states exst). The defto of δ ND,χ mples that π = # for 0 r. Therefore r #r F ND,χ. Obvously 25
0 #0 χ s r #r. We have from Proposto 12 that 0 #0 F ND,χ. Therefore {0 #0 } = I D,χ F D,χ ad ɛ = x 1...x k L(A D,χ (w)). 2) x 1...x k ɛ. Let π 0, π 1,..., π r Q ND,χ, r N be such states that π 0 = 0 #0, < π 0, p 1, π 1 > δ ND,χ, < π 1, p 2, π 2 > δ ND,χ,..., < π r 1, p r, π r > δ ND,χ, p Σ {ɛ} for 0 r, π r F ND,χ ad p 1 p 2...p r = x 1 x 2...x k (t follows from x 1 x 2...x k L(A ND,χ (w)) that such states exst). Let r be such that r r ad p r = x k ad p r+1 = p r+2 =... = p r = ɛ. Obvously π r χ s π r. It follows from Proposto 12 that π r F ND,χ. Let M 0 = {0 #0 } ad M +1 = δ D,χ (M, x +1 ) for = 0, 1,..., k 1. We have to prove that M k F D,χ. Let j 1 < j 2 <... < j k be such that p j1 p j2...p jk = x 1 x 2...x k ad p j Σ for 1 k. Usg ducto o we prove that π M (π χ s π j ) f 1 k. 2.1) = 1 M 1 = δ D,χ ({0 #0 }, x 1 ) = δe D,χ (0 #0, x 1 ) Let η 1 = η 2 = 0 #0 ad s = j 1 1. Therefore < 0 #0, ɛ, π 1 > δ ND,χ < π 1, ɛ, π 2 > δ ND,χ,.,..., < π s 1, ɛ, π s > δ ND,χ ad < π s, x 1, π j1 > δ ND,χ It follows from Proposto 14 that π M 1 (π χ s π j1 ). 2.2) Iducto hypothess: π M (π χ s π j ). We have to prove that π M +1 (π χ s π j+1 ). Let η 1 M ad η 1 χ s π j. Let η 2 = π j. Obvously we ca fd such s N that < η 2, ɛ, π j +1 >, < π j +1, ɛ, π j +2 >,...,. Let π δe D,χ (t follows from Proposto 14 that such π exsts). < π j+s 1, ɛ, π j+s > < π j+s, x +1, π j+1 > δ ND,χ such that π χ s π j+1 π q M δ D,χ M +1 = e (q, x +1 ) q M δ D,χ e (q, x +1 ) (η 1, x +1 ) be Therefore π M +1 (π χ s π ). Therefore π M +1 (π χ s π j+1 ). We proved that π M (π χ s π j ) f 1 k. So π M k (π χ s π jk ). π jk = π r F ND,χ. Hece π M k (π F ND,χ ). Therefore M k F D,χ ad x 1 x 2...x k L(A D,χ (w)). Proposto 16 Let χ {ɛ, t, ms}. Let w Σ, N, (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ A ND,χ q δ D,χ e (π, x). The s N η 0 η 1...η s Q ND,χ δ ND,χ δ ND,χ ). & < η 1, ɛ, η 2 > δ ND,χ > ad π Q ND,χ, x Σ ad (η 0 = π & < η 0, ɛ, η 1 > &... & < η s 1, ɛ, η s > δ ND,χ & < η s, x, q > 26
Fg. 7 Proof Proposto 16 follows drectly from the deftos of δ D,χ e ad δ ND,χ. Proposto 17 Let χ {ɛ, t, ms}. Let w Σ, N, A ND,χ (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ > ad A D,χ (w) =< Σ, Q D,χ, I D,χ, F D,χ, δ D,χ >. The L(A ND,χ (w)) L(A D,χ (w)). Proof Let x 1 x 2...x k L(A D,χ (w)). Let M 0 = {0 #0 }, M +1 = δ D,χ (M, x +1 ) for 0 k 1 ad M k F D,χ. We prove wth ducto o that π M (< 0 #0, x 1 x 2...x, π > δ ND,χ ) f 0 k. 1) = 0 < 0 #0, ɛ, 0 #0 > δ ND,χ 2) Iducto hypothess: π M (< 0 #0, x 1 x 2...x, π > δ ND,χ We have to prove that π M +1 (< 0 #0, x 1 x 2...x +1, π > δ ND,χ M +1 = (q, x +1 ) δe D,χ q M q M δ D,χ e (q, x +1 ) Let π M +1. Therefore q M (π δe D,χ (q, x +1 )). Let q be such that q M ad π δe D,χ (q, x +1 ). Therefore < 0 #0, x 1 x 2...x, q > δ ND,χ It follows from Proposto 16 that < q, x +1, π 0 #0, x 1 x 2...x +1, π > δ ND,χ. > δ ND,χ We proved that π M (< 0 #0, x 1 x 2...x, π > δ ND,χ π be such that π M k F ND,χ (sce M k F D,χ < 0 #0, x 1 x 2...x k, π > δ ND,χ ad x1 x 2...x k L(A D,χ Corollary Let χ {ɛ, t, ms}. Let w Σ, N, A ND,χ (w) =< Σ, Q ND,χ, I ND,χ, F ND,χ, δ ND,χ > ad A D,χ It follows from Proposto 17 ad Proposto 15 that L χ Lev L(A D,χ (w)). ) )... Therefore < ) f 0 k. Let such π exsts). Therefore (w)). (w) =< Σ, Q D,χ, I D,χ, F D,χ, δ D,χ >. (, w) = L(AND,χ (w)) = 27
I [SMFSCLA] we ca also fd proof that L χ Lev (, w) = L(AD,χ (w)). Proposto 18 Let χ {ɛ, t, ms}. Let N ad b {0, 1}. The 1) δe D,χ ( + t #e, b) = {j + t #f (t s) j#f (t s) δd,χ e ( #e, b)} 2) δe D,χ ( + t #e t, b) = {j + t #f (t) j#f (t) δd,χ e ( #e t, b)} 3) δe D,χ ( + t #e s, b) = {j + t #f (s) j#f (s) δd,χ e ( #e s, b)} Proof Proposto 18 follows drectly from the defto of δ D,χ e. 5 Uversal Leveshte automata. We show that for each N we ca buld fte determstc automato A,χ such way that: 1) whe χ = ɛ every ofal state of A,χ s fte set that cossts of elemets of the type I + #e ad every fal state s fte set that cossts of elemets of the type M +j #f. (Whe χ = t there are the states also elemets of the type I t + #e ad M t + j #f, whe χ = ms - of the type I s + #e ad M s + j #f ); 2) each symbol from the put alphabet for A,χ s bary vector,.e. word from the laguage {0, 1} ; 3) for every two words v 1 v 2...v k ad w from Σ we ca buld b = b 1 b 2...b k such that b {0, 1} ad b L(A,χ ) v L(A D,χ (w)),.e. b L(A,χ ) v L χ Lev (, w) (v s called symbol correspodg to the word b ). Let q0, q1,..., qk be the states of A,χ that we vst traversg A,χ wth b ad let q0 D, q1 D,..., qk D be the states of AD,χ (w) that we vst traversg A D,χ (w) wth v. We buld A,χ such way that we receve qj D whe we replace the parameters I qj wth j (f qj s ofal) or the parameters M q j wth k (f q j s fal). Ad also: qj s fal oly f qd j s fal. Notatos We use expressos of the type F (I) #e, F (I t ) #e, F (I s ) #e, F (M) #e, F (M t ) #e ad F (M s ) #e to deote correspodgly tuples of the type << λi.f (I), 0 >, e >, << λi.f (I), 1 >, e >, << λi.f (I), 2 >, e >, << λm.f (M), 3 >, e >, << λm.f (M), 4 >, e > ad << λm.f (M), 5 >, e >. A,χ. Defto 15 Let χ {ɛ, t, ms}. Let N. We defe the fte automato Σ A,χ def = < Σ, Q,χ def = {x x {0, 1} + & x 2 + 2}, I,χ, F,χ, δ,χ > We defe Is χ : 1) χ = ɛ def = {I + t #k t k & t & 0 k } I ɛ s 28
Fg. 8 I ɛ s, = 2 2) χ = t def = Is ɛ {It + t #k t + 1 + 1 k & t 2 & 1 k } I t s Fg. 9 I t s, = 2 3) χ = ms I ms s def = I ɛ s {Is + t #k t + 1 + 1 k & t 2 & 1 k } 29
Fg. 10 I ms s, = 2 We defe Ms χ : 1) χ = ɛ def = {M + t #k k t & 2 t 0 & 0 k } M ɛ s Fg. 11 M ɛ s, = 2 2) χ = t 30
Ms t def = Ms ɛ {Mt + t #k k t & 2 t 2 & 1 k } Fg. 12 M t s, = 2 3) χ = ms M ms s def = M ɛ s {Ms + t #k k t & 2 t 1 & 1 k } Fg. 13 M ms s, = 2 We defe < χ s (I χ s M χ s ) (I χ s M χ s ): 31
1) χ = ɛ I + #e < ɛ #f def s I + j #e < ɛ s j #f M + #e < ɛ #f def s M + j #e < ɛ s j #f 2) χ = t I + #e < t #f def s I + j #e < t s j #f I + #e < t #f def s I t + j #e < t s j #f t M + #e < t #f def s M + j #e < t s j #f M + #e < t #f def s M t + j #e < t s j #f t 3) χ = ms #f def I + j #e < ms I + #e < ms s I + #e < ms s M + #e < ms s M + #e < ms s #f def I s + j #f def M + j #f def M s + j #e < ms s j #f s j s #f #e < ms #e < ms s j #f s j s #f We are ready to defe I χ states ad M χ states. I χ def states M χ states = {Q Q Is χ & q 1, q 2 Q(q 1 χ s q 2 )}\{φ} def = {Q Q Ms χ & q 1, q 2 Q(q 1 χ s q 2 ) & q Q(q χ s M # ) & [, 0] q Q(M + #0 χ s q)} Q,χ def,χ def I F,χ = I χ states = {I #0 } def = M χ states M χ states {0, 1}. r (S, x) represets the char- correspodg to S ad the We defe r : (Is χ M χ s ) Σ acterstc vetor determed by the state of A ND,χ symbol correspodg to x. 1) S = I + #e or S = I t + #e or S = I s + #e r (S, x 1 x 2...x k ) def = where h = m( e + 1, k ) x ++1 x ++2...x ++h f h > 0 ɛ f h = 0! f h < 0 32
Fg. 14 r 5 (I + 1 #3, x 1 x 2...x 12 ) = x 7 x 8 x 9 2) S = M + #e or S = M t + #e or S = M s + #e r (S, x 1 x 2...x k ) def = where h = m( e + 1, ) x k++1 x k++2...x k++h f h > 0 ɛ f h = 0! f h < 0 Fg. 15 r 5 (M 4 #3, x 1 x 2...x 7 ) = x 4 x 5 x 6 33
P ɛ def = {I + #e, e Z} {M + #e, e Z} = P ɛ {I t + #e, e Z} {M t + #e, e Z} ms def P = P ɛ {I s + #e, e Z} {M s + #e, e Z} P t def We defe m : P χ N P χ. Whe from some ofal state wth word b 1 b 2...b k Σ we have to reach fal state, we use the fucto m to covert the elemets of the type I + #e to elemets of the type M + #e. Ad also, whe from some fal state we have to reach ofal state, we covert wth the fucto m the elemets of the type M + #e to elemets of the type I + #e. 1) χ = ɛ 2) χ = t 3) χ = ms m (S, k) def = m (S, k) def = m (S, k) def = { M + + + 1 k #e f S = I + #e We defe m : P (P χ ) N P (P χ ): m (A, x) def = {m (a, x) a A} I + 1 + k #e f S = M + #e M + + + 1 k #e f S = I + #e I + 1 + k #e f S = M + #e M t + + + 1 k #e f S = I t + #e I t + 1 + k #e f S = M t + #e M + + + 1 k #e f S = I + #e I + 1 + k #e f S = M + #e M s + + + 1 k #e f S = I s + #e I s + 1 + k #e f S = M s + #e We defe also f : (Is χ M χ s ) N {true, false}. Let A be some ofal state. We wat to fd the state A reached from A wth the symbol b = b 1 b 2...b k. Frst usg A ad b we fd ew set B that cossts of elemets of the type I + #e. B s a caddate to be A. But f f (S, k) = true for some elemet S from B, B s ot good caddate ad A = m (B, k). If for each elemet S from B we have that f (S, k) = false B s good caddate ad A = B. I A ND,χ (w) a state #e s fal f e <= ( w ).e. f the state s o the rght of the dagoal y = x ( w ). For ofal state A,χ (w) the dagoal correspodg to y = x ( w ) s I + k 2 + t #t (0 t ), f k < 2 + 2 (k s the legth of the put symbol b). I A D,χ (w) there s o ofte state that has a elemet o the rght of the dagoal y = x ( w ). Aalogously A,χ the trasto fucto δ,χ s ot defed for ofal state ad symbol b 1 b 2...b k f the ofal state has a elemet of the type I + #e o the rght of the dagoal I + k 2 + t #t. (The caddate B has such a elemet S oly f f (S, k) = true.) The oly oe excepto s {I #0 } - the tal 34
state of A,χ. Ths state s ofal but A D,χ (w) ts correspodg state {0 #0 } may be fal. For each fal state of A,χ the dagoal correspodg to y = x ( w ) cossts of the elemets M + t #t (0 t ) ad the trasto fucto δ,χ s ot defed for a fal state whose elemets of the type M + #e are o the rght of the dagoal M + t #t. (S s o the rght of the dagoal M + t #t oly f f (S, k) = true.) 1) S = I + #e or S = I t + #e or S = I s + #e f (S, k) def = { true f k 2 + 1 & e + 2 + 1 k f alse otherwse 2) S = M + #e or S = M t + #e or S = M s + #e f (S, k) def = { true f e > + f alse otherwse We defe I χ : P (Q ND,χ ) P (P χ ): 1) χ = ɛ I ɛ (A) def = {I + 1 #e #e A} 2) χ = t I t (A) def = {I + 1 #e #e A} {I t + 1 #e #e t A} 3) χ = ms I ms (A) def = {I + 1 #e #e A} {I s + 1 #e #e s A} We defe M χ : P (Q ND,χ ) P (P χ ): 1) χ = ɛ M ɛ (A) def = {M + #e #e A} 2) χ = t M t (A) def = {M + #e #e A} {M t + #e #e t A} 3) χ = ms M ms (A) def = {M + #e #e A} {M s + #e #e s A} We defe rm : I χ states M χ states Is ɛ M ɛ s : rm(a) def = { I + #e f A I χ states & e = µz[z = e & I + #e A] M + #e f A M χ states & e = µz[z = e & M + #e A] The elemet rm(a) s called rght-most elemet of A. To kow whether we have to covert wth the fucto m the caddate B that we receve from some state ad put character b 1 b 2...b k, t s suffce to check the value f (rm(b), k) because for each ofal state A ad each k t s true that f (rm(a), k) = false S A(S = I + #e for some ad e f (S, k) = false) ad for each fal state C t s true that f (rm(c), k) = true S C(S = M + #e for some ad e f (S, k) = true),.e. t s o matter whether the type of the elemets of the caddate B s I + #e or t s M + #e - f f (rm(b), k) = true 35
the B s ot good caddate ad f f (rm(b), k) = false the B s good. δ,χ e We defe the fucto of the elemetary trastos : (Is χ M χ s ) Σ I χ states M χ states {φ}: 1) Let S = I + #e or S = I t + #e or S = I s + #e. We defe δe,χ 1.1)!r (S, x)!δ,χ e (S, x) 1.2)!r (S, x) δe,χ (S, x) def = I χ (δ D,χ e ( #e, r (S, x))) f S = I + #e I χ (δ D,χ e ( #e t, r (S, x))) f S = I t + #e I χ (δ D,χ e ( #e s, r (S, x))) f S = I s + #e (S, x): 2) Let S = M + #e or S = M t + #e or S = M s + #e. We defe δe,χ (S, x): 2.1)!r (S, x)!δe,χ (S, x) 2.2)!r (S, x) δe,χ (S, x) def = M χ (δ D,χ e ( #e, r (S, x))) f S = M + #e M χ (δ D,χ e ( #e t, r (S, x))) f S = M t + #e M χ (δ D,χ e ( #e s, r (S, x))) f S = M s + #e We defe : P (P (I χ s )) P (P (M χ s )) P (I χ s ) P (M χ s ): A def = {π π A & π A(π < χ s π)} We dfe a : I χ states M χ states P (N). Ths fucto s used for checkg whether the legth of the word b 1 b 2...b k s sutable to defe the trasto fucto δ,χ 1) Let Q I χ states 1.1) Q = {I #0 }. If k a (Q) the!δ,χ (Q, b 1 b 2...b k ). a (Q) def = {k k 2 + 2} 1.2) Q {I #0 } Let rm(q) = I + #e a (Q) def = {k 2 + e + 1 k 2 + 2} 36
Fg. 16 = 5, a ({I 2 #2, I 1 #2, I + 1 #3 }) = {9, 10, 11, 12} The legth k of the put charcter x 1 x 2...x k must be such that all elemets of the type I + #e to be o the left of the dagoal I + k 2 + t #t. 2) Let Q M χ states a (Q) def = {k N π Q(f(k <, M # k, M + k #0 ) χ s π)}\{0} 37
Fg. 17 = 5, a ({M 4 #2, M 2 #3, M 1 #3 }) = {7, 8, 9} We are ready to defe the trasto fucto δ,χ Let Q Q,χ ad x Σ. 1) x a (Q)!δ,χ (Q, x) 2) x a (Q) 2.1) q Q δ,χ e (q, x) = φ!δ,χ (Q, x) 2.2) q Q δ,χ e (q, x) φ Let = q Q δ,χ e (q, x). : Q,χ Σ Q,χ. { δ,χ (Q, x) def f f (rm( ), x ) = false = m (, x ) f f (rm( ), x ) = true I what follows we suppose that I χ states = {A x Σ (δ,χ ({I #0 }, x) = A) & A Is χ } ad M χ states = {A x Σ (δ,χ ({I #0 }, x) = A) & A Ms χ },.e. we cosder that A,χ has o state that caot be reached from {I #0 }. Defto of A,ɛ s gve [MSFASLD]. The three automata A,ɛ 1, A,t 1 ad A,ms 1 are depcted resp. o fg. 18, fg. 19 ad fg. 20. I these fgures x ca be terpreted as 0 or 1 ad the expressos brackets are optoal. For stace from {I #1, I + 1 #1 } wth x10(x) we ca reach {I #1 }. Ths meas that from {I #1, I + 1 #1 } we ca reach {I #1 } wth 010, 110, 0100, 0101, 1100 ad 1101. 38
Fg. 18 A,ɛ 1 39
Fg. 19 A,t 1 40
Fg. 20 A,ms 1 Defto 16 Let N ad $ Σ. def def w +1 = w +2 =... def def = w 0 = $ 41
s : Σ N + (Σ {$}) s (w, ) def = where v = m( w, + + 1). h : Σ Σ + Σ h (w, x 1 x 2...x t ) def = { w w +1...w v f v! f v < { β(x1, s (w, 1))β(x 2, s (w, 2))...β(x t, s (w, t)) f t w +! f t > w + We gve a example how A,χ ca be used. Let w = abcabb ad x = dacab. We wat to kow whether x L χ Lev (3, w). We fd b = h 3(w, x) = b 1 b 2...b 5. b 1 = β(x 1, s 3 (w, 1)) = β(d, $$$abcab) = 00000000, b 2 = β(x 2, s 3 (w, 2)) = β(a, $$abcabb) = 00100100, b 3 = β(x 3, s 3 (w, 3)) = β(c, $abcabb) = 0001000, b 4 = β(x 4, s 3 (w, 4)) = β(a, abcabb) = 100100 ad b 5 = β(x 5, s 3 (w, 5)) = β(b, bcabb) = 10011. x L χ Lev (w, 3) b L(A,χ 3 ). Proposto 19 Let χ {ɛ, t, ms}. Let w Σ, x Σ +, N +,!h (w, x), b = h (w, x) ad b = x = t. Let q,χ 0 = {I { #0 } ad δ +1 =,χ (q,χ, b +1 ) f!q,χ &!δ,χ! otherwse q,χ (q,χ, b +1 ) for 0 t 1. Let w = p. Let s : [0, t] N ad Let A D,χ (w) =< Σ, Q D,χ s() def = { p f q,χ f q,χ F,χ F,χ, I D,χ, F D,χ, δ D,χ >. Let q D,χ 0 = {0 { #0 } ad δ +1 = D,χ (q D,χ, x +1 ) f!q D,χ &!δ D,χ! otherwse q D,χ (q D,χ, x +1 ) for 0 t 1. Let d : (Is χ M χ s ) N Q ND,χ ad 1) whe χ = ɛ d(i + #e, z) def = z + #e ad d(m + #e, z) def = z + #e 2) whe χ = t d(i + #e, z) def = z + #e, d(m + #e, z) def = z + #e, d(i t + #e, z) def = z + #e t ad d(m t + #e, z) def = z + #e t 42