Design and Analysis of Distributed Interacting Systems

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Design and Analysis of Distributed Interacting Systems"

Transcription

1 Design nd Anlysis of Distriuted Intercting Systems Lecture 6 LTL Model Checking Prof. Dr. Joel Greenyer My 16, 2013

2 Some Book References (1) C. Bier, J.-P. Ktoen: Principles of Model Checking. The MIT Press, E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

3 Some Book References (2) J. Mgee, J. Krmer: Concurrency: Stte Models nd Jv Progrms. John Wiley & Sons, 2nd Edition, B. Bérrd, M. Bidoit, A. Finkel, F. Lroussinie, A. Petit, L. Petrucci, Ph. Schnoeelen, P. McKenzie: Systems nd Softwre Verifiction Model-Checking Techniques. Springer-Verlg,

4 Some Book References (3) Stephn Kleuker: Formle Modelle der Softwreentwicklung: Model- Checking, Verifiktion, Anlyse und Simultion. Vieweg+Teuner Verlg, G.J. Holzmnn: The SPIN model checker - Primer nd Reference Mnul. Addison Wesley,

5 Some Book References (4) Klus Pohl: Requirements Engineering. dpunkt.verlg GmH, 2nd edition, Axel vn Lmsweerde: Requirements Engineering: From System Gols to UML Models to Softwre Specifictions. John Wiley & Sons,

6 Lst Time: Promel nd Spin mtype = {press, hold}; chn c = [0] of { mtype }; ctive proctype switch(){ RELEASED: if :: c!press; goto PRESSED fi; PRESSED: if :: c!hold; goto PRESSED :: goto RELEASED fi; } (this is possile pttern to model stte mchines in Promel) ctive proctype light(){ OFF: if :: c?press; goto LOW fi; LOW: if :: c?press; goto OFF :: c?hold; goto HIGH fi; HIGH: if :: c?press; goto OFF :: c?hold; goto LOW fi; } 6

7 Spin Verifiction more Techniclly... 1 yte x, y; 2 ctive proctype mini(){ 3 do 4 :: (x < 2) -> 5 x++ 6 :: (y < 2) -> 7 y++ 8 :: else -> 9 rek 10 od 11 } Promel model C progrm Output -4:-4:-4 1:1:17 2:1:23 3:0:0 4:1:17 5:0:4 6:1:21 7:1:23 Spin settings Error Trce 7

8 Spin Models nd Kripke Structures A Spin model cn e trnslted to Kripke Structure dt types, chnnels, mx. no. of processes is finite Spin cn do n exhustive nlysis of the corresponding KS Spin constructs KS on-the-fly, i.e., sometimes it finds results without constructing the complete KS 1 yte x, y; 2 ctive proctype mini(){ 3 do 4 :: (x < 2) -> 5 x++ 6 :: (y < 2) -> 7 y++ 8 :: else -> 9 rek 10 od 11 } (_, 3, 0, 0) x<2 y<2 (0, 5, 0, 0) (0, 7, 0, 0) x++ y++ (0, 3, 1, 0) (0, 3, 0, 1)... x<2 y<2 (0, 5, 0, 1)... (0, 7, 0, 1)... 8

9 ... #define trinoncrossing 3 #define croncrossing 2... Assertions ctive proctype trin(){ yte stte;... } ctive proctype cr(){ yte stte;... } during the exhustive stte spce explortion during model checking, ll possile interlevings of the other processes nd executing this ssertion will e checked when is this ssertion executed? ctive proctype Inv(){ ssert(!(trin:stte == trinoncrossing && cr:stte == croncrossing)) } 9

