Presentation is loading. Please wait.

Presentation is loading. Please wait.

Modular reasoning in the presence of event subtyping 14 th international conference on Modularity 1 Mehdi Bagherzadeh Robert Dyer Rex D. Fernando Jose.

Similar presentations


Presentation on theme: "Modular reasoning in the presence of event subtyping 14 th international conference on Modularity 1 Mehdi Bagherzadeh Robert Dyer Rex D. Fernando Jose."— Presentation transcript:

1 Modular reasoning in the presence of event subtyping 14 th international conference on Modularity 1 Mehdi Bagherzadeh Robert Dyer Rex D. Fernando Jose Sanchez Hridesh Rajan

2 Event types: separation of crosscutting concerns a subject announces an event (using announce expression) observers (zero or more) register for the event observers run in a chain, when the event is announced, and can invoke each other (using invoke expressions) subject (base) observer (crosscutting) observer event type announce invoke

3 Modular reasoning about behavior Modular subject reasoning : {P} announce ev {?} using only subject implementation and event ev Modular observer reasoning : {P} invoke {?} using only observer implementation and event ev subject (announce ev) observer ev announce ev observer (invoke) observer ev ob

4 Event specification, previous work Modular subject reasoning : {P} announce ev {Q} Modular observer reasoning : {P} invoke {Q} announce ev ev specify spec (P,Q) invoke P Q Q P ob1 observer Q P ob2

5 Event subtyping For observer reuse, announcement of ev runs not only its observers but also all observers of its superevents. announce ev observer ev ev’ observer subtype

6 Subject modular reasoning & event subtping Can we still say {P} announce ev {Q} ? NO announce ev ev ev’ (P,Q) (P’,Q’)

7 Observer modular reasoning & event subtyping Can we still say {P} invoke {Q} ? NO ev ev’ invoke (P,Q) (P’,Q’) ob

8 Problems of modular reasoning in presence of event subtyping 1.Combinatorial reasoning 2.Behavioral invariance

9 Combinatorial reasoning problem {P} announce ev {?} announce ev ev ev’ (P,Q) (P’,Q’)

10 Combinatorial reasoning 1 {P} announce ev {Q} announce ev ev ev’ (P,Q) (P’,Q’) Q P ob Q’ P’ ob’

11 Combinatorial reasoning 2 {P} announce ev {Q’} if P => P’ announce ev ev ev’ (P,Q) (P’,Q’) Q P ob Q’ P’ ob’

12 Combinatorial reasoning {P} announce ev {Q or Q’ or Q ∞ Q’} – all execution orders of observers must be considered. – caused by arbitrary execution orders of observers announce ev ev ev’ (P,Q) (P’,Q’)

13 Behavioral invariance problem ob: {P} invoke {?} ob’:{P’} invoke {?} ev ev’ (P,Q) (P’,Q’) invoke ob invoke ob’

14 Behavioral invariance 1 ob: {P} invoke {Q} requires (P => P’ and Q’ => Q) ev ev’ (P,Q) (P’,Q’) invoke P Q Q P ob Q’ P’ ob’

15 Behavioral invariance 2 ob’: {P’} invoke {Q’} requires (P’ => P and Q=> Q’) ev ev’ (P,Q) (P’,Q’) invoke P’ Q’ P’ ob’ Q P ob

16 Behavioral invariance ev ev’ (P,Q) (P’,Q’) ob runs before ob’P => P’ and Q’ => Q ob’ runs before obP’ => P and Q => Q’ arbitrary execution orderP = P’ and Q = Q’ invoke P Q Q P ob Q’ P’ ob’ invoke P’ Q’ P’ ob’ Q P ob

17 Solution 1. Non-decreasing relation on execution orders of observers of an event and its superevents Problem: arbitrary execution orders of observers 2. Refining relation among event specifications of an event and its superevents. Problem: unrelated behaviors of observers

18 Non-decreasing order An observer ob of ev run before any observer ob’ of ev’. – Backward compatible: observers of ev run according to their dynamic registration order. observer ev ev’ observer non-decreasing ob ob’

19 Refining relation, behavior 1. Behavior of an event refines the behavior of its superevent. – P => P’ && Q’ => Q (P strengthens P’ and Q weakens Q’) – inverse of blackbox behavioral subtyping ev ev’ (P’,A’,Q’) (P,A,Q) refines Q’ P’ Q P strengthen weaken

20 Refining relation, control 2. Control effects of an event refines control effects of its superevents – Behavior (R,S) refines its corresponding (R’,S’) as shown previously – program expression pe textually refines corresponding pe’. – Blackbox behavioral subtyping does not control effect refinement. ev ev’ (P’,A’,Q’) (P,A,Q) refines A’ A refines (R’,S’) pe’ (R,S) pe

21 Combinatorial reasoning solved {P} announce ev {Q} Non-decreasing relation: observer ob’ cannot run before ob. announce ev ev ev’ (P,Q) (P’,Q’) Q P ob Q’ P’ ob’ Q P ob Q’ P’ ob’

22 Behavioral invariance solved {P} invoke {Q} Refining relation: P => P’ && Q => Q’ ev ev’ (P,Q) (P’,Q’) invoke P Q Q P ob Q’ P’ ob’ Q P ob Q’ P’ ob’

23 Non-decreasing alone Non-decreasing alone: does not allow ob’ to run before ob, but does not guarantee (P => P’ and Q => Q’ ). ev ev’ (P’,A’,Q’) invoke P Q Q P ob Q’ P’ ob’ invoke P’ Q’ P’ ob’ Q P ob  

24 Refining alone Refining alone: guarantees (P = >P’ and Q => Q’ ) but does not guarantee that ob’ does not run before ob. ev ev’ (P’,A’,Q’) invoke P Q Q P ob Q’ P’ ob’ invoke P’ Q’ P’ ob’ Q P ob  

25 Modular reasoning is enabled {P} announce ev {Q} ? Yes ob: {P} invoke {Q} ? Yes ob’: {P’} invoke {Q’} ? Yes announce ev invoke ev ev’ invoke (P’,A’,Q’) (P,A,Q) ob ob’ non-decreasing refining 1 2

26 Control effect reasoning Our technique enables modular reasoning about control effects in addition to reasoning about behaviors.

27 Applicability Applicable to other event-based systems including: joint point types Joint point interfaces

28 Summary Problems in modular reasoning in the presence of event subtyping: 1.Combinatorial reasoning 2.Behavioral invariance Solution: 1.Non-decreasing relation for observers’ execution order 2.Refining relation for event specifications

29 Thank you & Questions 29

30


Download ppt "Modular reasoning in the presence of event subtyping 14 th international conference on Modularity 1 Mehdi Bagherzadeh Robert Dyer Rex D. Fernando Jose."

Similar presentations


Ads by Google