Skip to main content

Abstract Interpretation of MATLAB Code with Interval Sets

  • Conference paper
  • First Online:
Book cover Critical Systems: Formal Methods and Automated Verification (AVoCS 2016, FMICS 2016)

Abstract

In this paper we present how formal methods can be applied to MATLAB programs. We apply a static analysis based on abstract interpretation to derive reachable values and identify potential programming faults fully automatically. Our verification is built on a formalization and abstraction of matrices, structures and data types, such as integers and IEEE-754 floats. Combined with previously presented static analysis for Simulink, our tool can verify block diagrams with embedded MATLAB code. We show the feasibility of our tool and compare our solutions against a commercial tool, using real world applications.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    See https://artshop.embedded.rwth-aachen.de/.

  2. 2.

    See http://www.mathworks.com/help/simulink/slref/matlabfunction.html.

  3. 3.

    See http://www.mathworks.com/help/control/ref/tf.html.

  4. 4.

    As long as the used machine implements the IEEE-754 standard.

  5. 5.

    See http://www.mathworks.com/help/matlab/ref/mex.html.

  6. 6.

    Only p vector norms and the 1,\(\infty \) norms for matrices.

  7. 7.

    Only for primitive types.

  8. 8.

    Which might include NaN values for floating point types.

  9. 9.

    See http://www.mathworks.com/help/matlab/matlab_env/set-workspace-and-variable-preferences.html.

  10. 10.

    http://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/37782/versions/1/previews/kalman.m/index.html.

  11. 11.

    http://stanford.edu/~boyd/l1_tf/.

  12. 12.

    Note that we use Simulink only to provide input to the MATLAB-function and do not model relevant functionality for the analysis to work or causing additional over approximation due to widening for loops in the Simulink model. Hence, the quality of the results is not affected by the MATLAB-function being integrated into Simulink.

  13. 13.

    The consecutive issuing of NaN warnings caused by NaN propagation can be disabled in order to identify only the cause of potential NaN occurrences. However, this option is disabled in the used default configuration.

References

  1. Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model forstatic analysis of programs by construction or approximation of fixpoints. In: Proceedings of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1977, New York, NY, USA (1977)

    Google Scholar 

  2. Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Miné, A., Rival, X.: Why does Astrée scale up? Formal Methods Syst. Des. 35(3), 229–264 (2009)

    Article  MATH  Google Scholar 

  3. Dernehl, C., Hansen, N., Gerlitz, T., Kowalewski, S.: Static value range analysis for MATLAB/simulink-models. In: INFORMATIK 2015 (2015)

    Google Scholar 

  4. Dernehl, C., Hansen, N., Kowalewski, S.: Combining abstract interpretation with symbolic execution for a static value range analysis of block diagrams. In: De Nicola, R., Kühn, E. (eds.) SEFM 2016. LNCS, vol. 9763, pp. 137–152. Springer, Heidelberg (2016). doi:10.1007/978-3-319-41591-8_10

    Chapter  Google Scholar 

  5. Doherty, J., Hendren, L., Radpour, S.: Kind analysis for MATLAB. ACM SIGPLAN Not. 46(10), 99–118 (2011)

    Article  Google Scholar 

  6. Elphick, D., Leuschel, M., Cox, S.: Partial evaluation of MATLAB. In: Pfenning, F., Macko, M. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 344–363. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  7. Feret, J.: Static analysis of digital filters. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 33–48. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  8. Gerlitz, T., Minh Tran, Q., Dziobek, C.: Detection and handling of model smells for MATLAB/simulink models. In: Proceedings of the International Workshop on Modelling in Automotive Software Engineering. CEUR (2015)

    Google Scholar 

  9. Granger, P.: Static analysis of arithmetical congruences. Int. J. Comput. Math. 30, 165–190 (1989)

    Article  MATH  Google Scholar 

  10. Hickey, T., Ju, Q., Van Emden, M.H.: Interval arithmetic: from principles to implementation. J. ACM (JACM) 48, 1038–1068 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  11. Kim, S.J., Koh, K., Boyd, S., Gorinevsky, D.: l1 trend filtering. SIAM Rev. 51, 339–360 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  12. Lu, Z., Mukhopadhyay, S.: Model-based static code analysis for MATLAB models. In: Margaria, T., Steffen, B. (eds.) ISoLA 2012, Part I. LNCS, vol. 7609, pp. 474–487. Springer, Heidelberg (2012)

    Google Scholar 

  13. Miné, A.: Relational abstract domains for the detection of floating-point run-time errors. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 3–17. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  14. Miné, A.: The octagon abstract domain. High.-Order Symb. Comput. 19, 31–100 (2006)

    Article  MATH  Google Scholar 

  15. Rohn, J.: Interval linear programming. In: Rohn, J. (ed.) Linear Optimization Problems with Inexact Data, pp. 79–100. Springer US, Boston (2006)

    Chapter  Google Scholar 

  16. Rümmer, P., Wahl, T.: An SMT-LIB theory of binary floating-point arithmetic. In: International Workshop on Satisfiability Modulo Theories (SMT) (2010)

    Google Scholar 

  17. Stattelmann, S., Biallas, S., Schlich, B., Kowalewski, S.: Applying static code analysis on industrial controller code. In: 19th IEEE International Conference on Emerging Technologies and Factory Automation (ETFA). IEEE (2014)

    Google Scholar 

Download references

Acknowledgements

This project was funded within the Priority Programme “Cooperatively Interacting Automobiles” of the German Science Foundation DFG (SPP 1835). The authors acknowledge the fruitful collaboration with the project partners.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christian Dernehl .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing AG

About this paper

Cite this paper

Dernehl, C., Hansen, N., Kowalewski, S. (2016). Abstract Interpretation of MATLAB Code with Interval Sets. In: ter Beek, M., Gnesi, S., Knapp, A. (eds) Critical Systems: Formal Methods and Automated Verification. AVoCS FMICS 2016 2016. Lecture Notes in Computer Science(), vol 9933. Springer, Cham. https://doi.org/10.1007/978-3-319-45943-1_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-45943-1_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-45942-4

  • Online ISBN: 978-3-319-45943-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics