Abstract
We present a formal operational semantics for Stateflow, the graphical Statecharts-like language of the Matlab/Simulink tool suite that is widely used in model-based development of embedded systems. Stateflow has many tricky features but our operational treatment yields a surprisingly simple semantics for the subset that is generally recommended for industrial applications. We have validated our semantics by developing an interpreter that allows us to compare its behavior against the Matlab simulator. We have used the semantics as a foundation for developing prototype tools for formal analysis of Stateflow designs.
Similar content being viewed by others
References
Anton, J., da Costa, P., Errington, L.: Formal synthesis of generators for embedded systems. Technical report, Kestrel Technology (2005)
Banphawatthanarak, C., Krogh, B.H., Butts, K.: Symbolic verification of executable control specifications. In: Proceedings of the 10th IEEE International Symposium on Computer Aided Control System Design, pp. 581–586. Kohala Coast—Island of Hawai’i, HI (1999)
Buck, D., Rau, A.: On modelling guidelines: Flowchart patterns for Stateflow. Softwaretechnik-Trends 21(2) (2001)
Caspi, P., Curic, A., Maignan, A., Sofronis, C., Tripakis, S.: Translating discrete-time Simulink to Lustre. In: 3rd International ACM Conference on Embedded Software, Lecture Notes in Computer Science, vol. 2855, pp. 84–99. Springer, Heidelberg (2003)
Ford: Structured analysis and design using Matlab/Simulink/Stateflow—modeling style guidelines. Technical. report, Ford Motor Company (1999). http://vehicle.me.berkeley.edu/mobies/papers/stylev242.pdf. Available at http://vehicle.me.berkeley.edu/mobies/papers/stylev242.pdf
Gnesi S., Latella D. and Massink M. (2002). Modular semantics for a UML Statechart diagrams kernel and its extension to Multicharts and branching time model checking. J. Logic Algeb. Program. 51(1): 43–75
Hamon, G.: A denotational semantics for Stateflow. In: EMSOFT 2005: Proceedings of the 5th ACM Workshop on Embedded Software, pp. 164–172. Association for Computing Machinery, Jersey City, NJ (2005)
Hamon, G., de Moura, L., Rushby, J.: Generating efficient test sets with a model checker. In: 2nd International Conference on Software Engineering and Formal Methods, pp. 261–270. IEEE Computer Society, Beijing, China (2004)
Hamon, G., de Moura, L., Rushby, J.: Automated test generation with SAL. Technical note, Computer Science Laboratory, SRI International, Menlo Park, CA Available at http://www.csl.sri.com/users/rushby/abstracts/sal-atg (2005)
Harel D. (1987). Statecharts: a visual formalism for complex systems. Sci. Comput. Program. 8(3): 231–274
Lüttgen, G., von der Beeck, M., Cleaveland, R.: A compositional approach to Statecharts semantics. In: Rosenblum, D., (ed.) 8th International ACM Symposium on Foundations of Software Engineering, pp. 120–129. San Diego, Ca (2000)
The Mathworks: Stateflow and Stateflow Coder, User’s Guide, release 13sp1 edn. (2003). Available at http://www.mathworks. com/access/helpdesk/help/pdf_doc/stateflow/sf_ug.pdf
Mikk, E., Lakhnech, Y., Petersohn, C., Siegel, M.: On formal semantics of Statecharts as supported by Statemate. In: 2nd BCS-FACS Northern Formal Methods Workshop. BCS-EWIC (1997)
de Moura, L, Owre, S., Rueß, H., Rushby, J., Shankar, N., Sorea, M., Tiwari, A.: SAL 2. In: Alur, R., Peled, D.(eds.) Computer-aided verification, CAV ’2004, Lecture Notes in Computer Science, vol. 3114, pp. 496–500. Springer, Boston, MA SAL home page: http://sal.csl.sri.com/ (2004)
Plotkin, G.: A structural approach to operational semantics. Technical Report DAIMI-FN-19, Aarhus University (1981)
Scaife, N., Sofronis, C., Caspi, P., Tripakis, S., Maraninchi, F.: Defining and translating a “safe” subset of Simulink/Stateflow into Lustre. In: EMSOFT 2004: Proceedings of the Fourth ACM Workshop on Embedded Software, pp. 259–268. Pisa, Italy (2004)
Strachey, C., Wadsworth, C.P.: Continuations: A mathematical semantics for handling full jumps. Higher-Order Symbolic Comput. 13, 135–152 (2000), Originally published 1974
Tiwari A., Shankar N. and Rushby J. (2003). Invisible formal methods for embedded control systems. In:Proceedings of the IEEE 91(1): 29–39
Author information
Authors and Affiliations
Corresponding author
Additional information
This material is based on work performed at SRI and supported by the National Science Foundation under Grant No. CCR-0086096 through the University of Illinois and by NASA Langley Research Center under Contract NAS1-00079.
This work was performerd while the author was at SRI International, Menlo Park CA, USA, and at Chalmers Institute of Technology, Göteborg, Sweden.
Rights and permissions
About this article
Cite this article
Hamon, G., Rushby, J. An operational semantics for Stateflow. Int J Softw Tools Technol Transf 9, 447–456 (2007). https://doi.org/10.1007/s10009-007-0049-7
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10009-007-0049-7