Skip to main content

McSAF: A Static Analysis Framework for MATLAB

  • Conference paper
Book cover ECOOP 2012 – Object-Oriented Programming (ECOOP 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7313))

Included in the following conference series:

Abstract

Matlab is an extremely popular programming language used by scientists, engineers, researchers and students world-wide. Despite its popularity, it has received very little attention from compiler researchers. This paper introduces McSaf, an open-source static analysis framework which is intended to enable more compiler research for Matlab and extensions of Matlab. The framework is based on an intermediate representation (IR) called McLast, which has been designed to capture all the key features of Matlab, while at the same time being simple for program analysis. The paper describes both the IR and the procedure for creating the IR from the higher-level AST. The analysis framework itself provides visitor-based traversals including fixed-point-based traversals to support both forwards and backwards analyses. McSaf has been implemented as part of the McLab project, and the framework has already been used for a variety of analyses, both for Matlab and the AspectMatlab extension.

This work was supported, in part, by NSERC. A special thanks to Soroush Radpour for his help with the experiments.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. GNU Octave, http://www.gnu.org/software/octave/index.html

  2. JastAdd, http://jastadd.org/

  3. McLAB (2011), http://www.sable.mcgill.ca/mclab/

  4. Almási, G., Padua, D.: MaJIC: compiling MATLAB for speed and responsiveness. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, pp. 294–303. ACM, New York (2002)

    Chapter  Google Scholar 

  5. Casey, A., Hendren, L.: MetaLexer: A modular lexical specification language. In: AOSD, pp. 7–18 (2011)

    Google Scholar 

  6. Chevalier-Boisvert, M., Hendren, L., Verbrugge, C.: Optimizing Matlab through Just-In-Time Specialization. In: Gupta, R. (ed.) CC 2010. LNCS, vol. 6011, pp. 46–65. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  7. Derose, L., De Rose, L., Gallivan, K., Gallivan, K., Gallopoulos, E., Gallopoulos, E., Marsolf, B., Marsolf, B., Padua, D., Padua, D.: FALCON: A MATLAB Interactive Restructuring Compiler. In: Huang, C.-H., Sadayappan, P., Banerjee, U., Gelernter, D., Nicolau, A., Padua, D.A. (eds.) LCPC 1995. LNCS, vol. 1033, pp. 269–288. Springer, Heidelberg (1996)

    Chapter  Google Scholar 

  8. Doherty, J.: McSAF: An extensible static analysis framework for the MATLAB language. Master’s thesis. McGill University (December 2011)

    Google Scholar 

  9. Doherty, J., Hendren, L., Radpour, S.: Kind analysis for MATLAB. In: OOPSLA (2011)

    Google Scholar 

  10. Dubrau, A.: Taming MATLAB. Master’s thesis. McGill University (April 2012)

    Google Scholar 

  11. Ekman, T., Hedin, G.: The JastAdd extensible Java compiler. In: OOPSLA 2007: Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems and Applications, pp. 1–18. ACM, New York (2007)

    Chapter  Google Scholar 

  12. Ekman, T., Hedin, G.: The JastAdd system – modular extensible compiler construction. Science of Computer Programming 69(1-3), 14–26 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  13. Joisha, P.G.: A Type Inferenence System for MATLAB with Applications to Code Optimization. Ph.D. thesis, Northwestern University (2003)

    Google Scholar 

  14. Joisha, P.G., Banerjee, P.: The MAGICA Type Inference Engine for MATLAB. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 121–125. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  15. Lattner, C., Adve, V.: LLVM: a compilation framework for lifelong program analysis and transformation. In: CGO, pp. 75–88 (2004)

    Google Scholar 

  16. Li, J.: McFor: A MATLAB to FORTRAN 95 compiler. Master’s thesis. McGill University (August 2009)

    Google Scholar 

  17. Nilsson-Nyman, E., Hedin, G., Magnusson, E., Ekman, T.: Declarative intraprocedural flow analysis of Java source code. Electron. Notes Theor. Comput. Sci. 238, 155–171 (2009)

    Article  Google Scholar 

  18. Radpour, S.: Understanding and Refactoring MATLAB. Master’s thesis, McGill University (April 2012)

    Google Scholar 

  19. Rose, L.D., Padua, D.: Techniques for the translation of MATLAB programs into Fortran 90. ACM Trans. Program. Lang. Syst. 21(2), 286–323 (1999)

    Article  Google Scholar 

  20. Toheed Aslam, A.D., Doherty, J., Hendren, L.: AspectMatlab: An aspect-oriented scientific programming language. In: AOSD, pp. 181–192 (March 2010)

    Google Scholar 

  21. Vallée-Rai, R., Gagnon, E.M., Hendren, L., Lam, P., Pominville, P., Sundaresan, V.: Optimizing Java Bytecode Using the Soot Framework: Is It Feasible? In: Watt, D.A. (ed.) CC 2000. LNCS, vol. 1781, pp. 18–34. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

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

Doherty, J., Hendren, L. (2012). McSAF: A Static Analysis Framework for MATLAB. In: Noble, J. (eds) ECOOP 2012 – Object-Oriented Programming. ECOOP 2012. Lecture Notes in Computer Science, vol 7313. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-31057-7_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-31057-7_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-31056-0

  • Online ISBN: 978-3-642-31057-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics