Compositional Semantics and Analysis of Hierarchical Block Diagrams Iulia Dragomir 1 joint work with Viorel Preoteasa 1 and Stavros Tripakis 1 , 2 1 Aalto University, Finland 2 UC Berkeley, USA
Hierarchical block diagrams Consist of: atomic components 1 Inport Outport composed components (or Constant DelaySum Scope subsystems) communication links f (instantaneous) 1 1 1 c z a g e Outport Inport Add Simulink is a HBD language for UnitDelay embedded control system design. Goal: compositional semantics and analysis of HBDs Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 2 / 34
Compositional semantics and analysis of HBDs Compositional semantics: How to translate HBDs into a formal compositional reasoning framework Compositional analysis: Compositional verification Compatibility checking Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 3 / 34
Refinement Calculus of Reactive Systems (RCRS): a compositional reasoning framework Introduced in [Tripakis et al., TOPLAS 2011], and [Preoteasa et al., EMSOFT 2014] Formal model: monotonic predicate transformers 3 composition operators: serial ( ◦ ), parallel ( � ) and feedback (feedback) refinement operator Allows for: modeling open, non-deterministic, and non-input-receptive systems modeling safety and liveness properties component substitutability, reusability compositional and incremental design Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 4 / 34
A non-trivial problem: translating HBDs into RCRS Translation a c c a A B b d Input diagram Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 5 / 34
A non-trivial problem: translating HBDs into RCRS Translation 1 a c c a A B b d Input diagram a c A B b d d Id RCRS term: feedback a ( P A ◦ ( P B � Id )) Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 5 / 34
A non-trivial problem: translating HBDs into RCRS Translation 2 a c c a A B b d Input diagram c a B A d b b Id RCRS term: feedback c (( P B � Id ) ◦ P A ) Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 5 / 34
A non-trivial problem: translating HBDs into RCRS Translation 3 a c c a A B b d Input diagram c A b d a B RCRS term: feedback a,c ( P A � P B ) Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 5 / 34
A non-trivial problem: translating HBDs into RCRS Questions a c a c c a A B b A B b d d d Id Input diagram feedback a ( P A ◦ ( P B � Id )) c c a A b d B A d a b B b Id feedback c (( P B � Id ) ◦ P A ) feedback a,c ( P A � P B ) What are the advantages/drawbacks of these expressions? → How efficiently can these terms be analyzed? Are these expressions semantically equivalent? Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 5 / 34
Another non-trivial problem: expansion and simplification of RCRS terms “DelaySum” block diagram: f 1 1 1 c z a g e Outport Inport Add UnitDelay translation DelaySum = feedback (( Add � Id ) ◦ UnitDelay ◦ ( Split � Id )) expansion and simplification DelaySum = [ e, s � s, s + e ] Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 6 / 34
Contributions Implementation of RCRS in the Isabelle theorem prover 1 Translation of HBDs into RCRS 2 Expansion and simplification of RCRS terms in Isabelle 3 Case study: realistic Simulink model from Toyota 4 Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 7 / 34
Outline Context and motivation 1 The RCRS framework 2 Translation of HBDs to RCRS 3 Expansion and simplification 4 Implementation and evaluation 5 Conclusions 6 Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 8 / 34
Outline Context and motivation 1 The RCRS framework 2 Translation of HBDs to RCRS 3 Expansion and simplification 4 Implementation and evaluation 5 Conclusions 6 Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 8 / 34
Monotonic predicate transformers Classic mechanism to represent programs Weakest precondition semantics [Dijkstra et al.] Atomic Simulink components can be represented by monotonic predicate transformers (MPTs) Example: x Div = { x, y : y � = 0 } ◦ [ x, y � x y ] z Div y Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 9 / 34
Composition operators Serial composition y x z A B Parallel composition x y A z t B Feedback composition S x y Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 10 / 34
Composition operators Serial composition y x z A B Parallel composition x y A z t B Feedback composition S x y Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 10 / 34
Composition operators Serial composition y x z A B Parallel composition x y A z t B Feedback composition S x y Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 10 / 34
Outline Context and motivation 1 The RCRS framework 2 Translation of HBDs to RCRS 3 Translating atomic components Translating HBDs Expansion and simplification 4 Implementation and evaluation 5 Conclusions 6 Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 11 / 34
Outline Context and motivation 1 The RCRS framework 2 Translation of HBDs to RCRS 3 Translating atomic components Translating HBDs Expansion and simplification 4 Implementation and evaluation 5 Conclusions 6 Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 11 / 34
Translating (standard) atomic components An atomic component becomes an atomic monotonic predicate transformer. Examples: x a Div component z y Div Div = { x, y : y � = 0 } ◦ [ x, y � x y ] x an Add component z y Add Add = [ x, y � x + y ] Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 12 / 34
Translating stateful atomic components Stateful atomic components define current- and next-state variables Example: a UnitDelay component y x UnitDelay UnitDelay = [ x, s � s, x ] s, s ′ Simulink representation UnitDelay x y s s ′ Atomic MPT representation Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 13 / 34
Translating continuous-time atomic components Continuous-time atomic components are discretized and parameterized by dt Example: an Integrator component Integrator x y Integrator ( dt ) = [ x, s � s, s + x · dt ] s, s ′ , dt Simulink representation x y Integrator s s ′ dt Atomic MPT representation Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 14 / 34
Outline Context and motivation 1 The RCRS framework 2 Translation of HBDs to RCRS 3 Translating atomic components Translating HBDs Expansion and simplification 4 Implementation and evaluation 5 Conclusions 6 Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 15 / 34
Composite monotonic predicate transformers f 1 1 1 c z a g e Outport Inport Add UnitDelay Simulink diagram ? translation DelaySum = feedback (( Add � Id ) ◦ UnitDelay ◦ ( Split � Id )) Composite MPT Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 16 / 34
Translation strategies 3 translation strategies: f 1 1 feedback-parallel 1 z c a g e Outport Inport Add UnitDelay incremental Simulink diagram feedbackless f c c a a f g e Add UnitDelay Split s s' Atomic MPTs representation Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 17 / 34
Feedback-parallel translation Key idea: compose all components in parallel and then connect outputs to inputs by applying feedback operations f c e Add ǁ f c a 1 feedback-parallel 1 s UnitDelay s' 1 c z a g e Outport Inport Add UnitDelay ǁ f a g Split DelaySum = feedback f,c,a ( Add � UnitDelay � Split ) Iulia Dragomir (Aalto Univ.) Compositional Semantics and Analysis of Hierarchical Block Diagrams December 8, 2016 18 / 34
Recommend
More recommend