220 likes | 445 Views
Safety-Liveness Semantics for UML 2.0 Sequence Diagrams Radu Grosu SUNY at Stony Brook. Joint work with Scott A. Smolka. Scenario-Based Specifications. Convenient way of describing interaction among reactive systems, i.e.: Systems where termination is rather an error
E N D
Safety-Liveness Semantics forUML 2.0 Sequence DiagramsRadu GrosuSUNY at Stony Brook Joint work with Scott A. Smolka
Scenario-Based Specifications • Convenient way of describing interaction • among reactive systems, i.e.: • Systems where termination is rather an error • than an expected behavior. • Have become an integral partof all modern • software engineering design methods: • SDL and ROOM MSC (message sequence • charts), UML SD (sequence diagrams).
Reactive Systems Commercial Aircraft Telecommunication Household devices Automobiles Nuclear Power Plants Medical devices
UML 2.0 SD Simplified Syntax name of SD body of SD sd ack m n process name b process lifeline receive event send event message Positive SD: describes traces that are valid and should be possible
neg sd nack m n c UML 2.0 SD Simplified Syntax negative qualification Negative SD: describes traces that are invalid and should not be possible
sd init sd ack neg sd nack m n m n m n a b c High level SD (IOD) sd iod ack ref init ref ref nack UML 2.0 SD Simplified Syntax synchronous/asynchronous sequencing
sd nsd neg sd ng sd nsd m n m n ng ref a neg a sd a sd b m m n n b a sd asd b a a ref b ref UML 2.0 SD Full Syntax sd asd m n alt
m:n!a n:m?a Closed world semantics: rs Lang(rs) = {m:n!a n:m?a} UML 2.0 SD Semantics? sd rs m n a This is not a reactive system! What about asynchronous message passing?
sd rs m n a Positive SD Semantics? tau transitions rs m:n!a n:m?a Büchi automaton! L(rs) = {*m:n!a *n:m?a } What about refinement?
sd rs sd rs m m n n b a Positive SD and Refinement? rs m:n!a n:m?a ~m:n!a ~n:m?a , liveness closure chaos closure Liveness Büchi automaton! L(rs) = {* ~m:n!a (,), * m:n!a * ~n:m?a (,), * n:m?a * m:n!a * n:m?a (,)}
nack neg sd nack n:m!c m:n?c m n c nack n:m!c m:n?c ~n:m!c ~m:n?c , Negative SD Semantics? complement + safety closure Safety Büchi automaton! L(nack) = { , * n:m!c , * ~n:m!c (,), * n:m!c * ~m:n!c(,) }
ack sd iod ack ref init init ref nack nack ref Positive SD: - remove all negative nodes and all their associated transitions. ack init Negative SD: -turn negative nodes into accepting sink nodes. Others nonaccepting. ack init nack High Level SD Semantics
piod m:n!a n:m?a n:m!b n:m!b init ack liod m:n!a n:m?a n:m!b m:n?c , ~m:n!a ~n:m?a ~n:m!b ~m:n!c , HSD Positive Semantics
nack n:m!c n:m?c niod m:n!a n:m?a n:m!b n:m?b init ack , ~m:n!a ~n:m?a ~n:m!c ~n:m?c siod n:m!c m:n!a n:m?a n:m!b n:m?b ~n:m?b HSD Negative Semantics
HSD Semantics • Parallel composition of: • Liveness Büchi automaton • Safety Büchi automaton • Example: • Iod automaton: iod = liod siod • Note: Lang(iod) = Lang(liod) Lang(siod)
SD Refinement • Definition: Let S1 and S2 be two SDs. Then: • -S1 S2 iff Lang(S1) Lang(S2) • Theorem: Let S, T and U be three bounded • SD and assume that S* and T* are bounded, • too. Then: • if S T then U S U T • if S T then (S)* (T)* • if S T then S + U T + U and U + S U + T • if S T then S || U T || U and U || S U || T
Sequential: init ref init ref ack ref Alternative: ack ref ack ref ref nack Examples of Refinement
Star? init ref init ref ack ref Star: init ref ref ack ack ref ref init nack ref Examples of Refinement
Related Work • PA and PO (Mauw, Alur, Muscholl, Peled, …): • Not compositional. Not interested in compositionality. • Live SC (Damm, Harel, Kugler): • Elegant, alternative AT solution. Departure from UML. • Triggered MSC (Cleaveland, Sengupta): • Prescriptive/constraint-based. Must preorder. • STAIRS (Haugen, Stoelen): • Open semantics. Not fully formalized. • Other semantics (Broy, Knapp, Krüger,…): • Also depart from closed world semantics.
Conclusions • Presented an Automata-theoretic semantics that solves in asimple and elegant wayone of the main open questions about UML 2.0 SD: • How to assign a precise meaning to a set of SD without compromising refinement? • Provides a direct technique for checking SD refinement in a compositional way. • Supports the development ofa general purpose MC for property and refinement checking.
Rough Complexity Analysis • Translation of HSD to Pos/Neg FA: • -linear time (in the size of the HSD). • Translation of Pos/Neg FA to Safe/Live BA: • -exponential due to flattening, • Complementation hard: • - double exponential due to BA. • In practice: • - avoid flattening for synchronous sequencing? • - special kind of BA with simple complementation.