10 Verify LTL Properties mtype = {press, hold}; chn c = [0] of { mtype }; ctive proctype switch(){ RELEASED: if :: c!press; goto PRESSED fi; PRESSED: if :: c!hold; goto PRESSED :: goto RELEASED fi; } [] stnds for G (lwys), <> stnds for F (eventully),! is ctive proctype light(){ OFF: if :: c?press; goto LOW fi; LOW: if :: c?press; goto OFF :: c?hold; goto HIGH fi; HIGH: if :: c?press; goto OFF :: c?hold; goto LOW fi; } ltl p0 {[]<> ltl p1 {[]<> 10

11 Never-Clim Sequence of Boolen expressions over vriles in the model tht must never hppen Simple exmple: yte x = 3; ctive proctype P(){ x = 1; } never{ x == 3; x == 1 } The never-clim reches its end nd the verifiction will thus report violtion. 11

12 Never-Clim... ctive proctype light(){ OFF: if :: c?press; goto LOW fi; LOW: if :: c?press; goto OFF :: c?hold; goto HIGH fi; HIGH: if :: c?press; goto OFF :: c?hold; goto LOW fi; } never { true; true; } I didn't explin this thoroughly. 12

13 Never-Clims Why should I other? If I know how to specify interesting properties in LTL, why should I other progrmming never-clims? Spin checks LTL properties y first converting them to neverclims understnding never-clims helps understnding how Spin checks LTL properties Never-clims re more verose thn LTL formule, ut they re lso more powerful e.g., you cn count (up to finite numers) in never-clims 13

14 The Never Clim Checking Process Initilizing glol vriles Initilize init nd ctive processes [never-clim terminted] counter-exmple found Initilize locl process vriles [never-clim not terminted] [model cnnot mke step] [never-clim cn mke step] never-clim mkes step [never-clim cnnot mke step] no counter-exmple model mkes step [model cn mke step] [no cceptcycle found] [ccept-cycle found] counter-exmple found dopted from: Stephn Kleuker: Formle Modelle der Softwreentwicklung: Model-Checking, Verifiktion, Anlyse und Simultion. Vieweg+Teuner Verlg,

15 model mkes step ctive proctype light(){ OFF: if :: c?press; goto LOW fi; LOW: if :: c?press; goto OFF :: c?hold; goto HIGH fi; HIGH: if :: c?press; goto OFF :: c?hold; goto LOW fi; } Never-Clim never { true; true; } 4. model mkes step not shown here) 6. model mkes step 1. true cn lwys mke step 3. Cn now mke this step 5. Mkes step 7. Mkes step nd termintes, never clim violted. 15

16 Another Never-Clim Exmple Lels of the form ccept[-za-z0-9_]* mrk cceptnce cycles it must not e possile to visit these lels infinitely often Wht is specified here? Non-determinisit choice rememer: ll possiilities will e explored during verifiction run. T0_init: if :: (! -> goto ccept_s4 :: true -> goto T0_init fi; ccept_s4: if :: (! -> goto ccept_s4 fi; } 16

17 Design nd Anlysis of Distriuted Intercting Systems Lecture 6 LTL Model Checking Prof. Dr. Joel Greenyer My 16, 2013

18 Model-Checking modify Model (Kripke structure) flse + counter exmple (how the specifiction cn e violted) Model Checking true Specifiction (LTL) 18

19 Automt-sed LTL Model Checking There re different techniques for checking LTL properties i.e. checking whether M φ One is sed on Büchi Automt (BA) utomt tht ccept infinite words Approch: (Be M Kripke structure over AP) iff iff iff iff M φ L(M) L(φ) L(M) ((2 AP ) ω \ L(φ)) = L(M) L( φ) = L(B M B φ ) = Wht we need: 1. Checking emptyness of the lnguge ccepted y BA 2. Product construction for BAs 3. Represent KS s BA 4. Represent LTL formul s BA 19

20 Agend 1. Introduce Büchi Automt 2. Checking emptyness of the lnguge ccepted y BA 3. Product construction for BAs 4. Represent KS s BA 5. Represent LTL formul s BA 20

21 Büchi Automt A Büchi utomton is tuple BA = (Q, Σ, T, I, F) in which Q is finite, non-empty set of sttes Σ is finite lphet T Q Σ Q is trnsition reltion I Q is set of initil stte F Q is set of finl sttes (lso clled ccepting sttes) (Syntcticlly the sme s finite-stte utomton) An infinite word π Σ ω is ccepted y BA iff the BA hs corresponding run ( pth strting from n initil stte), tht infinitely often visits finl sttes. Such run is lso clled n ccepting run Exmple: Infinitely often, Σ = {, } 21

22 Büchi Automt There re other kinds of utomt for infinite words Rin utomt Muller utomt Street utomt they ll ccept the clss of ω-regulr lnguges Note: Not ll lnguges ccepted y non-deterministic Büchi utomton re ccepted y deterministic one exmple: words with finitely mny s cnnot e represented y deterministic BA, 22

23 Agend 1. Introduce Büchi Automt ( ) 2. Checking emptyness of the lnguge ccepted y BA 3. Product construction for BAs 4. Represent KS s BA 5. Represent LTL formul s BA 23

24 Checking Emptyness An ccepting run must visit t lest one ccepting stte infinitely often How do we determine the existence of n ccepting run? An ccepting stte must thus pper in cycle rechle from strt stte. 24

25 Find Accepting Runs SCC-Bsed Approch Compute ll strongly connected components (SCCs) Check whether non-trivil SCC contins n ccepting stte nd whether it is rechle from strt stte Def.: Sttes C Q form strongly connected component iff for ll q, q' C: q is rechle from q' There is no C' C for which this is true (C is mximl) An SCC is trivil iff C = 1 nd for q C: (q, σ, q) T, σ Σ non-trivil SCCs? Trjn's lgorithm, liner in the size of the grph, rechiliy s well, thus overll: Ο( Q + T ) 25

26 Find Accepting Runs Another Ide: DFS Strt depth first serch from n initil stte of the BA rememer DFS: uses stck for cktrcking when from stte q n edge is found to stte q' tht is currently on the stck, cycle is found the cycle is long the sttes on the stck from of q' to q If one of these sttes is ccepting, there is n ccepting run long the stte on the stck, nd then repeting in the cycle An edge to stte on the stck is clled ckwrd edge If DFS finds no ckwrd edges, then the BA is cyclic Prolem: When we find cycle, we must lwys check if it contins n ccepting stte this is expensive, we re not nymore liner in the size of the utomton. 26

27 Find Accepting Runs Nested DFS Ide: Two DFSs, clled lue (outer) nd red (inner) DFS ech DFS visits stte t most once, coloring it lue/red Strt lue DFS from strt stte if lue DFS finds n ccepting stte q, strt red DFS from q if red DFS finds non-empty pth from q to q, report cycle, n ccepting run is found: current stck of lue DFS + cycle otherwise continue lue DFS (from q) 27

28 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 28

29 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 29

30 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 30

31 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 31

32 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 32

33 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 33

34 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 34

35 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 35

36 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; 36

37 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 37

38 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 38

39 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 39

40 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 40

41 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 41

42 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 42

43 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 43

44 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 44

45 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 45

46 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 46

47 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 47

48 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 48

49 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 49

50 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; seed 50

51 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; report cycle! q' = seed 51

52 Find Accepting Runs Nested DFS procedure nested_dfs(ba ) forll q 0 I cll dfs_lue(q 0 ); procedure dfs_lue (Stte q) q.lue := true; if q'.lue then cll dfs_lue(q'); if q F then seed := q; cll dfs_red(q); seed procedure dfs_red (Stte q) q.red := true; if q'.red then cll dfs_red(q'); else if q' = seed then report cycle; lterntive: report cycle erlier, when dfs_red() encounters stte tht is on dfs_lue() stck requires extr dt structure for tht stck. 52

