50 likes | 124 Views
RTS Development by the formal approach Assignment #1. Ex. 1 : Given E={ p , q , r }, let =2 E . Express the behaviors over that satisfy the following properties by proper -regular expressions. 1. initial p is followed by q at the next step: [p] [q] [~p]
E N D
RTS Development by the formal approach Assignment #1 Ex. 1: Given E={p,q,r}, let =2E. Express the behaviors over that satisfy the following properties by proper -regular expressions. 1. initial p is followed by q at the next step: [p][q] [~p] 2. p and q never occursimultaneously: [~{p,q}] 3. p cannot occur before q : [~p, ~q]*[q] [~p,~q] 4.See next slide
4. poccurs at every step (strictly) between qandnextr: • Version A - The occurrences of [p,q] are mutually exclusive: • ([~q]*[q][p,~r]*[r]) -- infinite occurrences • ([~q]*[q][p,~r]*[r])*([~q]*[q])1[~r] • ([~q]*[q][p,~r]*[r])*[~q] -- finite occurrences • Version B - successive occurrences of[p,r] possibly share end points: • (i) [~q]*[q][p,~r]*(([r,~q][~q]*[q][p,~r]*)*+([r,q][p,~r]*)*)) • (ii) [~q]*[q][p,~r]*(([r,~q][~q]*[q][p,~r]*)*+([r,q][p,~r]*)*))*([~q]*[q])1[~r] • (iii) [~q]*[q][p,~r]*(([r,~q][~q]*[q][p,~r]*)*+([r,q][p,~r]*)*))*[~q] • (iv) [~r] [~q] • i.infinite many occurrences • finite occurrences: at least one q but after 0 or more occurrences and possibly q, • r does not occur any more • iii. finite occurrences: at least one q but after 0 or more occurrences q does not occur • any more • iv. No r or not q at all possibly r’s here
Ex. 2: Prove that L(), the set of all models of an LTL formula , is an -regular language. • By induction on the structure of • tt: Lω(tt) = Σω • p: Lω(p) = {Σω | p0} = [p]Σω • , where Lω() is ω-regular: • Lω() = {Σω | |=} • = Lω()c -- closure under complementation • , where Lω(), Lω() are ω-regular: • Lω(v ) = {Σω | |= or |=} • = {Σω | |=} U {Σω | |=} = Lω() U Lω(C) • -- closure under union
O, where Lω() is ω-regular: • Lω(O) = {Σω | |=O} • = {Σω | 1|=} = ΣLω() - by construction/definition • U, where Lω(), Lω() are ω-regular: • Lω(U) = {Σω | |= U} • = {Σω |∃k0 s.t. ∀0≤j<k j|= and k|=} • = Lω() U (Lω() ∩ (Σ1Lω()) • U (Lω() ∩ Σ1Lω() ∩ Σ2Lω()) U … • = Uk≥0 ((Σ0Lω() ∩ Σ1Lω() ∩… ∩ Σk-1Lω() ∩ ΣkLω()) • = Uk≥0 (∩0≤j≤k-1ΣjLω()∩ΣkLω()) • -- closure under union and intersection.
Ex. 3 Prove that qis semantically equivalent to (q) (namely: qiff (q) ). q iff iiq -- (semantics of q) iff iiq -- (semantics of q) iff i(iq) -- (semantics of ) iff i(iq) -- (semantics of , ) iff i(iq) -- (semantics of ) iff (q) -- (semantics of ) iff q) -- (semantics of ) iff (q) -- (semantics of (q))