System Vlidtion (IN4387) Novemer 2, 2012, 14:00-17:00 Importnt Notes. The exmintion omprises 5 question in 4 pges. Give omplete explntion nd do not onfine yourself to giving the finl nswer. Good luk! Exerise 1 (20 points) In eh of the following item determine whether the speified notion of equivlene holds etween the two given leled trnsition systems. For eh nd every item provide omplete line of resoning why ertin equivlene does or does not hold: 1. Strong isimilrity: 2. Brnhing isimilrity: 3. Strong isimilrity: 4. Brnhing isimilrity: d d e f f e 1
2 Answer 1 1. No. They re not isimilr. Assume tht they were imisimilr, then there would exist isimultion reltion whih reltes the initil sttes. Then, the first trnsition on the left-hnd-side LTS n only e mimiked y the only initil trnsition on the righ-hnd side. Hene, the trget of the two trnsition hve to e relted in the sme reltion. However, this nnot e the se sine the stte in the left-hnd-side n do trnsition, while the right-hnd-side one nnot mimi it. Note tht strong isimilrity does not ignore trnsitions. 2. Yes, they re. A rnhing isimultion reltion relting the initil sttes is given elow: 3. No, they re not isimilr. Assume tht they were isimilr, then there would exist isimultion reltion whih reltes the initil sttes. The loop in the initil stte of the right-hnd-side (rhs) LTS should e mimiked y n trnsition in the left-hnd-side (lhs) one. Assume tht the ltter trnsition is the strt of tre of size n (for some ritrry n); then it follows tht the initil stte of the rhs LTS should e isimilr to the seond stte of this tre. The initil stte of the rhs LTS n do n -loop, nd this n only e mimiked y the seond stte in the tre of size n y performing n trnsition into the third stte in the tre. Hene, the initil stte of the rhs LTS should e relted to the third stte in the tre. Repeting this exerise on the seond to the n-th stte in the tre, will led to the onlusion tht the lst stte in the tre of size n, should e isimilr to the initil stte of the rhs LTS, whih is lerly not true, euse the lst stte of the tre dedloks, while the initil stte of the rhs LTS n still perform trnsitions. 4. No, they re not isimilr. Assume tht they were isimilr, then there would exist isimultion reltion whih reltes the initil sttes. The initil stte of the lhs LTS n mke n trnsition to the left. This n e mimiked y the initil stte of the rhs LTS: Either the initil stte of the rhs LTS mkes the trnsition to the left, then the sttes to the left of the initil sttes in the lhs nd rhs LTSs should e relted. Consider for exmple the ltter stte in the lhs LTS; it n perform trnsition; this n e mimiked in the orresponding stte in the rhs LTS y performing the only enled trnsition. Hene, the trgets of the two trnsitions should e relted y the sme isimultion reltion. However, the ltter sttes nnot e isimilr euse the lhs stte n perform n e trnsition, whih nnot e mimiked y the rhs stte nd likewise, the rhs n perform n f trnsition, whih nnot e mimiked y the lhs stte. Or the initil stte of the rhs LTS mkes the trnsition to the right, then the stte to the left of the initil stte of the lhs LTS should e relted to the stte to the right of the initil stte of the rhs LTS. This nnot e true however, sine the former stte n perform trnsition, whih nnot e mimiked y the ltter stte (nd likewise, the ltter stte performs d trnsition, whih nnot e performed y the former stte).
3 Exerise 2 (20 points) Consider the following two modl formule: nd [request] true response true [request](µx. true true [response]x) 1. Explin in words wht eh of the two formule mens. (10 points) 2. Give leled trnsition system in whih one of the two formule holds nd the other one doe not hold. (It does not mtter whih one you hoose to hold.) (10 points) Answer 2 1. The first formul sttes tht fter eh request, there is t lest one pth leding to response. (There my e other pths not leding to response.) The seond formul sttes tht fter eh request, eh pth will eventully reh response tion. (No pth n void doing response.) 2. The following LTS stisfies the first formul ut not the seond, sine it n void the response y tking the trnsition infinitely mny times. It lso does not stisfy the seond formul, euse it hs pth (strting with ) whih n void the response ltogether. request response
4 Exerise 3 (20 points) Define sort (dt type) ToDoList, where eh element of this sort is either the empty list, or non-empty list of prioritized tsks. A prioritized tsk is pir (i, t) where i is positive nturl numer determining the priority nd t is n element of sort T sk, whih ontins onstnt (onstrutor) not sk nd is not speified ny further. Give the forml definition of T odolist nd its onstrutors. (5 points) Define funtion (mp) todonow, whih tks T odolist s its prmeter, nd returns the tsk with the highest priority in the list, if it is non-empty, or not sk, otherwise. If needed, you my define nd use other uxiliry funtions used in the definition of todonow. (15 points) Answer 3 sort Tsk ; sort todolist = List(Nt#Tsk); ons notsk: Tsk; mp minpr: todolist Nt; todonow: todolist todolist; vr i, j: Nt; t : Tsk; l : todolist; eqn minpr([])= 0; (1) minpr((i,t) l ) = min(i, minpr(l)); todonow((i,t) l ) = if (minpr(l) >= i, t, todonow(l)) ; todonow( [] ) = notsk ;
5 Exerise 4 (20 points) Prove the following equtions using the xioms provided in the ppendix. Mention the nme of the xiom used for eh nd every step. 1. ((1) (2)) \ ((2) (3)) = (1) (2) (5 points), 2. ( + ) δ = δ + δ (5 points), nd 3. ( d) (Hint x y if nd only if x + y = y) (10 points). Answer 4 1. 2. ((1) (2)) \ ((2) (3)) = (MD3) (((1) (2)) \ (2)) \ (3) = (MD5) ((1) ((2) \ (2))) \ (3) = (MA3) ((1) (((2) ) \ (2))) \ (3) = (MA3) ((1) ((2) ( \ (2)))) \ (3) = (MD1) ((1) ((2) )) \ (3) = (MA3) ((1) (2)) \ (3) = (MD5) (1) ((2) \ (3)) = (MA3) (1) (((2) ) \ (3)) = (MD5) (1) ((2)) ( \ (3))) = (MD1) (1) ((2)) ) = (MA3) (1) (2) ( + ) δ = (M) (( + ) T δ) + (δ T ( + ) ) + (( + ) δ) = (A4) (( + ) T δ) + (δ T ( + ) ) + (( + ) δ) = (LM4) ( T δ) + ( T δ) + (δ T ( + ) ) + (( + ) δ) = (LM2) 2 ( δ) + ( δ) + (δ T ( + ) ) + (( + ) δ) = (LM2) ( δ) + ( δ) + δ + (( + ) δ) = (LM2) ( δ) + ( δ) + (( + ) δ) = (LM2) 2 ( δ) + ( δ) + (( + ) δ) = (LM2) 2 ( δ) + ( δ) + ( ) δ + ( ) δ = (LM2) 2 ( δ) + ( δ) + ( δ) + ( δ) = (LM2) 2 ( δ) + ( δ) + δ + δ = (LM2) 2 ( δ) + ( δ) + δ + δ = (LM2) 2 ( δ) + ( δ) = (M) 2 ( T δ + δ T + δ) + ( T δ + δ T + δ) = (M) 2 ( δ + δ T + δ) + ( δ + δ T + δ) = (LM1) 2 ( δ + δ T + δ) + ( δ + δ T + δ) = (LM2) 2 ( δ + δ + δ) + ( δ + δ + δ) = (A6) 2 ( δ + δ) + ( δ + δ) = (S4) 2 ( δ + δ) + ( δ + δ) = (A6) 2 ( δ) + ( δ) = (A6) 2 3. ( d), whih mens tht we hve to prove = + ( d). We do this y indution (se nlysis) on the oolen vrile d:
6 Either d = true, then we hve: Either d = flse, then we hve: + ( d) = d = true + ( true) = logi + = (A3) + = (A3) + ( flse) = d = flse + ( flse) = logi + f lse = (ond2) + δ = (A3)
7 Exerise 5 (20 points) Speify the following system of two prllel proesses: The first proess represents temperture sensor, whih n issue two types of tions: snd temp(n) nd snd d efet. The sensor n send ny nturl numer etween 0 nd 200 s the prmeter of snd temp nd my non-deterministilly hoose to send the snd def et signl, fter whih it dedloks. The seond proess represents thermostt, whih reeives temperture from the sensor nd if the reeived vlue is in the rnge 0 nd 50 it issues tion on to the outside world; if the vlue is etween 50 nd 100 it sends tion off to the outside world; if the reeived vlue is outside these rnges it ignores the vlue, ut keeps on listening to the sensor t ny se. Upon synhronizing with snd defet, the thermostt will issue n lrm tion nd terminte. The tion nmes tht re not speified in the ove-given desription n e hosen freely. Answer 5 t snd temp, rv temp, syn temp : Nt; snd defet, rv defet, syn defet,, on, off ; pro Sensor = snd defet delt + sum n : Nt. (n 200) snd temp(n) Sensor ; Thermostt = rv defet lrm + sum n : Nt. rv temp(n). (n 50) on. Thermostt ( (n 100) off. Thermostt Thermostt ) ; init llow ( { syn temp, syn defet, on, off, lrm }, ( omm { snd temp rv temp syn temp, snd defet rv defet syn defet }, Sensor Thermostt )) ;
8 MA1 MA2 MA3 α β = β α (α β) γ = α (β γ) α = α MD1 \ α = MD2 α \ = α MD3 α \ (β γ) = (α \ β) \ γ MD4 ((d) α) \ (d) = α MD5 ((d) α) \ (e) = (d) (α \ (e)) if or d e MS1 α = true MS2 = flse MS3 (d) α (d) β = α β MS4 (d) α (e) β = (d) (α \ (e)) β if or d e MAN1 MAN2 MAN3 = (d) = α β = α β Tle 1: Axioms for multi-tions Note tht (d) nd (e) rnge over (prmeterized) tions, α nd β rnge over (multi)tions nd x, y nd z rnge over proesses.
9 A1 A2 A3 A4 A5 A6 A7 Cond1 Cond2 SUM1 SUM3 SUM4 SUM5 x + y = y + x x + (y + z) = (x + y) + z x + x = x (x + y) z = x z + y z (x y) z = x (y z) x + δ = x δ x = δ true x y = x flse x y = y d:d x = x d:d X(d) = X(e) + d:d X(d) d:d (X(d) + Y (d)) = d:d X(d) + d:d Y (d) ( d:d X(d)) y = d:d X(d) y Tle 2: Axioms for the si opertors M x y = x T y + y T x + x y LM1 α T x = α x LM2 δ T x = δ LM3 α x T y = α (x y) LM4 (x + y) T z = x T z + y T z LM5 ( d:d X(d)) T y = d:d X(d) T y S1 x y = y x S2 (x y) z = x (y z) S3 x = x S4 α δ = δ S5 (α x) β = α β x S6 (α x) (β y) = α β (x y) S7 (x + y) z = x z + y z S8 ( d:d X(d)) y = d:d X(d) y TC1 (x T y) T z = x T (y z) TC2 x T δ = x δ TC3 (x y) T z = x (y T z) Tle 3: Axioms for the prllel omposition opertors