architectural design the coordination perspective
play

Architectural design: the coordination perspective Jos Proena & - PowerPoint PPT Presentation

Architectural design: the coordination perspective Jos Proena & Lus Soares Barbosa HASLab - INESC TEC & UM Arquitectura e Clculo 2017-18 W N B Reo eclipse toolset PNLTR[N ]MJN[RN0


  1. Architectural design: the coordination perspective José Proença & Luís Soares Barbosa HASLab - INESC TEC & UM Arquitectura e Cálculo 2017-18 W N B

  2. Reo eclipse toolset PN���LTR�[N ]�MJ�N�[R�N0 http://reo.project.cwi.nl/update

  3. Reo Live <J�JCL�R��0 https://reolanguage.github.io/ReoLive/snapshot/

  4. Reo semantics Jongmans and Arbab 2012 Overview of Thirty Semantic Formalisms for Reo

  5. Reo semantics • Coalgebraic models • Operational models • Timed data streams • Constraint automata • Record streams • Variants of constraint automata • Port automata • Coloring models • Timed • Two colors • Probabilistic • Three colors • Continuous-time • Tile models • Quantitative • Other models • Resource-sensitive timed • Process algebra • Transactional • Constraints • Context-sensitive automata • Petri nets & intuitionistic logic • Büchi automata • Unifying theories of programming • Reo automata • Structural operational semantics • Intentional automata • Action constraint automata • Behavioral automata • Structural operational semantics

  6. BAR ZSN PA SOS 2CM 3CM ABAR RS ITLL CA LCA SPCA QCA TNCA Constr. Tiles IA TDS GA CASM TCA CCA RSTCA ACA mCRL2 mC RL2 BA QIA UTP PCA SGA 2 cm : Coloring models with two colors [28, 29, 33] : Port automata [45] pa 3 cm : Coloring models with three colors [28, 29, 33] : Probabilistic ca [15] pca : Augmented bar [39, 40] : Quantitative ca [12, 53] abar qca : Action ca [46] : Quantitative ia [13] aca qia : Behavioral automata [61] : Record streams [38, 40] ba rs : B¨ uchi automata of records [38, 40] rstca : Resource-sensitive timed ca [51] bar : Constraint automata [10, 17] : Stochastic ga [56, 57] ca sga : ca with state memory [60] : Structural operational semantics [58] casm sos : Continuous-time ca [18] : Simple pca [15] cca spca Constr. : Propositional constraints [30, 31, 32] : Timed ca [8, 9] tca : Guarded automata [20, 21] : Timed data streams [4, 5, 14, 62] ga tds : Intentional automata [33] Tiles : Tile models [11] ia : Intuitionistic temporal linear logic [27] tnca : Transactional ca [54] itll : Labeled ca [44] : Unifying theories of programming [55, 52] lca utp : Process algebra [47, 48, 49] : Zero-safe nets [27] zsn mCRL2

  7. Outline Formalism Synchr. Data Time Context Partial Connector CC2 - CC3 - Colouring Port Constraint Time Automata - - Automata Automata CA ✓ ✓ ✓ ✓ ✗ Constraints

  8. Outline Intuitive & visual Formalism Synchr. Data Time Context Partial 1 2 3 Connector CC2 - CC3 - Colouring Compilation & verification Port Constraint Time Automata - - Automata Automata CA ✓ ✓ ✓ ✓ ✗ Constraints Runtime / scalability

  9. Rd Wr Rd Reo Connector Colouring Dave Clarke, David Costa, and Farhad Arbab. Connector colouring I: Synchronisation and context dependency

  10. Behaviour? �N�PN�0�MJ�J�OTW�[�O�W��WVN�WO���N� [W]�LN�NVM[��W���N�[RVS�NVM TW[[a�[aVL0�NR��N��MJ�J�OTW�[�O�W����N� [W]�LN��W���N�[RVS�NVM���B�R��R[�TW[� �����*0�MJ�J�OTW�[�O�W����N�[W]�LN�NVM� �W���N��]OON����NLW�RVP�J������]TT�* �����]TT�*0�MJ�J�OTW�[�O�W����N��]OON�� • �W���N�[RVS��]OON����NLW�RVP�J������*

  11. Colourings to describe synchronous dataflow a c d e b a c c d d e a b c d c d e b a c d c b

  12. Colouring composition a LWTW]�[��J�L�� c d e RV�VWMN[ a b c d e a b c d e a b c d e b a c d e b

  13. Possible behaviour a c d e b *��+��,��d *��-�����,��d -��.�����d *��+��,��d *��+��,��-��.�����d -��.�����d

  14. Colouring semantics (CC2) • Colouring : End → {Flow, NoFlow} • Colouring table : Set(Colouring) • Composition = matching colours • More visual (intuitive) • Used for generating animations

  15. Colouring semantics (CC2) • Colouring : End → {Flow, NoFlow} • Colouring table : Set(Colouring) • Composition = matching colours CT 1 . / CT 2 = { cl 1 . / cl 2 | cl 1 ∈ CT 1 , cl 2 ∈ CT 2 , cl 1 _ cl 2 } • More visual (intuitive) = ∀ e ∈ dom ( cl 1 ) ∩ dom ( cl 2 ) · cl 1 ( e ) = cl 2 ( e ) cl 1 _ cl 2 • Used for generating animations = cl 1 . / cl 2 cl 1 ∪ cl 2

  16. Exercise: compose colouring tables Rd Wr Rd Wr Rd

  17. ac, bc acd , bcd q M , q L , q f q M , q L , q e ac, bc e, ace, bce Port Automata Christian Koehler and Dave Clarke. Decomposing Port Automata. 2009

  18. Connector behaviour (statefull) • Dataflow behaviour is discrete in time: it can be observed and snapshots taken at a pace fast enough to obtain (at least) a snapshot as often as the configuration of the connector changes • At each time unit the connector performs an evaluation step: it evaluates its configuration and according to its interaction constraints changes to another (possibly different) configuration • A connector can fire multiple ports in the same evaluation step

  19. Port Automata A = ( Q , N , → , Q 0 ) Q set of states N a set of ports N → ⊆ Q × 2 N × Q a transition relation Q 0 ⊆ Q a set of initial states ��JV[R�RWV[��][���J�N�J�VWV�N���a�[N��WO��W��[! a ab q f q e N�J��TN[0 q L a b a a b b

  20. Composing steps a c d e b ac cd d q f q e � ⇥ � ⇥ q M q L c bc e ac, bc acd , bcd q M , q L , q f q M , q L , q e ac, bc e, ace, bce

  21. Composing steps a c d e b ac cd d q f q e � ⇥ � ⇥ q M q L c bc e ac . / cd . / d acd = ac . / c . / d ⊥ =

  22. Composing steps a c d e b ac cd d q f q e � ⇥ � ⇥ q M q L c bc e merger ; lossy ; fifo <J�JCL�R��0 https://reolanguage.github.io/ReoLive/snapshot/

  23. Composition - formally Definition 2. The product of two port automata A 1 = ( Q 1 , N 1 , → 1 , Q 0 , 1 ) and A 2 = ( Q 2 , N 2 , → 2 , Q 0 , 2 ) is defined by A 1 ◃ ▹ A 2 = ( Q 1 × Q 2 , N 1 ∪ N 2 , → , Q 0 , 1 × Q 0 , 2 ) where → is defined by the rule N 1 N 2 − → 1 p 1 − → 1 p 2 N 1 ∩ N 2 = N 2 ∩ N 1 q 1 q 2 N 1 ∪ N 2 ⟨ q 1 , q 2 ⟩ − → ⟨ p 1 , p 2 ⟩ and the following and its symmetric rule N 1 N 1 ∩ N 2 = ∅ − → 1 p 1 q 1 N 1 ⟨ q 1 , q 2 ⟩ − → ⟨ p 1 , q 2 ⟩

  24. Formalize and compose → N 1 N 2 − → 1 p 1 − → 1 p 2 N 1 ∩ N 2 = N 2 ∩ N 1 q 1 q 2 N 1 ∪ N 2 ⟨ q 1 , q 2 ⟩ − → ⟨ p 1 , p 2 ⟩ N 1 − → 1 p 1 N 1 ∩ N 2 = ∅ q 1 N 1 A = ( Q , N , → , Q 0 ) ⟨ q 1 , q 2 ⟩ − → ⟨ p 1 , q 2 ⟩ a b q f q e s f s e . / c b c a b b

  25. Examples I �TW���NP]TJ�W� a b gLh�LWV��WT[�OTW�� O�W��gJh��W�g�h c a b MJ�J�OTW�[�O�W��gJh� �W�g�h��?���RO� NR��N��gLh�W��gMh� �J�N�MJ�J c d

  26. Examples I �TW���NP]TJ�W� a b g�h�LWV��WT[�OTW�� O�W��gJh��W�gLh c dupl*id ; id*drain a b MJ�J�OTW�[�O�W��gJh� �W�g�h��?���RO� NR��N��gLh�W��gMh� �J�N�MJ�J c d dupl*merger ; id*drain

  27. Examples II CaVL��WVR[RVP��J��RN� a MJ�J�OTW�[�gJh�e2�g�h� b ���� c MJ�J�OTW�[�gLh�e2�gMh� d 4T�N�VJ�W� a z MJ�J�OTW�[�O�W��gJh� JVM�O�W��g�h��W�gbh�� JT�N�VJ�RVP����N���J� b [aVL��LWV[��JRV�[�

  28. Examples III ?�4T�N�VJ�W� a z MJ�J�OTW�[�O�W��gJh��g�h�� gLh��JVM�gMh��W�gbh�� JT�N�VJ�RVP����N���J� b [aVL��LWV[��JRV�[� c d

  29. Examples IV a d e b c f • �J�J�OTW�[�O�W��gJh��W�gMh��g�h��W�gNh�� CNY]NVLN� JVM�gLh��W�gOh�JT�N�VJ�RVP(

  30. Reo in mCRL2 a c d e b cd Lossy = ( c|d + c ).Lossy q L c ac q M bc Merger = ( a|c + b|c ).Merger

  31. Reo in mCRL2 a c d e b ac cd d q f q e . / . / q M q L c bc e Conn = hide( { c,d } , block( { c 1 ,c 2 ,d 1 ,d 2 } , comm( { c 1 |c 2 -> c, d 1 |d 2 -> d} , Merger || Lossy || FIFO1 )))

  32. Reo in mCRL2 a c d e b 1��]N�(JcLcMcN2��]N� ac cd d H��]N�(JcLcMcN(NIOJT[N q f q e . / . / q M q L c bc e Conn = hide( { c,d } , block( { c 1 ,c 2 ,d 1 ,d 2 } , comm( { c 1 |c 2 -> c, d 1 |d 2 -> d} , Merger || Lossy || FIFO1 )))

  33. Build connectors J�����L��M��N��d J��L��N��d J�����L��d J��M�����N��L��O��d M��N��O��d J���L�M�N�d J�����L��M ( [�W�

Recommend


More recommend