redundancy free residual dispatch
play

Redundancy-free Residual Dispatch Using Ordered Binary Decision - PowerPoint PPT Presentation

Formula-based Dispatch BDD-based Dispatch Assessment Redundancy-free Residual Dispatch Using Ordered Binary Decision Diagrams for Efficient Dispatch Andreas Sewe Christoph Bockisch Mira Mezini Seventh International Workshop on Foundations


  1. Formula-based Dispatch BDD-based Dispatch Assessment Redundancy-free Residual Dispatch Using Ordered Binary Decision Diagrams for Efficient Dispatch Andreas Sewe Christoph Bockisch Mira Mezini Seventh International Workshop on Foundations of Aspect-Oriented Languages, 2008

  2. Formula-based Dispatch BDD-based Dispatch Assessment Example Aspect aspect SecurityMonitoring { before (): call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) { throw new PolicyViolation("Cipher text required."); } }

  3. Formula-based Dispatch BDD-based Dispatch Assessment Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) . . . Connection connection = new RemoteConnection("www.st.informatik.tu − darmstadt.de"); Text text = new PlainText("Encrypt me!"); connection.transmit(text); . . .

  4. Formula-based Dispatch BDD-based Dispatch Assessment Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) . . . Connection connection = new RemoteConnection("www.st.informatik.tu − darmstadt.de"); Text text = new PlainText("Encrypt me!"); connection.transmit(text); . . .

  5. Formula-based Dispatch BDD-based Dispatch Assessment Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) target (LocalConnection)

  6. Formula-based Dispatch BDD-based Dispatch Assessment Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) target (LocalConnection) ! target (LocalConnection)

  7. Formula-based Dispatch BDD-based Dispatch Assessment Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) target (LocalConnection) args (PlainText) ! target (LocalConnection)

  8. Formula-based Dispatch BDD-based Dispatch Assessment Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) before (); connection.transmit(text); target (LocalConnection) args (PlainText) ! target (LocalConnection)

  9. Formula-based Dispatch BDD-based Dispatch Assessment From Pointcuts to Formulas Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText)))

  10. Formula-based Dispatch BDD-based Dispatch Assessment From Pointcuts to Formulas Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText)))

  11. Formula-based Dispatch BDD-based Dispatch Assessment From Pointcuts to Formulas Example Pointcut call ( void Connection.transmit(Text)) && (( target (LocalConnection) && args (PlainText) && ! cflow ( call ( void Log.debug()))) || (! target (LocalConnection) && args (PlainText))) Example Formula φ = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 )

  12. Formula-based Dispatch BDD-based Dispatch Assessment From Formulas to Strategies Example Formula φ = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ) ∨ ∧ ∧ x 1 x 2 x 3 x 1 x 2

  13. Formula-based Dispatch BDD-based Dispatch Assessment From Formulas to Strategies Example Formula φ = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ) ∨ ∧ ∧ x 1 x 2 x 3 x 1 x 2 ⊤ ⊥

  14. Formula-based Dispatch BDD-based Dispatch Assessment From Formulas to Strategies Example Formula φ = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ) x 1 x 2 x 3 x 1 x 2 ⊤ ⊥

  15. Formula-based Dispatch BDD-based Dispatch Assessment Partial Redundancy Elimination x 1 x 2 x 3 x 1 x 1 x 2 ⊤ ⊥

  16. Formula-based Dispatch BDD-based Dispatch Assessment Partial Redundancy Elimination x 1 x 2 x 3 x 1 x 1 x 2 ⊤ ⊥

  17. Formula-based Dispatch BDD-based Dispatch Assessment Partial Redundancy Elimination x 1 x 2 x 3 x 1 x 1 x 2 ⊤ ⊥

  18. Formula-based Dispatch BDD-based Dispatch Assessment Partial Redundancy Elimination x 1 x 2 x 3 x 1 x 1 x 2 ⊤ ⊥ Formulas may prevent complete redundancy elimination.

  19. Formula-based Dispatch BDD-based Dispatch Assessment Dispatch Functions Residual dispatch at a join point shadow can be viewed as the evaluation of a Boolean function. f φ : { 0 , 1 } n → { 0 , 1 } Whether the advice is applicable depends on the n atomic pointcuts x 1 , . . . , x n occurring in the residue φ .

  20. Formula-based Dispatch BDD-based Dispatch Assessment Two Assumptions on Advice Dispatch Evaluation is side-effect free. 1 Binding of parameters is not a side-effect. 2

  21. Formula-based Dispatch BDD-based Dispatch Assessment From Formulas to BDDs to Strategies Example Formula φ = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ) x 2 1 x 1 x 2 x 3 0

  22. Formula-based Dispatch BDD-based Dispatch Assessment Full Redundancy Elimination x 2 1 x 1 x 2 x 3 0 Reduced ordered binary decision diagrams offer complete redundancy elimination.

  23. Formula-based Dispatch BDD-based Dispatch Assessment f φ 1 ( x ) 1 Example advice 1 ; 0 before () : joinPointShadow && φ 1 { advice 1 ; } f φ 2 ( x ) before () : joinPointShadow 1 && φ 2 { advice 2 ; } advice 2 ; 0 joinPointShadow;

  24. Formula-based Dispatch BDD-based Dispatch Assessment Extended Dispatch Functions Residual dispatch at a shared shadow can be viewed as the evaluation of an extended Boolean function. f Φ : { 0 , 1 } n → { 0 , 1 } m Which combination of the m advice is applicable depends on the n atomic pointcuts jointly occurring in the residues φ 1 , . . . , φ m .

  25. Formula-based Dispatch BDD-based Dispatch Assessment Three Assumptions on Advice Dispatch Evaluation is side-effect free. 1 Binding of parameters is not a side-effect. 2 Execution of an advice does not affect evaluation. 3

  26. Formula-based Dispatch BDD-based Dispatch Assessment f { φ 1 ,φ 2 } 00 joinPointShadow; Example 10 advice 1 ; before () : joinPointShadow 01 joinPointShadow; && φ 1 { advice 1 ; } before () : joinPointShadow advice 2 ; && φ 2 { advice 2 ; } 11 joinPointShadow; advice 1 ; advice 2 ; joinPointShadow;

  27. Formula-based Dispatch BDD-based Dispatch Assessment Example Formulas φ 1 = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ) φ 2 = x 2 ∧ x 4 x 2 1 x 1 x 2 x 3 0 x 4 1 x 2 0

  28. Formula-based Dispatch BDD-based Dispatch Assessment Example Formulas φ 1 = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ) φ 2 = x 2 ∧ x 4 x 2 10 x 1 x 2 x 3 00 x 4 01 x 2 00

  29. Formula-based Dispatch BDD-based Dispatch Assessment Example Formulas φ 1 = ( x 1 ∧ x 2 ∧ x 3 ) ∨ ( x 1 ∧ x 2 ) φ 2 = x 2 ∧ x 4 x 3 00 x 2 x 1 x 4 01 x 2 10

  30. Formula-based Dispatch BDD-based Dispatch Assessment Experimental Setup Formulas of signature � x 1 , . . . , x 5 � ∨ At most 6 propositional operators ( ∧ , ∨ , ¬ ) Non-trivial, i.e., not ∧ ∧ equivalent to ⊥ or ⊤ Simple, i.e., the laws of x 1 x 2 x 2 x 3 x 1 idempotence or boundedness are not applicable

  31. Formula-based Dispatch BDD-based Dispatch Assessment Experimental Setup (cont’d) Evaluation Cost x 2 1 x 1 args target cflow x 2 x 3 0 Compared by average evaluation cost BDDs � x 1 , . . . , x 5 � -ordered

  32. Formula-based Dispatch BDD-based Dispatch Assessment Experimental Setup (cont’d) Evaluation Cost x 2 1 x 1 x 1 x 2 x 3 x 4 x 5 x 2 x 3 0 Compared by average evaluation cost BDDs � x 1 , . . . , x 5 � -ordered

  33. Formula-based Dispatch BDD-based Dispatch Assessment Results Formulas better Ordered BDDs better Average Evaluation Cost (Ordered BDD) Average Evaluation Cost (Formula)

  34. Formula-based Dispatch BDD-based Dispatch Assessment Results Formulas better Ordered BDDs better > 0 . 5 % of formulas > 0 . 05 % of formulas > 0 . 005 % of formulas > 0 . 0005 % of formulas Average Evaluation Cost (Ordered BDD) BDD-based dispatch functions outperform formula-based ones 80% of the time. (Further 7.7% are tied.) Average Evaluation Cost (Formula)

  35. Formula-based Dispatch BDD-based Dispatch Assessment Conclusion Extended dispatch functions are a useful concept. BDD-based dispatch functions offer complete redundancy elimination. They clearly outperform formula-based dispatch functions.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend