Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 1 Notes on specifying systems in EST Robert Meolic, Ttjn Kpus Fculty of EE & CS University of Mribor
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 2 1 Outline forml verifiction: prove the correctness of system behviour, usge: softwre, hrdwre, communiction protocols, etc., requires: forml specifiction of system behviour, requires: forml specifiction of correct behviour, requires: methods nd lgorithms (e.g. model checking). In our pper we discuss the formlism for specifiction of system behviour used in verifiction tool EST. The formlism is bsed on well-known clculus CCS.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 3 2 Introduction EST is tool for forml verifiction of systems. A system to be verified should be specified in CCS-like syntx. Before verifiction, specifictions re trnsformed into LTSs. The EST specifictions use opertors which cn be clssified into two groups: stndrd CCS opertors nd dditionl opertors which re introduced to shorten specifictions nd to fcilitte trsltions from other formlisms.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 4 3 Lbelled trnsition system An LTS M is qudruple (S, A τ, δ, s 0 ):?zeton S is non-empty set of sttes;?zeton A τ is set of ctions contining unobservble ction τ ;!cj τ!kv δ S A τ S is the trnsition reltion; s 0 is the initil stte.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 5 4 Exmple 1: Peterson s lgorithm PROCESS P1 while (true) { <noncriticil section> b1=true; k=2; while (b2==true && k==2) { wit; } <criticil section> b1=flse; } PROCESS P2 while (true) { <noncriticil section> b2=true; k=1; while (b1==true && k==1) { wit; } <criticil section> b2=flse; }
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 6 5 Exmple 1: Model with LTSs P0!b1wt P1!kw2!b1wf?b2rf P2?b2rt?kr2!enter1 P3 P4?kr1!exit1 P6 P5 Figure 1: An LTS representing process P1 in Peterson s lgorithm
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 7 6 Clculus of Communicting Systems CCS is process clculus. Due to the nice lws vlid for its opertors it is lso clssified s process lgebr. Ech CCS expression defines process (lso clled n gent). CCS opertors supported by EST re: Prefix (.), Summtion (+), Composition ( ), Restriction (\), nd Relbelling ([ ]).
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 8 7 Opertor Prefix Opertor Prefix is defined with the following rule: Prefix.M M Process.M cn execute ction nd fterwrds behve s process M. This mens tht the initil stte of the LTS representing process.m should hve n -trnsition to the initil stte of the LTS representing process M.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 9 8 Opertor Summtion Opertor Summtion is defined with the following two rules: Sum1 Sum2 M 1 M 1 (M 1 + M 2 ) M 1 M 2 M 2 (M 1 + M 2 ) M 2 If ny process prticipting in the summtion cn execute ction, then the sum cn lso execute ction. This mens tht the initil stte of the LTS representing process M 1 + M 2 should hve exctly those trnsitions which re present in the initil sttes of the LTSs representing processes M 1 nd M 2.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 10 9 Opertor Composition Opertor Composition is defined s follows: Com1 M 1 M 1 (M 1 M 2 ) (M 1 M 2) Com2 Com3 M 1 M 2 M 2 (M 1 M 2 ) (M 1 M 2 ) M ā 1 M 2 M 2 (M 1 M 2 ) (M τ ( τ) 1 M 2 ) Composition is used to model synchronous communiction between two processes.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 11 10 Opertor Restriction In EST, opertor Restriction is defined s follows: Res M M (M\ˆb) (M \ˆb) (b τ, = τ â ˆb) Process M\ˆb behves like process M but it cnnot execute ction with nme ˆb. This mens tht sttes in the LTS representing process M\ˆb hve exctly those trnsitions which re present in the LTS reperesenting process M nd re lbelled with n ction whose ction nme is not equl to ˆb.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 12 11 Opertor Relbelling Opertor Relbelling is defined s follows: Rel M M M[f] f() M [f] Here, f is relbelling function such tht f(ā) = f() nd f(τ) = τ. In EST, relbelling function is given s pir of ction nmes. LTS representing process M[f] is obtined from LTS representing process M by chnging ll trnsition lbels ccording to the relbelling function f.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 13 12 Algebric lws for CCS opertors Two specifictions re equivlent only if the processes they define re strongly equivlent [Mil89]. The following bsic lws for defined opertors re consistent with this presumption: M 1 + M 2 = M 2 + M 1 (M 1 + M 2 ) + M 3 = M 1 + (M 2 + M 3 ) M 1 M 2 = M 2 M 1 (M 1 M 2 ) M 3 = M 1 (M 2 M 3 ) M\â\ˆb = M\ˆb\â
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 14 13 More on lgebric lws Composition is distributive over Summtion: M 1 (M 2 + M 3 ) = (M 1 M 2 ) + (M 1 M 3 ) The opposite is not true. Also, Prefix is distributive neither over Summtion nor over Composition: M 1 + (M 2 M 3 ) (M 1 + M 2 ) (M 1 + M 3 ).(M 1 + M 2 ).M 1 +.M 2.(M 1 M 2 ).M 1.M 2
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 15 14 Exmple 2: Dining philosophers Figure 2: Dining philosophers (from Wikipedi)
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 16 15 Exmple 2: EST specifiction (1) PHILO =!think.!tkeleft.!tkeright.!et.!dropleft.!dropright. PHILO!dropright PHILO!think?drop!tkeleft FORK?tke FORK =!dropleft!tkeright?tke.?drop. FORK!et
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 17 16 Exmple 2: EST specifiction (2) DINNER = ( PHILO [think1/think] [tke2/tkeleft] [tke1/tkeright] [et1/et] [drop2/dropleft] [drop1/dropright] FORK [tke1/tke] [drop1/drop] PHILO [think2/think] [tke1/tkeleft] [tke2/tkeright] [et2/et] [drop1/dropleft] [drop2/dropright] FORK [tke2/tke] [drop2/drop] )\tke1\drop1\tke2\drop2
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 18 17 Exmple 2: The composition!think1 DINNER!think2 τ!think2!think1 τ τ!think2 τ τ!think1 τ!et1!think2 τ τ τ τ!think1!et2 τ!think2!et1!think1!et2 τ Figure 3: A prt of the obtined LTS for two philosophers
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 19 18 Additionl opertors CCS is quite simple formlism nd it is not very prcticl for specifiction of rel systems. To enhnce it little, the prser in EST is extended with some opertors from other formlisms (e.g. CSP nd LOTOS). Synchronistion ( ), Prtil synchronistion ( [ ] ), Interleving ( ), nd PrefixN ((+).).
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 20 19 Opertor Synchronistion Opertor Synchronistion is defined s follows: Syn1 M 1 M 1 (M 1 M 2 ) (M 1 M 2) (=τ ā A τ ) Syn2 M 2 M 2 (M 1 M 2 ) (M 1 M 2 ) (=τ ā A τ ) Syn3 M 1 M ā 1 M 2 M 2 (M 1 M 2 ) (M τ ( τ) 1 M 2 ) Opposite to opertor Composition, opertor Synchronistion requires strictly synchronous execution.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 21 20 Prtil synchronistion Opertor Prtil synchronistion is defined s follows: Prt1 M 1 M 1 (M 1 [A] M 2 ) (M 1 [A] M 2) ( / A) Prt2 Prt3 M 2 M 2 (M 1 [A] M 2 ) ( / A) (M 1 [A] M 2 ) M 1 M ā 1 M 2 M 2 (M 1 [A] M 2 ) (M τ ( A) 1 [A] M 2 ) Prtil synchronistion is generlistion of Synchronistion such tht it requires synchronous execution of some ctions, only.
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 22 21 Opertor Interleving Opertor Interleving is defined s follows: Int1 M 1 M 1 (M 1 M 2 ) (M 1 M 2) Int2 M 2 M 2 (M 1 M 2 ) (M 1 M 2 ) Opertor Interleving is used to model synchronous prllel execution of processes. It cn be esily derived from opertor Prtil synchronistion: M 1 M 2 = M 1 [ ] M 2
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 23 22 Opertor PrefixN Opertor PrefixN is useful bbrevition supported by the EST prser. Let A i stnd for i,1. i,2..... i,ni. Then: (A 1 +A 2 +...+A N ).M A 1.M+A 2.M+...+A N.M Let A i stnd for i,2..... i,ni. Then opertor PrefixN cn be lso given s follows: PrefixN (A1 +... + A i +... + A N ).M i,1 A i.m
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 24 23 Exmple 3: Gs Sttion problem The system consists of n opertor, pump, nd customers. The opertor initilly ccepts money prepid by customers nd then ctivtes the pump. On receiving the chrge informtion from the pump, the opertor gives the chnge to the customer. Figure 4: Gs sttion in Hiroshim (from Wikipedi)
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 25 24 Exmple 3: CCS specifiction OPERATOR = (?prepy1+?prepy2).op_prepaid + (?chrge1+?chrge2).op_charged OP_PREPAID = (?vlbl.!ct+!occupied).operator OP CHARGED = (!chnge1+!chnge2). (?wit.!ct+!none).operator QUEUE =!vlbl.queue_active QUEUE_ACTIVE =?none.queue +?occupied.!wit.queue_active PUMP =?ct. (?strt1+?strt2). (?finish1+?finish2). (!chrge1+!chrge2).pump CUST =!prepy.!strt.!stop.?chnge.cust STATION = OPERATOR [vlbl,occupied,none,wit] QUEUE [ctivte,chrge1,chrge2] PUMP CUSTOMERS = CUST [prepy1/prepy][strt1/strt] [stop1/stop][chnge1/chnge] CUST [prepy2/prepy][strt2/strt] [stop2/stop][chnge2/chnge] SYSTEM = STATION [strt1,strt2,finish1,finish2] CUSTOMERS
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 26 25 Exmple 3: Obtined LTS OPERATOR = (?prepy1+?prepy2).op PREPAID + (?chrge1+?chrge2).op CHARGED OP PREPAID = (?vlbl.!ct+!occupied).operator OP CHARGED = (!chnge1+!chnge2).(?wit.!ct+!none).operator OPERATOR?prepy1?prepy2?chrge1?chrge2!occupied!ct?vlbl?wit!chnge1!chnge2!none Figure 5: A detil from the Gs Sttion problem
Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 27 26 Conclusion EST is tool for forml verifiction of systems. A system to be verified should be specified in CCS-like syntx. In the pper we mke n overview of opertors supported by EST. Besides stndrd CCS opertors, the prser includes dditionl opertors similr to those from CSP nd LOTOS. EST is free softwre. Homepge: http://lms.uni-mb.si/est/