Skip to main content

Model-Based Static Code Analysis for MATLAB Models

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7609))

Abstract

MATLAB is widely used in scientific, engineering, and numerical computations. Complex systems such as digital signal processors, process control systems, etc. are modeled in MATLAB and analyzed; C implementation of the system can be automatically generated from the validated MATLAB model. We combine static analysis techniques with model-based deductive verification using SMT solvers to provide a framework to analyze MATLAB code. The analyzer is generated by translating the collecting semantics of a MATLAB script to a formula in first order logic over multiple underlying theories. Function calls in a script can be handled by importing SMT assertions obtained by analyzing MATLAB files containing function definitions. Logical specification of the desired program behavior (rather its negation) is incorporated as a first order logic formula. An SMT-LIB formula solver treats the combined formula as a “constraint” and “solves” it. The “solved form” can be used to identify logical errors in the MATLAB model.

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

Buying options

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 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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. http://www.omg.org/mda/

  2. http://www.omg.org/spec/UML/2.0/

  3. http://www.ni.com/labview/

  4. http://www.mathworks.com/products/matlab/

  5. Polyspace, http://www.mathworks.com/products/polyspace/

  6. http://www.vectorcast.com

  7. Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static 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, pp. 238–252. ACM, New York (1977)

    Chapter  Google Scholar 

  8. Gomes, I., Morgado, P., Gomes, T., Moreira, R.: An overview on the static code analysis approach in software development. Tech. rep., Faculdade de Engenharia da Universidade do Porto (2009)

    Google Scholar 

  9. Barrett, C., Stump, A., Tinelli, C.: The Satisfiability Modulo Theories Library, SMT-LIB (2010), http://www.SMT-LIB.org

  10. Dutertre, B., Moura, L.D.: The yices smt solver. Tech. rep. (2006)

    Google Scholar 

  11. http://www.ilovematlab.cn/forum.php

  12. Beizer, B.: Software testing techniques, 2nd edn. Van Nostrand Reinhold Co., New York (1990)

    Google Scholar 

  13. Woldman, K.I.: A dual programming approach to software testing. Master’s thesis, Santa Clara University (1992)

    Google Scholar 

  14. Collard, J.-F., Burnstein, I.: Practical Software Testing. Springer-Verlag New York, Inc., Secaucus (2002)

    Google Scholar 

  15. Clarke, E., Grumberg, O., Long, D.: Model checking. In: Proceedings of the NATO Advanced Study Institute on Deductive Program Design, pp. 305–349. Springer-Verlag New York, Inc., Secaucus (1996)

    Chapter  Google Scholar 

  16. Chang, C.-L., Lee, R.C.-T.: Symbolic Logic and Mechanical Theorem Proving, 1st edn. Academic Press, Inc., Orlando (1997)

    Google Scholar 

  17. Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer-Verlag New York, Inc., Secaucus (1999)

    MATH  Google Scholar 

  18. Holzmann, G.J.: Software Analysis and Model Checking. In: Brinksma, E., Larsen, K.G. (eds.) CAV 2002. LNCS, vol. 2404, pp. 1–16. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  19. Evans, D., Guttag, J., Horning, J., Tan, Y.: Lclint: A tool for using specifications to check code. In: ACM SIGSOFT Software Engineering Notes, vol. 19, pp. 87–96. ACM (1994)

    Google Scholar 

  20. Anderson, P., Reps, T.W., Teitelbaum, T., Zarins, M.: Tool support for fine-grained software inspection. IEEE Software 20(4), 42–50 (2003)

    Article  Google Scholar 

  21. Evans, D., Guttag, J., Horning, J., Tan, Y.M.: Lclint: A tool for using specifications to check code. In: ACM SIGSOFT Software Engineering Notes, vol. 19, pp. 87–96. ACM (1994)

    Google Scholar 

  22. Das, M., Lerner, S., Seigle, M.: Esp: Path-sensitive program verification in polynomial time. In: PLDI, pp. 57–68 (2002)

    Google Scholar 

  23. Martin, F.: PAG – an efficient program analyzer generator. International Journal on Software Tools for Technology Transfer 2(1), 46–67 (1998)

    Article  MATH  Google Scholar 

  24. Hallem, S., Chelf, B., Xie, Y., Engler, D.: A system and language for building system-specific, static analyses. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, pp. 69–82. ACM Press (2002)

    Google Scholar 

  25. Halbwachs, N., Proy, Y.-E., Roumanoff, P.: Verification of real-time systems using linear relation analysis. Formal Methods in System Design, 157–185 (1997)

    Google Scholar 

  26. Halbwachs, N., Merchat, D., Parent-vigouroux, C.: Cartesian Factoring of Polyhedra in Linear Relation Analysis. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 355–365. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  27. Alur, R., Dang, T., Ivancic, F.: Counterexample-guided predicate abstraction of hybrid systems. Theor. Comput. Sci. 354(2), 250–271 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  28. Aiken, A., Fähndrich, M., Su, Z.: Detecting Races in Relay Ladder Logic Programs. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 184–200. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  29. Lam, M.S., Whaley, J., Livshits, V.B., Martin, M.C., Avots, D., Carbin, M., Unkel, C.: Context-sensitive program analysis as database queries. In: PODS, pp. 1–12 (2005)

    Google Scholar 

  30. http://www.cs.cornell.edu/talc/

  31. Beato, M.E., Barrio-Solórzano, M., Cuesta, C.E., de la Fuente, P.: Uml automatic verification tool with formal methods. Electron. Notes Theor. Comput. Sci. 127(4), 3–16 (2005)

    Article  Google Scholar 

  32. http://www.cs.cmu.edu/~modelcheck/smv.html

  33. Doherty, J., Hendren, L., Radpour, S.: Kind analysis for matlab. In: Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2011, pp. 99–118. ACM, New York (2011)

    Chapter  Google Scholar 

  34. Joisha, P.G., Banerjee, P.: Correctly detecting intrinsic type errors in typeless languages such as matlab. SIGAPL APL Quote Quad 31(2), 7–21 (2000)

    Article  Google Scholar 

  35. Kaufmann, M., Kornerup, J., Reitblatt, M.: Formal verification of labview programs using the acl2 theorem prover. In: Proceedings of the Eighth International Workshop on the ACL2 Theorem Prover and its Applications, ACL2 2009, pp. 82–89. ACM, New York (2009)

    Chapter  Google Scholar 

  36. http://www.cs.utexas.edu/~moore/acl2/

  37. Softcheck, http://www.sofcheck.com/products/inspector.html

  38. Ayewah, N., Hovemeyer, D., Morgenthaler, J.D., Penix, J., Pugh, W.: Using static analysis to find bugs. IEEE Software 25(5), 22–29 (2008)

    Article  Google Scholar 

  39. Fortify, http://www.fortify.com/

  40. Wagner, D.: Static Analysis and Software Assurance. In: Cousot, P. (ed.) SAS 2001. LNCS, vol. 2126, p. 431. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  41. Klock source code analysis for android platform, http://www.klocwork.com/news/press-releases/releases/2008/PR-2008_11_11-Source-code-analysis-for-Android.php

  42. Jif: java information flow, http://www.cs.cornell.edu/jif/

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lu, Z., Mukhopadhyay, S. (2012). Model-Based Static Code Analysis for MATLAB Models. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. Technologies for Mastering Change. ISoLA 2012. Lecture Notes in Computer Science, vol 7609. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34026-0_35

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-34026-0_35

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-34025-3

  • Online ISBN: 978-3-642-34026-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics