Génértion létoire uniforme pour les réseux d utomtes Niols Bsset (Trvil ommun ve Mihèle Sori et Jen Miresse) Université lire de Bruxelles Journées Alé 2017 1/25
Motivtions (1/2) p q Automt re omni-present in omputer siene. Given regulr lnguge, it is nturl to sk wht does typil word of fixed length n look like? wht does n infinite typil word look like? The literture provides nswer sed on Uniform smpling (from omintoris); Mximl entropy mesure (from informtion & ergodi theory) when deterministi finite stte utomton (DFA) reognising the lnguge is provided. These methods re polynomil in the size of the given DFA. 2/25
Motivtions (2/2) Automt in verifition of onurrent systems Computtionl systems (softwre or hrdwre) re often omposed of severl omponents tht intert together; Networks of utomt re n elegnt nd useful frmework to model onurrent systems; The ssoited produt utomton A = A 1 A K is of exponentil size A = A 1 A K. In this tlk we will see how to do uniform smpling of words of given length; smpling ording to the mximl entropy mesure; for network of DFAs in ompositionl fshion. A previous work on the sujet y [Denise et l., STTT 2012] gives pplitions to model sed testing. 3/25
Monolithi methods of smpling for single DFA ( rep) Compositionl methods of smpling for Network of DFAs Conlusion nd perspetive 4/25
Uniform smpling of words of n utomton (1/3). Fixed length. Reursive Method. 1 5/8 3/8 p q 5/8 3/8 3/5 2/5 1 3/8 2/8 3/8 2/3 1/3 1 2/3 1/3 2/8 1/8 2/8 2/8 1/8 1/2 1/2 1 1/2 1/2 1/2 1/2 1 1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8 Lnguges L p,k Crdinlities L p,k Proilities p k (p q) = L q,n k L p,n k+1 ( Lp,k L q,k L p,k = L p,k 1 L q,k 1 ; L q,k = L p,k 1. L p,k = L p,k 1 + L q,k 1 ; L q,k = L p,k 1. ) ( ) ( ) Lp,k 1 = M = M k 1 with M = L q,k 1 1 ( 1 1 1 0 ). 5/25
Uniform smpling of words of n utomton (2/3). Rndom length. Boltzmnn Smpling [Duhon, Fljolet, Louhrd, Sheffer, ICALP 02]. z, z 2, p q 1 z z 2, ε STOP z 1 z 2, 1 z 1 z 2, ε Generting funtion : L p(z) = w L p z w = 1 1 z z 2 with z < 1 φ. Pro of word w : Pro(w) = z w L p(z). Lnguges L p Generting funtions L p(z) Proilities p z() = z Lq(z) L p(z) L p = L p L q {ε}; L q = L p {ε}. L p (z) = zl p (z)+zl q (z)+1; L q (z) = zl p (z)+1. L(z) = zml(z)+1 F ; L(z) = (I zm) 1 1 F. 6/25
Uniform smpling of words of n utomton (3/3). Infinite length. Prry smpling. 1 φ, 1 φ 2, p q 1, For strongly onneted utomton. Defined y Shnnon, known s Prry mesure in ergodi theory. Here, we ll it Boltzmnn riti. ω-regulr Lnguges L p,ω Perron eigenvetor v Proilities p 1 ρ () = vq ρv p L p,ω = L p,ω L q,ω ; L q,ω = L p,ω. ρv p = v p +v q ; ρv q = v p ve ρ v.p. mximle. ρv = Mv. 7/25
Monolithi methods of smpling for single DFA ( rep) Compositionl methods of smpling for Network of DFAs Conlusion nd perspetive 8/25
Network of DFAs A network of three DFAs with shred tions {,}, β 1 2 1 1 2, d 3 2 γ 3 Exmple of words reognised: γd 9/25
Network of DFAs A network of three DFAs with shred tions {,}, β 1 2 1 1 2, d 3 2 γ 3 Exmple of words reognised: γd 9/25
Network of DFAs A network of three DFAs with shred tions {,}, β 1 2 1 1 2, d 3 2 γ 3 Exmple of words reognised: γd 9/25
Network of DFAs A network of three DFAs with shred tions {,}, β 1 2 1 1 2, d 3 2 γ 3 Exmple of words reognised: γd 9/25
Network of DFAs A network of three DFAs with shred tions {,}, β 1 2 1 1 2, d 3 2 γ 3 Exmple of words reognised: γd 9/25
Network of DFAs A network of three DFAs with shred tions {,}, β 1 2 1 1 2, d 3 2 γ 3 Exmple of words reognised: γd 9/25
Network of DFAs A network of three DFAs with shred tions {,}, β 1 2 1 1 2, d 3 2 γ 3 Exmple of words reognised: γd β The produt DFA: 211 111 112, 212 313 d 311 221 121 321 122 222 γ 323 d 9/25
The esy se: no shred tion Lnguge of the produt = shuffle of lnguges. L(A (1) A (K) ) = L(A (1) ) L(A (K) ) Shuffle of lnguges Shuffle of words d = {d,d,d,d,d} Shuffle of two lnguges: L (1) L (2) = w (1) w (2) (w (1),w (2) ) L (1) L (2) Nturlly extends to K lnguges. 10/25
Computing the rdinlities of shuffle of lnguges For the shuffle of two lnguges n (L L ) n = k=0 ( n k ) L k L n k. (1) For the shuffle of K lnguges L = L (1) L (K) Do not use L n = n (1) + +n (K) =n ( ) n n (1),...,n (K) L (1) L (K) n (1) n (K) There re exponentilly mny oeffiients! Insted pply eqution (1) K 1 times L = (...((L (1) L (2) ) L (3) ) ) L (K). This n e trnsformed into reursive method of smpling for L = L (1) L (K). 11/25
Generting funtions for shuffle of lnguges Exponentil generting funtions ˆL(z) = n N L n z n /n! Exponentil Boltzmnn mesure ˆµ z (w) = z w w!ˆl(z) Given L = L (1) L (K), L(z) = + 0 e uˆl(zu)du ˆL(z) = ˆL (1) (z) ˆL (K) (z) Boltzmnn smpler of prmeter z for L Choose u ording to weight funtion: u e uˆl(zu) = e u K i=1 ˆL (i) (zu); For i = 1 to K, let w (i) e hosen using n exponentil Boltzmnn smpler of prmeter zu for L (i). Return word uniformly t rndom in w (1) w (K) 12/25
Shnnon Prry-Mrkov hin for the shuffle of lnguges Rep of the definition P(p q) = v q /(ρv p ) with Mv = ρv Lemm Let A = A (1) A (K) e the produt of K strongly onneted DFAs without synhronistion. Then ρ = n i=1 ρ(i), v s = K i=1 v(i). s (i) The smpling ording to the Shnnon-Prry Mrkov hin Repet forever the following: With proility ρ (i) /ρ mke one step (s (i),,t (i) ) of the Shnnon-Prry Mrkov hin numer i, write on the output tpe; 13/25
Diffiulties ome from synhronistion Rep no shred tions=shuffle of lnguges=everything is esy; All letters shred Lnguge of the produt = intersetion of lnguges : L(A (1) A (K) ) = L(A (1) ) L(A (K) ) L(A (1) ) L(A (K) )? = is PSPACE-omplete prolem. In our frmework We introdue the redued utomton: It keeps only the synhronised prt of the produt utomton (the true diffiulty tht needs sequentil resoning). The non-synhronised prt is projeted out (esy to tret y omining independent lol works). 14/25
The redued utomton The redued utomton of DFA A = (Q,Σ,ι,F,δ) is finite utomton A red = (Q red,σ red,ι red,f red, red) suh tht Q red Q re sttes ourring just fter shred tion + initil stte ι; Σ red set of shred tion; ι red = ι (sme initil stte); Finl sttes F red irrelevnt red = {(s,,t) s u t for some u (Σ\Σ red) } β 211 111 112, 212 313 d 311 111 β γ 112 323 221 121 321 122 222 γ 323 311 313 d Do not ompute A red from the produt DFA A = A 1 A K ut use A red = A 1 red AK red. 15/25
Lnguges ssoited to the redued utomton Given DFA A nd its redued utomton A red. L s : lnguge from stte s without shred tion. L δ = {u (Σ\Σ red ) s u t}, for δ = (s,,t) red These lnguge re otined y modifying slightly the utomton. Exmple L 111 nd L (112,γ,323) β 211 111 112, 212 313 d 311 111 β γ 112 323 221 121 321 122 222 γ 323 311 313 d In ft, ompute everything lolly nd use shuffle of lnguges: L (112,γ,323) = L (1) (1,γ,3) L (2) (1,γ,2) L (3) (3,γ,3) = () ε. 16/25
Equtions on lnguges relted to the redued utomton Theorem: Equtions on lnguges L s = L s L δ L t δ=(s,,t) red L s = K i=1 L (i) s (i) ; L δ = K i=1l (i) δ (i) Our generi reipe to rndomly generte word w L s Choose whether synhronistion will our or not; if not hoose w L s = K (i) i=1 L ; otherwise s (i) hoose δ = (s,,t) red ; hoose u L δ = K i=1 L(i) δ (i) ; write u nd repet from t to generte the rest of the word. 17/25
Our generi reipe to rndomly generte word w L s,n (1/3) Fixed length uniform smpling 1. Choose whether synhronistion will our or not; No synhronistion with proility L s,n / L s,n. if not hoose w L s = K (i) i=1 L ; otherwise s (i) 2. hoose δ = (s,,t) red ; hoose the length m with weight δ=(s,,t) red L δ,m 1 n m=1 δ=(s,,t) red L δ,m 1 ; hoose δ = (s,,t) red with weight L δ,m 1 δ =(s,,t ) L δ,m 1 ; 3. hoose u L δ,m 1 = K i=1 L(i) δ (i),m 1 ; 4. write u nd repet from t to generte the rest of the word of length n m. 18/25
Our generi reipe to rndomly generte word w L s (2/3) Boltzmnn smpling Rep: L s (z) = L s (z)+z L δ (z)l t (z). (2) δ=(s,,t) red 1. Choose whether synhronistion will our or not; No synhronistion with proility L s (z)/l s (z). if not hoose w L s = K (i) i=1 L using Boltzmnn smpling s (i) with prmeter z; otherwise 2. hoose δ = (s,,t) red with proility L δ (z)l t (z) δ =(s,,t ) red L δ (z)l t (z) 3. hoose u L δ = K i=1 L(i) δ (i) with proility z u /L δ (z) using Boltzmnn smpling with prmeter z; 4. write u nd repet from t to generte the rest of the word. 19/25
Our generi reipe to rndomly generte word w L s,ω (3/3) Prry smpling Assume the produt utomton is strongly onneted nd let v 0 nd ρ suh tht Mv = ρv. 1. A synhronistion ours in the future with proility 1; 2. hoose δ = (s,,t) red with proility L δ (1/ρ) v t ρv s 3. hoose u L δ = K i=1 L(i) δ (i) with proility 1 ρ u L δ (1/ρ) using Boltzmnn smpling with prmeter 1/ρ; 4. write u nd repet from t to generte the rest of the word. 20/25
Chrteristion of the generting funtions in the redued utomton Rep equtions on lnguges: L s = L s L δ L t (3) δ=(s,,t) red Theorem: Equtions on generting funtions L s (z) = L s (z)+z L δ (z)l t (z) δ=(s,,t) red In mtrix form Let M(z) e the Q red Q red mtrix defined y M s,t (z) = δ=(s,,t) red L δ (z) (4) L(z) = L(z)+zM(z)L(z); then L(z) = (I zm(z)) 1 L(z) (5) 21/25
Computing rdinlities for ll lnguges Let n e the length of words to smple. Lnguges without synhronistion ( L s,m ) m n,s Qred nd ( L δ,m ) m n,δ red See efore, shuffle of lnguges. Polynomil in n nd K. Lnguges with synhronistions ( L s,m ) m n,s Qred Write L s (z) mod z n+1 = n m=0 L s,m z m nd M s,t (z) mod z n+1 = n m=0 δ=(s,,t) red L δ,m z m Find L(z) mod z n+1 y tking ll opertions modulo z n+1 in Polynomil in n nd A red. L(z) = (I zm(z)) 1 L(z). 22/25
A Perron Froenius Theorem for the redued utomton Let A e produt utomton tht is strongly onneted nd A red its redued utomton. Spetrl ttriutes of the mtrix M(z) Given λ C nd v 0. If M(1/λ)v = λv then λ is lled redued eigenvlue nd v redued eigenvetor. Theorem Existene of ρ nd v red : There exists redued eigenvlue ρ > 0 suh tht λ ρ for every redued eigenvlue λ. There exists unique v red 0 (up to multiplitive onstnt) whih is redued eigenvetor. It stisfies M(1/ρ)v red = ρv red. Link with A nd its djeny mtrix M ρ is the spetrl rdius of M v red is the restrition to Q red of the unique eigenvetor v 0 (it stisfies Mv = ρv) 23/25
Monolithi methods of smpling for single DFA ( rep) Compositionl methods of smpling for Network of DFAs Conlusion nd perspetive 24/25
Wht we hve seen A rep in the monolithi se of Uniform smpling Boltzmnn smpling Smpling ording to Shnnon-Prry Mrkov hin nd their link to entropy Compositionl methods for these smpling for network of DFAs sed on the notion of redued utomt. Possile further works Preise study of numeril omputtions (e.g. for finding redued spetrl rdius). Design of lgorithms with etter it omplexity. Implementtions nd pplitions to sttistil model heking; model sed testing. Extension of the theory to weighted utomt. Extension of the theory to timed utomt. 25/25