53 SCC-sed- vs. Nested DFS Approch SCC-sed pproch: finds shorter ccepting runs why is this good? Good ecuse these re the counter-exmples tht help us understnd how property is violted Nested DFS pproch: etter suited for on-the-fly emptyness checks BA is constructed while exploring it ccepting runs my e found efore whole BA is explored/constructed Spin uses modified version of the Nested DFS lgorithm see: G. J. Holzmnn, D. A. Peled, nd M. Ynnkkis. On nested depth first serch. In Proc. 2nd SPIN Workshop, pges 23 32, Further work on efficient emptyness checking see: A. Giser, S. Schwoon: Comprison of Algorithms for Checking Emptiness on Büchi Automt. Proc. of Workshop on Mthemticl nd Engineering Methods in Computer Science, MEMICS

54 Agend 1. Introduce Büchi Automt ( ) 2. Checking emptyness of the lnguge ccepted y BA ( ) 3. Product construction for BAs 4. Represent KS s BA 5. Represent LTL formul s BA 54

55 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y visited ccepting stte of first BA visiting lso ccepting stte of second BA reset counter keep vlue of counter from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

56 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1 off r 2 q 1 off q 2 from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

57 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1,q 2,? r 1 off r 2 q 1 off q 2 from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

58 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1,q 2,1 r 1 off r 2 q 1 off q 2 from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

