skip to main content
research-article

BMCLua: A Translator for Model Checking Lua Programs

Published:05 September 2017Publication History
Skip Abstract Section

Abstract

Lua is a programming language designed as scripting language, which is fast, lightweight, and suitable for embedded applications. Due to its features, Lua is widely used in the development of games and interactive applications for digital TV. However, during the development phase of such applications, some errors may be introduced, such as deadlock, arithmetic overflow, and division by zero. This paper describes a novel verification approach for software written in Lua, using as backend the Efficient SMTBased Context-Bounded Model Checker (ESBMC). Such an approach, called bounded model checking - Lua (BMCLua), consists in translating Lua programs into ANSI-C source code, which is then verified with ESBMC. Experimental results show that the proposed verification methodology is effective and efficient, when verifying safety properties in Lua programs. The performed experiments have shown that BMCLua produces an ANSI-C code that is more efficient for verification, when compared with other existing approaches. To the best of our knowledge, this work is the first that applies bounded model checking to the verification of Lua programs.

References

  1. ABNT NBR 15606-2: "Digital Terrestrial Television, Data Coding and Transmission Speci cation for Digital Broadcasting Part 2: Ginga-NCL for xed and mobile receivers XML application language for application coding"; (2009).Google ScholarGoogle Scholar
  2. Aho, Alfred V. and Sethi, Ravi and Ullman, Jeffrey D.: "Compilers: Principles, Techniques, and Tools"; Addison-Wesley, Boston / MA (1986). Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Alessandro Armando, Jacopo Mantovani, and Lorenzo Platania.: "Bounded model checking of software using SMT solvers instead of SAT solvers"; Int. J. Softw. Tools Technol. Transf. 11, 1 (January 2009), 69--83.Google ScholarGoogle Scholar
  4. Baier, C. and Katoen, J.: "Principles of Model Checking (Representation and Mind Series)"; The MIT Press. (2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bannister, M. J. and Eppstein, D.: "Randomised Speedup of the Bellman-Ford Algorithm"; CoRR, Cornell, 1111.5414, (2011); available at: http://dblp.uni-trier.de/db/journals/corr/corr1111.html#abs-1111-5414Google ScholarGoogle Scholar
  6. Barbosa, D. C. and Clua, E.: "Ginga Game: A framework for game development for the interactive digital television"; Proc. of the 6th Brazilian Symposium on Games and Digital Entertainment (2009), 162--167. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Barnes, J.: "Programming in Ada"; Cambridge University Press. (2014).Google ScholarGoogle Scholar
  8. Barrett, C. and Stump, A. and Tinelli, C.: "The Satisfiability Modulo Theories Library (SMT-LIB)"; (2010); available at: www.SMT-LIB.orgGoogle ScholarGoogle Scholar
  9. Beyer, Dirk.: "Reliable and Reproducible Competition Results with BenchExec and Witnesses (Report on SV-COMP 2016)"; Springer Berlin Heidelberg; Chechik, Marsha and Raskin, Jean-François (2016), 887--904. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Biere, A.: "Bounded Model Checking", in Handbook of Satisfiability; IOS Press. (2009), 457--481.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Brummayer, R. and Biere, A.: "Boolector: An efficient SMT solver for bit-vectors and arrays"; Lect. Notes Comp. Sci. 5505, Springer (2009), 174--177. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Cheriton, D. and Tarjan, R. E.: "Finding minimum spanning trees"; SIAM Journal on Computing, SIAM, 5, 4 (1976), 724--742.Google ScholarGoogle ScholarCross RefCross Ref
  13. Clarke, E. and Kroening, D. and Lerda, F.: "A tool for checking ANSI-C programs"; Lect. Notes Comp. Sci. 2988, Springer (2004), 168--176.Google ScholarGoogle ScholarCross RefCross Ref
  14. Cordeiro, L. C. and Fischer, B. and Marques-Silva, J.: "SMT-based bounded model checking for embedded ANSI-C software"; IEEE Trans. Software Eng., IEEE, 38, 4 (2012), 957--974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Cordeiro, L. C. and Morse, J. and Nicole, D. and Fischer, B.: "Context-Bounded Model Checking with ESBMC 1.17 - (Competition Contribution)"; Lect. Notes Comp. Sci. 7214, Springer (2012), 534--537.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Cormen, T. H. and Stein, C. and Rivest, R. L. and Leiserson, C. E.: "Introduction to Algorithms"; McGraw-Hill Higher Education (2001). Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. de Lucena Jr., V. F. and Viana, N. S. and Maia, O. B. and Chaves Filho, J. E. and da Silva Junior, W. S.: "Designing an extension API for bridging Ginga iDTV applications and home services"; IEEE Trans. Consumer Electronics, v.58, n.2 (2012), 1077--1085.Google ScholarGoogle ScholarCross RefCross Ref
  18. de Melo Brandão, R. R. and de Souza Filho, G. L. and Batista, C. E. C. F. and Gomes Soares, L. F.: "Extended features for the Ginga-NCL environment: introducing the LuaTV API"; Proc. of the 19th International Conference on Computer Communications and Networks, IEEE (2010), 1--6.Google ScholarGoogle Scholar
  19. Deitel, H. M. and Deite, P. J.: "Java: How to Program"; Prentice Hall: Upper Saddle River (2010), 315--336. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Dirk Beyer, M. Erkan Keremoglu.: "CPAchecker: A Tool for Configurable Software Veri cation"; CAV (2011), 184--190. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Fleutot, F. and L. Tratt, L.: "Contrasting compile-time meta-programming in Metalua and Converge"; Proc. of the 3rd Workshop on Dynamic Languages and Applications, ACM (2007), 1--10.Google ScholarGoogle Scholar
  22. Friedman, D. P. and Wand, M.: "Essentials of Programming Languages, 3rd Edition"; The MIT Press. (2008), 55--65. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Garcia M. P., Monteiro F. R., Cordeiro L. C., de Lima Filho E. B. ESBMCQtOM: A Bounded Model Checking Tool to Verify Qt Applications. SPIN 2016; 97--103.Google ScholarGoogle Scholar
  24. Havelund, K. and Pressburger, T.: "Model checking JAVA programs using JAVA PathFinder"; International Journal on Software Tools for Technology Transfer, Springer, 2, 4 (2000), 366--381.Google ScholarGoogle ScholarCross RefCross Ref
  25. Havelund, K and Skakkebæk, J U.: "Applying Model Checking in Java Verification"; In Proceedings of the 5th and 6th International SPIN Workshops on Theoretical and Practical Aspects of SPIN Model Checking, Dennis Dams, Rob Gerth, Stefan Leue, and Mieke Massink (Eds.). Springer-Verlag, London, UK (1999), 216--231. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Heineman, G. and Pollice, G. and Selkow, S.: "Algorithms in a Nutshell"; O'Reilly Media, Inc. (2008), 160--164. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Hiischi, A.: "Traveling Light, the Lua way"; IEEE Software, IEEE, 24, 5 (2007), 31--38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Januário, F. A. P. and Cordeiro, L. C. and de Lucena Jr., V. F. and de Lima Filho, E. B.: "BMCLua: verification of Lua programs in digital TV interactive applications"; Proc. of the 3rd Global Conference on Consumer Electronics, IEEE (2014), 707--708.Google ScholarGoogle Scholar
  29. Januário, F. A. P., Cordeiro, L. C., Lima Filho, E. B. ; Lucena Jr., V. F.: "BMCLua: Verificação de Programas Lua em Aplicações Interativas de TV Digital"; Proc. of the 4th Simpósio Brasileiro de Engenharia de Sistemas Computacionais, SBESC (2014), 1--6.Google ScholarGoogle Scholar
  30. Jung, K. and Brown, A.: "Beginning Lua Programming"; Wiley (2007), 35--42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Klint, P. and Roosendaal, L. and van Rozen, R.: "Game developers need Lua air: static analysis of Lua using interface models"; Proc. of the 11th International Conference on Entertainment Computing, Springer (2012), Berlin / Heidelberg, 530--535. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Knuth, D. E.: "Backus Normal Form vs. Backus Naur Form"; Commun. ACM, ACM, 7, 12 (Dec 1964), New York / NY, 735--736. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Lerusalimschy, R.: "Programming in Lua, Second Edition"; Lua.Org (2006). Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Manura, D.: "Lua To Cee"; (2012); available at: http://lua-users.org/wiki/LuaToCeeGoogle ScholarGoogle Scholar
  35. Falke, S. and Merz, F. and Sinz, C.: "LLBMC: Improved bounded model checking of C programs using LLVM"; Proc. of the International Conference on Tools and Algorithms for the Construction and Analysis of Systems; Notes Comp. Sci. 7795, Springer (2013), 623--626. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Monteiro F. R., Cordeiro L. C., de Lima Filho E. B. Bounded Model Checking of C++ Programs Based on the Qt Framework. GCCE 2015; 179--447.Google ScholarGoogle Scholar
  37. Monteiro F. R., Garcia M. P., Cordeiro L. C., de Lima Filho E. B. Bounded Model Checking of C++ Programs based on the Qt Cross-Platform Framework, Softw Test Verif Reliab. 27 (2017) e1632.Google ScholarGoogle ScholarCross RefCross Ref
  38. Morse, J. and Cordeiro, L. C. and Nicole, D. and Fischer, B.: "Handling Unbounded Loops with ESBMC 1.20 - (Competition Contribution)"; Lect. Notes Comp. Sci. 7795, Springer (2013), 619--622. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Morse, J. and Ramalho, M. and Cordeiro, L. C. and Nicole, D. and Fischer, B.: "Handling Unbounded Loops with ESBMC 1.22 - (Competition Contribution)"; Lect. Notes Comp. Sci. 8413, Springer (2014), 405--407.Google ScholarGoogle ScholarCross RefCross Ref
  40. Moura, L. M. and Bjørner, N.: "Z3: An Efficient SMT Solver"; Lect. Notes Comp. Sci. 4963, Springer (2008), 337--340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Moura, L. M. and Bjørner, N.: "Satisfiability modulo theories: an appetiser"; Proc. of the 12th Brazilian Symposium on Formal Methods, Springer (2009), 23--36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Moura, L. M. and Bjørner, N.: "Satisfiability modulo theories: introduction and applications"; Commun. ACM, ACM, 54, 9 (2011), 69--77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Parr, T.: "The Definitive ANTLR Reference: Building Domain-Specific Languages"; Pragmatic Bookshelf (2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Pereira P, Albuquerque H, Marques H, Silva I, Carvalho C, Santos V, Ferreira R, Cordeiro L. Verificação de Kernels em Programas CUDA usando Bounded Model Checking. WSCAD-SSC 2015; 24--35.Google ScholarGoogle Scholar
  45. Pereira P, Albuquerque H, Marques H, Silva I, Carvalho C, Santos V, Ferreira R, Cordeiro L. Verifying CUDA Programs using SMT-Based Context-Bounded Model Checking. SAC SVT track 2016; 1648--1653. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Pereira P., Albuquerque H., Silva I., Marques H., Monteiro F. R., Ferreira R., Cordeiro L. C., SMT-Based Context-Bounded Model Checking for CUDA Programs, Concurrency Computat.: Pract. Exper. (2016)Google ScholarGoogle Scholar
  47. Ramalho M, Freitas M, Sousa F, Marques H, Cordeiro L, Fischer B. SMT-Based Bounded Model Checking of C++ Programs. ECBS 2013; 147--156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Salviato, T. P. and Costa, P. D. and Filho, J. G. P. and Vale, I. M.: "Framework for Context-Aware Applications on the Brazilian Digital TV"; Proc. of the 4th International Conference on Ubi-Media Computing, IEEE (2011), 112--117. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Schildt, H.: "Java: The Complete Reference (Complete Reference Series)"; Oracle Press. (2014). Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Sedgewick, R.: "Algorithms in C++, Parts 1-4: Fundamentals, Data Structure, Sorting, Searching, Third Edition"; Addison-Wesley (1998), 273--274. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Soares, L. F. G. and Rodrigues, R. F. and Moreno, M. F.: "Ginga-NCL: The Declarative Environment of the Brazilian Digital TV System"; Journal of the Brazilian Computer Society, Springer, 12, 4 (2007), 37--46.Google ScholarGoogle ScholarCross RefCross Ref
  52. Stroustrup, B.: "The C++ Programming Language - Special Edition"; Addison Wesley (2007).Google ScholarGoogle Scholar
  53. Stump, A. and Barrett, C. W. and Dill, D. L.: "CVC: a cooperating validity checker"; Proc. of the 14th International Conference on Computer-Aided Verification, Springer-Verlag (2002), 500--504. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. BMCLua: A Translator for Model Checking Lua Programs
      Index terms have been assigned to the content through auto-classification.

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGSOFT Software Engineering Notes
        ACM SIGSOFT Software Engineering Notes  Volume 42, Issue 3
        July 2017
        75 pages
        ISSN:0163-5948
        DOI:10.1145/3127360
        Issue’s Table of Contents

        Copyright © 2017 Authors

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 5 September 2017

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader