Abstract

In the Matlab Simulink environment, systems can be modelled using Simulink block diagrams and Stateflow state charts. While stateful logic is more naturally modelled using Stateflow, in practice complex block diagrams are often used instead, resulting in models that are hard to understand and maintain. In order to improve the maintainability and understandability of large industrial models, this paper presents a strategy for refactoring Simulink block diagrams implementing stateful logic into functionally equivalent Stateflow state charts that more naturally represent the intended behaviour. To bridge the gap between the syntax of block diagrams and state charts, Mealy machines represented by tabular expressions are used as an intermediate representation. The compositional language of block diagrams is used to combine tables modelling individual blocks into a table for the entire block diagram which describes the high level state machine encoded in the Simulink subsystem. A prototype tool that performs the translation from Simulink to Stateflow automatically is discussed.

Highlights

  • The adoption of Model-Based Design in the development of embedded control systems across industries has led to the wide use of Matlab/Simulink/Stateflow as a supporting environment

  • A Mealy Machine m is a tuple (S, s0, Σ, Λ, ud), where S is a set of states, s0 ∈ S, Σ is a set of input values, Λ is a set of output values, and ud : Σ × S → Λ × S is a function which computes the current output and state from the current input and current state

  • We unify the presentation of decision logic in the two formalisms using two similar forms of tabular expressions: horizontal condition tables (HCTs) as presented in [28]; and state transition tables (STTs), which specialize HCTs to describe state charts to the ones presented in [24]

Read more

Summary

Introduction

The adoption of Model-Based Design in the development of embedded control systems across industries has led to the wide use of Matlab/Simulink/Stateflow as a supporting environment. The modelling capabilities provided by Simulink block diagrams and Stateflow state charts complement each other by providing languages for functional and stateful system specifications. Due to their individual strengths, one modelling formalism may be preferable for specifying certain classes of behaviours. Practice shows that Simulink is often used to specify stateful logic even though Stateflow would be a more appropriate implementation language This might occur during model evolution when modes of operation are added to previously mode-free block diagrams, and developers find it easier to modify the existing Simulink logic to accommodate the change than to reproduce the behaviour from scratch in a state chart.

Mealy Machines
Tabular Expressions
Categorical Framework
Translation Strategy
Block Diagrams to HCTs
Mealy Machines and Their Combinations via Functions
Functional Embedding and Wiring Morphisms
Block Diagrams to Horizontal Condition Tables
10 Running false
HCTs to STTs
Defining Modes
Converting to State Charts and Simplifying
Related Work
Conclusion
18. McSCert
26. The MathWorks
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.