59 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1,q 2,1 r 1 off r 2 q 1 off q 2 from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

60 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1,q 2,1 r 1 off r 2 q 1 off q 2 r 2,q 1,2,? from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

61 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1,q 2,1 r 1 off r 2 q 1 off q 2 r 2,q 1,2 from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

62 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1,q 2,1 r 1 off r 2 q 1 off q 2 ll sttes with 2 s the third r 2,q 1,2 component re ccepting from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

63 Product Construction for BA Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) Building n utomton B 1 B 2 tht ccepts L(B 1 ) L(B 2 ): B 1 B 2 = (Q 1 Q 2 {0, 1, 2}, Σ, T, I 1 I 2 {0}, Q 1 Q 2 {2}) we hve ((r i, q j, x), σ, (r m, q n, y)) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 x = 0 nd r m F 1, then y = 1 r 1,q 1,0 x = 1 nd q n F 2, then y = 2 x = 2 then y = 0 otherwise x = y r 1,q 2,1 r 2,q 1,0 r 1 off r 2 q 1 off q 2 r 2,q 1,2 r 1,q 2,0 from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

64 Agend 1. Introduce Büchi Automt ( ) 2. Checking emptyness of the lnguge ccepted y BA ( ) 3. Product construction for BAs ( ) 4. Represent KS s BA 5. Represent LTL formul s BA 64

65 Represent Kripke Structure s Büchi Automton This is quite simple n exmple: {p, q} {p} {p, q} off {p} {p} {p,q} {q} {q} {p,q} from E. Clrke, O. Grumerg, D. Peled: Model Checking. MIT Press,

66 Specil Cse for BA Product Construction Product construction cn e simplified if ll sttes of one utomton re ccepting In the cse ll sttes of the utomton of the modeled system re ccepting Given two BA B 1 = (Q 1, Σ, T 1, I 1, F 1 ) nd B 2 = (Q 2, Σ, T 2, I 2, F 2 ) if F 1 = Q 1, then B 1 B 2 is defined s follows: B 1 B 2 = (Q 1 Q 2, Σ, T, I 1 I 2, Q 1 F 2 ) we hve ((r i, q j ), σ, (r m, q n )) T iff (r i, σ, r j ) T 1 nd (q m, σ, q n ) T 2 ccepting where second utomton is ccepting oth utomt gree on trnsition, s usul 66

67 Agend 1. Introduce Büchi Automt ( ) 2. Checking emptyness of the lnguge ccepted y BA ( ) 3. Product construction for BAs ( ) 4. Represent KS s BA ( ) 5. Represent LTL formul s BA next time (in two weeks) 67

68 ICSE nd SEAMS

