Type Inference of Simulink Hierarchical Block Diagrams in Isabelle

  • Viorel PreoteasaEmail author
  • Iulia Dragomir
  • Stavros Tripakis
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10321)


Simulink is a de-facto industrial standard for embedded system design. In previous work, we developed a compositional analysis framework for Simulink, the Refinement Calculus of Reactive Systems (RCRS), which allows checking compatibility and substitutability of components. However, standard type checking was not considered in that work. In this paper we present a method for the type inference of Simulink models using the Isabelle theorem prover. A Simulink diagram is translated into an (RCRS) Isabelle theory. Then Isabelle’s powerful type inference mechanism is used to infer the types of the diagram based on the types of the basic blocks. One of the aims is to handle formally as many diagrams as possible. In particular, we want to be able to handle even those diagrams that may have typing ambiguities, provided that they are accepted by Simulink. This method is implemented in our toolset that translates Simulink diagrams into Isabelle theories and simplifies them. We evaluate our technique on several case studies, most notably, an automotive fuel control system benchmark provided by Toyota.


  1. 1.
    Agrawal, A., Simon, G., Karsai, G.: Semantic translation of Simulink/stateflow models to hybrid automata using graph transformations. Electron. Notes Theoret. Comput. Sci. 109, 43–56 (2004)CrossRefzbMATHGoogle Scholar
  2. 2.
    Chen, C., Dong, J.S., Sun, J.: A formal framework for modeling and validating Simulink diagrams. Formal Aspects Comput. 21(5), 451–483 (2009)CrossRefzbMATHGoogle Scholar
  3. 3.
    Damas, L., Milner, R.: Principal type-schemes for functional programs. In: POPL 1982, pp. 207–212. ACM (1982)Google Scholar
  4. 4.
    De Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008). doi: 10.1007/978-3-540-78800-3_24 CrossRefGoogle Scholar
  5. 5.
    Dijkstra, E.: Guarded commands, nondeterminacy and formal derivation of programs. Comm. ACM 18(8), 453–457 (1975)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    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
  7. 7.
    Dutertre, B., de Moura, L.: The Yices SMT solver. Technical report, SRI International (2006)Google Scholar
  8. 8.
    Haftmann, F., Wenzel, M.: Constructive type classes in Isabelle. In: Altenkirch, T., McBride, C. (eds.) TYPES 2006. LNCS, vol. 4502, pp. 160–174. Springer, Heidelberg (2007). doi: 10.1007/978-3-540-74464-1_11 CrossRefGoogle Scholar
  9. 9.
    Jin, X., Deshmukh, J.V., Kapinski, J., Ueda, K., Butts, K.: Powertrain control verification benchmark. In: HSCC, pp. 253–262. ACM (2014)Google Scholar
  10. 10.
    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, Heidelberg (2006). doi: 10.1007/11901433_33 CrossRefGoogle Scholar
  11. 11.
    Minopoli, S., Frehse, G.: SL2SX translator: from Simulink to SpaceEx models. In: HSCC, pp. 93–98. ACM (2016)Google Scholar
  12. 12.
    Nipkow, T., Wenzel, M., Paulson, L.C.: Isabelle/HOL: A Proof Assistant for Higher-Order Logic. Springer, Heidelberg (2002)CrossRefzbMATHGoogle Scholar
  13. 13.
    Owre, S., Rushby, J.M., Shankar, N.: PVS: a prototype verification system. In: Kapur, D. (ed.) CADE 1992. LNCS, vol. 607, pp. 748–752. Springer, Heidelberg (1992). doi: 10.1007/3-540-55602-8_217 Google Scholar
  14. 14.
    Preoteasa, V., Dragomir, I., Tripakis, S.: Type inference of Simulink hierarchical block diagrams in Isabelle. CoRR, abs/1612.05494 (2016)Google Scholar
  15. 15.
    Preoteasa, V., Tripakis, S.: Refinement calculus of reactive systems. In: EMSOFT, pp. 2:1–2:10. ACM (2014)Google Scholar
  16. 16.
    Preoteasa, V., Tripakis, S.: Towards compositional feedback in non-deterministic and non-input-receptive systems. In: LICS. ACM (2016)Google Scholar
  17. 17.
    Reicherdt, R., Glesner, S.: Formal verification of discrete-time MATLAB/Simulink models using boogie. In: Giannakopoulou, D., Salaün, G. (eds.) SEFM 2014. LNCS, vol. 8702, pp. 190–204. Springer, Cham (2014). doi: 10.1007/978-3-319-10431-7_14 Google Scholar
  18. 18.
    Roy, P., Shankar, N.: SimCheck: a contract type system for Simulink. Innov. Syst. Softw. Eng. 7(2), 73–83 (2011)CrossRefGoogle Scholar
  19. 19.
    Sfyrla, V., Tsiligiannis, G., Safaka, I., Bozga, M., Sifakis, J.: Compositional translation of Simulink models into synchronous BIP. In: SIES, pp. 217–220. IEEE (2010)Google Scholar
  20. 20.
    The Coq Development Team. The Coq Proof Assistant Reference Manual – Version V8.6, December 2016Google Scholar
  21. 21.
    Tripakis, S., Lickly, B., Henzinger, T.A., Lee, E.A.: A theory of synchronous relational interfaces. ACM Trans. Program. Lang. Syst. 33(4), 14:1–14:41 (2011)CrossRefGoogle Scholar
  22. 22.
    Tripakis, S., Pinello, C., Benveniste, A., Sangiovanni-Vincentelli, A., Caspi, P., Natale, M.D.: Implementing synchronous models on loosely time-triggered architectures. IEEE Trans. Comput. 57(10), 1300–1314 (2008)MathSciNetCrossRefGoogle Scholar
  23. 23.
    Tripakis, S., Sofronis, C., Caspi, P., Curic, A.: Translating discrete-time Simulink to Lustre. ACM Trans. Embed. Comput. Syst. 4(4), 779–818 (2005)CrossRefGoogle Scholar
  24. 24.
    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
  25. 25.
    Zhou, C., Kumar, R.: Semantic translation of Simulink diagrams to input/output extended finite automata. Discret. Event Dyn. Syst. 22(2), 223–247 (2012)MathSciNetCrossRefzbMATHGoogle Scholar
  26. 26.
    Zou, L., Zhany, N., Wang, S., Franzle, M., Qin, S.: Verifying Simulink diagrams via a Hybrid Hoare Logic Prover. In: EMSOFT, pp. 9:1–9:10 (2013)Google Scholar

Copyright information

© IFIP International Federation for Information Processing 2017

Authors and Affiliations

  • Viorel Preoteasa
    • 1
    Email author
  • Iulia Dragomir
    • 2
  • Stavros Tripakis
    • 1
    • 3
  1. 1.Aalto UniversityEspooFinland
  2. 2.VerimagSaint-Martin-d’HéresFrance
  3. 3.University of CaliforniaBerkeleyUSA

Personalised recommendations