A Two-Way Path Between Formal and Informal Design of Embedded Systems

  • Mingshuai Chen
  • Anders P. Ravn
  • Shuling Wang
  • Mengfei Yang
  • Naijun ZhanEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10134)


It is well known that informal simulation-based design of embedded systems has a low initial cost and delivers early results; yet it cannot guarantee the correctness and reliability of the system to be developed. In contrast, the correctness and reliability of the system can be thoroughly investigated with formal design, but it requires a larger effort, which increases the development cost. Therefore, it is desirable for a designer to move between formal and informal design. This paper describes how to translate Hybrid CSP (HCSP) formal models into Simulink graphical models, so that the models can be simulated and tested using a MATLAB platform, thus avoiding expensive formal verification if the development is at a stage where it is considered unnecessary. Together with our previous work on encoding Simulink/Stateflow diagrams into HCSP, it provides a two-way path in the design of embedded systems, so that the designer can flexibly shift between formal and informal models. The translation from HCSP into Simulink diagrams is implemented as a fully automatic tool, and the correctness of the translation is justified using Unifying Theories of Programming (UTP).


Simulink HCSP UTP Verification Hybrid systems 



The work is supported partly by “973 Program” under grant No. 2014CB340701, by NSFC under grants 91418204 and 91118007, by CDZ project CAP (GZ 1023), and by the CAS/SAFEA International Partnership Program for Creative Research Teams.


  1. 1.
  2. 2.
  3. 3.
    Tiller, M.: Introduction to Physical Modeling with Modelica. Springer, New York (2001)CrossRefGoogle Scholar
  4. 4.
    SysML V 1.4 Beta Specification (2013).
  5. 5.
    Selic, B., Gerard, S.: Modeling and Analysis or Real-Time and Embedded Systems with UML and MARTE: Developing Cyber-Physical Systems. The Springer International Series in Engineering and Computer Science. The MK/OMG Press, Burlington (2013)Google Scholar
  6. 6.
    Balarin, F., Watanabe, Y., Hsieh, H., Lavagno, H., Passerone, C., Sangiovanni-Vincentelli, A.L.: Metropolis: an integrated electronic system design environment. IEEE Comput. 36(4), 45–52 (2003)CrossRefGoogle Scholar
  7. 7.
    Eker, J., Janneck, J., Lee, E.A., Liu, J., Liu, X., Ludvig, J., Neuendorffer, S., Sachs, S., Xiong, Y.: Taming heterogeneity - the ptolemy approach. Proc. IEEE 91(1), 127–144 (2003)CrossRefGoogle Scholar
  8. 8.
    Henzinger, T.: The theory of hybrid automata. In: LICS 1996, pp. 278–292, July 1996Google Scholar
  9. 9.
    Alur, R., Henzinger, T.A.: Modularity for timed and hybrid systems. In: Mazurkiewicz, A., Winkowski, J. (eds.) CONCUR 1997. LNCS, vol. 1243, pp. 74–88. Springer, Berlin (1997). doi: 10.1007/3-540-63141-0_6 CrossRefGoogle Scholar
  10. 10.
    He, J.: From CSP to hybrid systems. In: A Classical Mind, Essays in Honour of C.A.R. Hoare, pp. 171–189. Prentice Hall International (UK) Ltd. (1994)Google Scholar
  11. 11.
    Chaochen, Z., Ji, W., Ravn, A.P.: A formal description of hybrid systems. In: Alur, R., Henzinger, T.A., Sontag, E.D. (eds.) HS 1995. LNCS, vol. 1066, pp. 511–530. Springer, Berlin (1996). doi: 10.1007/BFb0020972 CrossRefGoogle Scholar
  12. 12.
    Platzer, A.: Differential-algebraic dynamic logic for differential-algebraic programs. J. Log. Comput. 20(1), 309–352 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Liu, J., Lv, J., Quan, Z., Zhan, N., Zhao, H., Zhou, C., Zou, L.: A calculus for hybrid CSP. In: Ueda, K. (ed.) APLAS 2010. LNCS, vol. 6461, pp. 1–15. Springer, Berlin (2010). doi: 10.1007/978-3-642-17164-2_1 CrossRefGoogle Scholar
  14. 14.
    Zou, L., Zhan, N., Wang, V., Fränzle, M., Qin, S.: Verifying simulink diagrams via a hybrid hoare logic prover. In: EMSOFT 2013, pp. 1–10 (2013)Google Scholar
  15. 15.
    Zou, L., Zhan, N., Wang, S., Fränzle, M.: Formal verification of simulink/stateflow diagrams. In: Finkbeiner, B., Pu, G., Zhang, L. (eds.) ATVA 2015. LNCS, vol. 9364, pp. 464–481. Springer, Cham (2015). doi: 10.1007/978-3-319-24953-7_33 CrossRefGoogle Scholar
  16. 16.
    Chen, M., Ravn, A.P., Wang, S., Yang, M., Zhan, N.: A two-way path between formal and informal design of embedded systems (extended version).
  17. 17.
  18. 18.
    Han, Z., Mosterman, P.J.: Towards sensitivity analysis of hybrid systems using simulink. HSCC 2013, 95–100 (2013)MathSciNetCrossRefGoogle Scholar
  19. 19.
    Tripakis, S., Sofronis, C., Caspi, P., Curic, A.: Translating discrete-time simulink to lustre. ACM Trans. Embedded Comput. Syst. 4(4), 779–818 (2005)CrossRefGoogle Scholar
  20. 20.
    Scaife, N., Sofronis, C., Caspi, P., Tripakis, S., Maraninchi, F.: Defining and translating a “safe” subset of simulink/stateflow into lustre. In: EMSOFT 2004, pp. 259–268. ACM (2004)Google Scholar
  21. 21.
    Cavalcanti, A., Clayton, P., O’Halloran, C.: Control law diagrams in Circus. In: Fitzgerald, J., Hayes, I.J., Tarlecki, A. (eds.) FM 2005. LNCS, vol. 3582, pp. 253–268. Springer, Berlin (2005). doi: 10.1007/11526841_18 CrossRefGoogle Scholar
  22. 22.
    Woodcock, J., Cavalcanti, A.: The semantics of Circus. In: Bert, D., Bowen, J.P., Henson, M.C., Robinson, K. (eds.) ZB 2002. LNCS, vol. 2272, pp. 184–203. Springer, Berlin (2002). doi: 10.1007/3-540-45648-1_10 CrossRefGoogle Scholar
  23. 23.
    Meenakshi, B., Bhatnagar, A., Roy, S.: Tool for translating simulink models into input language of a model checker. In: Liu, Z., He, J. (eds.) ICFEM 2006. LNCS, vol. 4260, pp. 606–620. Springer, Berlin (2006). doi: 10.1007/11901433_33 CrossRefGoogle Scholar
  24. 24.
    Sfyrla, V., Tsiligiannis, G., Safaka, I., Bozga, M., Sifakis, J.: Compositional translation of simulink models into synchronous BIP. In: IEEE Fifth International Symposium on Industrial Embedded Systems, SIES 2010, pp. 217–220. IEEE (2010)Google Scholar
  25. 25.
    Bliudze, S., Sifakis, J.: The algebra of connectors - structuring interaction in BIP. IEEE Trans. Comput. 57(10), 1315–1330 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
  26. 26.
    Yang, C., Vyatkin, V.: Transformation of simulink models to IEC 61499 Function Blocks for verification of distributed control systems. Control Eng. Pract. 20(12), 1259–1269 (2012)CrossRefGoogle Scholar
  27. 27.
    Zhou, C., Kumar, R.: Semantic translation of simulink diagrams to input/output extended finite automata. Discrete Event Dyn. Syst. 22(2), 223–247 (2012)MathSciNetCrossRefzbMATHGoogle Scholar
  28. 28.
    Minpoli, S., Frehse, G.: SL2SX translator: from simulink to SpaceEx verification tool. In: HSCC 2016 (2016)Google Scholar
  29. 29.
    Chen, R., Dong, J.S., Sun, J.: A formal framework for modeling and validating simulink diagrams. Formal Asp. Comput. 21(5), 451–483 (2009)CrossRefzbMATHGoogle Scholar
  30. 30.
    Boström, P.: Contract-based verification of simulink models. In: Qin, S., Qiu, Z. (eds.) ICFEM 2011. LNCS, vol. 6991, pp. 291–306. Springer, Berlin (2011). doi: 10.1007/978-3-642-24559-6_21 CrossRefGoogle Scholar
  31. 31.
    Roy, P., Shankar, N.: Simcheck: a contract type system for simulink. ISSE 7(2), 73–83 (2011)Google Scholar
  32. 32.
    Preoteasa, V., Tripakis, S.: Refinement calculus of reactive systems. In: EMSOFT 2014, pp. 2:1–2:10 (2014)Google Scholar
  33. 33.
    Dragomir, I., Preoteasa, V., Tripakis, S.: Compositional semantics and analysis of hierarchical block diagrams. In: Bošnački, D., Wijs, A. (eds.) SPIN 2016. LNCS, vol. 9641, pp. 38–56. Springer, Cham (2016). doi: 10.1007/978-3-319-32582-8_3 CrossRefGoogle Scholar
  34. 34.
    Zhan, N., Wang, S., Zhao, H.: Formal modelling, analysis and verification of hybrid systems. In: Liu, Z., Woodcock, J., Zhu, H. (eds.) Unifying Theories of Programming and Formal Engineering Methods. LNCS, vol. 8050, pp. 207–281. Springer, Berlin (2013). doi: 10.1007/978-3-642-39721-9_5 CrossRefGoogle Scholar
  35. 35.
    Wang, S., Zhan, N., Guelev, D.: An assume/guarantee based compositional calculus for hybrid CSP. In: Agrawal, M., Cooper, S.B., Li, A. (eds.) TAMC 2012. LNCS, vol. 7287, pp. 72–83. Springer, Berlin (2012). doi: 10.1007/978-3-642-29952-0_13 CrossRefGoogle Scholar
  36. 36.
    Guelev, D., Wang, S., Zhan, N.: Hoare reasoning about HCSP in the duration calculus (2013, submitted)Google Scholar
  37. 37.
    Hoare, C., He, J.: Unifying Theories of Programming, vol. 14. Prentice Hall, Englewood Cliffs (1998)zbMATHGoogle Scholar
  38. 38.
    Zou, L., Lv, J., Wang, S., Zhan, N., Tang, T., Yuan, L., Liu, Y.: Verifying chinese train control system under a combined scenario by theorem proving. In: Cohen, E., Rybalchenko, A. (eds.) VSTTE 2013. LNCS, vol. 8164, pp. 262–280. Springer, Berlin (2014). doi: 10.1007/978-3-642-54108-7_14 CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  • Mingshuai Chen
    • 1
  • Anders P. Ravn
    • 2
  • Shuling Wang
    • 1
  • Mengfei Yang
    • 3
  • Naijun Zhan
    • 1
    Email author
  1. 1.State Key Laboratory of Computer Science, Institute of SoftwareChinese Academy of Sciences BeijingChina
  2. 2.Department of Computer ScienceAalborg UniversityAalborgDenmark
  3. 3.Chinese Academy of Space TechnologyBeijingChina

Personalised recommendations