69 Our Pper t SEAMS chnge in requirements or environment ssumptions Specifiction S is implemented y (ssumption or requirement MSDs dded or removed) updtle sttes Specifiction S' utomted synthesis dded updte trnsitions current controller (c) removed trnsitions remins of the current controller ( c-prt ) dded controller for implementing S' ( c'-prt ) dynmiclly updting controller see 69

Formal Methods in Software Engineering

Formal Methods in Software Engineering Forml Methods in Softwre Engineering Lecture 09 orgniztionl issues Prof. Dr. Joel Greenyer Decemer 9, 2014 Written Exm The written exm will tke plce on Mrch 4 th, 2015 The exm will tke 60 minutes nd strt

More information

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan CS 267: Automted Verifiction Lecture 8: Automt Theoretic Model Checking Instructor: Tevfik Bultn LTL Properties Büchi utomt [Vrdi nd Wolper LICS 86] Büchi utomt: Finite stte utomt tht ccept infinite strings

More information

Lecture 9: LTL and Büchi Automata

Lecture 9: LTL and Büchi Automata Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

More information

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

Software Engineering using Formal Methods

Software Engineering using Formal Methods Softwre Engineering using Forml Methods Propositionl nd (Liner) Temporl Logic Wolfgng Ahrendt 13th Septemer 2016 SEFM: Liner Temporl Logic /GU 160913 1 / 60 Recpitultion: FormlistionFormlistion: Syntx,

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

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

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck. Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent

More information

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

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

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

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

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

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

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

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

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

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

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

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

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

Java II Finite Automata I

Java II Finite Automata I Jv II Finite Automt I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz Finite Automt I p.1/13 Processing Regulr Expressions We lredy lerned out Jv s regulr expression

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1 Non-Deterministic Finite Automt Fll 2018 Costs Busch - RPI 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q q2 1 q 0 q 3 Fll 2018 Costs Busch - RPI 2 Nondeterministic Finite Automton (NFA) Alphbet

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

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

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

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

More information

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

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

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

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn

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

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

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

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1 Chpter 1, Prt 1 Regulr Lnguges CSC527, Chpter 1, Prt 1 c 2012 Mitsunori Ogihr 1 Finite Automt A finite utomton is system for processing ny finite sequence of symols, where the symols re chosen from finite

More information

Introduction to ω-autamata

Introduction to ω-autamata Fridy 25 th Jnury, 2013 Outline From finite word utomt ω-regulr lnguge ω-utomt Nondeterministic Models Deterministic Models Two Lower Bounds Conclusion Discussion Synthesis Preliminry From finite word

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

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51 Non Deterministic Automt Linz: Nondeterministic Finite Accepters, pge 51 1 Nondeterministic Finite Accepter (NFA) Alphbet ={} q 1 q2 q 0 q 3 2 Nondeterministic Finite Accepter (NFA) Alphbet ={} Two choices

More information

Formal Language and Automata Theory (CS21004)

Formal Language and Automata Theory (CS21004) Forml Lnguge nd Automt Forml Lnguge nd Automt Theory (CS21004) Khrgpur Khrgpur Khrgpur Forml Lnguge nd Automt Tle of Contents Forml Lnguge nd Automt Khrgpur 1 2 3 Khrgpur Forml Lnguge nd Automt Forml Lnguge

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

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

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

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

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

This lecture covers Chapter 8 of HMU: Properties of CFLs

This lecture covers Chapter 8 of HMU: Properties of CFLs This lecture covers Chpter 8 of HMU: Properties of CFLs Turing Mchine Extensions of Turing Mchines Restrictions of Turing Mchines Additionl Reding: Chpter 8 of HMU. Turing Mchine: Informl Definition B

More information

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15 Models of Comput:on Lecture #8 Chpter 7 con:nued Any lnguge tht e defined y regulr expression, finite utomton, or trnsi:on grph cn e defined y ll three methods We prove this y showing tht ny lnguge defined

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

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

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

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

Tutorial Automata and formal Languages

Tutorial Automata and formal Languages Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd T. vn Lrhoven Institute for Computing nd Informtion Sciences Intelligent

More information

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

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

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

4 Deterministic Büchi Automata

4 Deterministic Büchi Automata Bernd Finkeiner Dte: April 26, 2011 Automt, Gmes nd Verifiction: Lecture 3 4 Deterministic Büchi Automt Theorem 1 The lnguge ( + ) ω is not recognizle y deterministic Büchi utomton. Assume tht L is recognized

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

From LTL to Symbolically Represented Deterministic Automata

From LTL to Symbolically Represented Deterministic Automata Motivtion nd Prolem Setting Determinizing Non-Confluent Automt Det. vi Automt Hierrchy From LTL to Symoliclly Represented Deterministic Automt Andres Morgenstern Klus Schneider Sven Lmerti Mnuel Gesell

More information

Automata and Languages

Automata and Languages Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions

More information

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

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

More information

Finite state automata

Finite state automata Finite stte utomt Lecture 2 Model-Checking Finite-Stte Systems (untimed systems) Finite grhs with lels on edges/nodes set of nodes (sttes) set of edges (trnsitions) set of lels (lhet) Finite Automt, CTL,

More information

Lexical Analysis Finite Automate

Lexical Analysis Finite Automate Lexicl Anlysis Finite Automte CMPSC 470 Lecture 04 Topics: Deterministic Finite Automt (DFA) Nondeterministic Finite Automt (NFA) Regulr Expression NFA DFA A. Finite Automt (FA) FA re grph, like trnsition

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

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

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

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

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,

More information

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1 CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother

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

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.

More information

Lexical Analysis Part III

Lexical Analysis Part III Lexicl Anlysis Prt III Chpter 3: Finite Automt Slides dpted from : Roert vn Engelen, Florid Stte University Alex Aiken, Stnford University Design of Lexicl Anlyzer Genertor Trnslte regulr expressions to

More information

State Minimization for DFAs

State Minimization for DFAs Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid

More information

CISC 4090 Theory of Computation

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

More information

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

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language. Section: Other Models of Turing Mchines Definition: Two utomt re equivlent if they ccept the sme lnguge. Turing Mchines with Sty Option Modify δ, Theorem Clss of stndrd TM s is equivlent to clss of TM

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

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

Non-Deterministic Finite Automata

Non-Deterministic Finite Automata Non-Deterministic Finite Automt http://users.comlb.ox.c.uk/luke. ong/teching/moc/nf2up.pdf 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q1 q2 2 Alphbet ={} Two choices q1 q2 3 Alphbet ={} Two choices

More information

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model? CS125 Lecture 11 Fll 2016 11.1 Finite Automt Motivtion: TMs without tpe: mybe we cn t lest fully understnd such simple model? Algorithms (e.g. string mtching) Computing with very limited memory Forml verifiction

More information

CS 275 Automata and Formal Language Theory

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

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion

More information

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

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

On Determinisation of History-Deterministic Automata.

On Determinisation of History-Deterministic Automata. On Deterministion of History-Deterministic Automt. Denis Kupererg Mich l Skrzypczk University of Wrsw YR-ICALP 2014 Copenhgen Introduction Deterministic utomt re centrl tool in utomt theory: Polynomil

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

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

Hybrid Control and Switched Systems. Lecture #2 How to describe a hybrid system? Formal models for hybrid system

Hybrid Control and Switched Systems. Lecture #2 How to describe a hybrid system? Formal models for hybrid system Hyrid Control nd Switched Systems Lecture #2 How to descrie hyrid system? Forml models for hyrid system João P. Hespnh University of Cliforni t Snt Brr Summry. Forml models for hyrid systems: Finite utomt

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

SWEN 224 Formal Foundations of Programming WITH ANSWERS

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

More information

Foundations of XML Types: Tree Automata

Foundations of XML Types: Tree Automata 1 / 43 Foundtions of XML Types: Tree Automt Pierre Genevès CNRS (slides mostly sed on slides y W. Mrtens nd T. Schwentick) University of Grenole Alpes, 2017 2018 2 / 43 Why Tree Automt? Foundtions of XML

More information

In-depth introduction to main models, concepts of theory of computation:

In-depth introduction to main models, concepts of theory of computation: CMPSCI601: Introduction Lecture 1 In-depth introduction to min models, concepts of theory of computtion: Computility: wht cn e computed in principle Logic: how cn we express our requirements Complexity:

More information

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont. NFA DFA Exmple 3 CMSC 330: Orgniztion of Progrmming Lnguges NFA {B,D,E {A,E {C,D {E Finite Automt, con't. R = { {A,E, {B,D,E, {C,D, {E 2 Equivlence of DFAs nd NFAs Any string from {A to either {D or {CD

More information