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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Polyspace, http://www.mathworks.com/products/polyspace/
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)
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)
Barrett, C., Stump, A., Tinelli, C.: The Satisfiability Modulo Theories Library, SMT-LIB (2010), http://www.SMT-LIB.org
Dutertre, B., Moura, L.D.: The yices smt solver. Tech. rep. (2006)
Beizer, B.: Software testing techniques, 2nd edn. Van Nostrand Reinhold Co., New York (1990)
Woldman, K.I.: A dual programming approach to software testing. Master’s thesis, Santa Clara University (1992)
Collard, J.-F., Burnstein, I.: Practical Software Testing. Springer-Verlag New York, Inc., Secaucus (2002)
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)
Chang, C.-L., Lee, R.C.-T.: Symbolic Logic and Mechanical Theorem Proving, 1st edn. Academic Press, Inc., Orlando (1997)
Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer-Verlag New York, Inc., Secaucus (1999)
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)
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)
Anderson, P., Reps, T.W., Teitelbaum, T., Zarins, M.: Tool support for fine-grained software inspection. IEEE Software 20(4), 42–50 (2003)
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)
Das, M., Lerner, S., Seigle, M.: Esp: Path-sensitive program verification in polynomial time. In: PLDI, pp. 57–68 (2002)
Martin, F.: PAG – an efficient program analyzer generator. International Journal on Software Tools for Technology Transfer 2(1), 46–67 (1998)
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)
Halbwachs, N., Proy, Y.-E., Roumanoff, P.: Verification of real-time systems using linear relation analysis. Formal Methods in System Design, 157–185 (1997)
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)
Alur, R., Dang, T., Ivancic, F.: Counterexample-guided predicate abstraction of hybrid systems. Theor. Comput. Sci. 354(2), 250–271 (2006)
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)
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)
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)
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)
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)
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)
Ayewah, N., Hovemeyer, D., Morgenthaler, J.D., Penix, J., Pugh, W.: Using static analysis to find bugs. IEEE Software 25(5), 22–29 (2008)
Fortify, http://www.fortify.com/
Wagner, D.: Static Analysis and Software Assurance. In: Cousot, P. (ed.) SAS 2001. LNCS, vol. 2126, p. 431. Springer, Heidelberg (2001)
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
Jif: java information flow, http://www.cs.cornell.edu/jif/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)