Skip to main content

Program Analysis Scenarios in Rascal

  • Conference paper
Book cover Rewriting Logic and Its Applications (WRLA 2012)

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

Included in the following conference series:

Abstract

Rascal is a meta programming language focused on the implementation of domain-specific languages and on the rapid construction of tools for software analysis and software transformation. In this paper we focus on the use of Rascal for software analysis. We illustrate a range of scenarios for building new software analysis tools through a number of examples, including one showing integration with an existing Maude-based analysis. We then focus on ongoing work on alias analysis and type inference for PHP, showing how Rascal is being used, and sketching a hypothetical solution in Maude. We conclude with a high-level discussion on the commonalities and differences between Rascal and Maude when applied to program analysis.

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 49.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. Agesen, O.: The Cartesian Product Algorithm: Simple and Precise Type Inference of Parametric Polymorphism. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 2–26. Springer, Heidelberg (1995)

    Google Scholar 

  2. Anderson, P., Zarins, M.: The CodeSurfer Software Understanding Platform. In: Proceedings of IWPC 2005, pp. 147–148. IEEE (2005)

    Google Scholar 

  3. Balland, E., Brauner, P., Kopetz, R., Moreau, P.-E., Reilles, A.: Tom: Piggybacking Rewriting on Java. In: Baader, F. (ed.) RTA 2007. LNCS, vol. 4533, pp. 36–47. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  4. Bergstra, J., Heering, J., Klint, P.: Algebraic Specification. ACM Press (1989)

    Google Scholar 

  5. Beyer, D.: Relational programming with CrocoPat. In: Proceedings of ICSE 2006, pp. 807–810. ACM Press (2006)

    Google Scholar 

  6. Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A language and toolset for program transformation. Science of Computer Programming 72(1-2), 52–70 (2008)

    Article  MathSciNet  Google Scholar 

  7. Camphuijsen, P.: Soft typing and analyses of PHP programs. Master’s thesis, Universiteit Utrecht (2007)

    Google Scholar 

  8. Ceri, S., Gottlob, G., Tanca, L.: Logic programming and databases. Springer-Verlag New York, Inc. (1990)

    Google Scholar 

  9. Charles, P., Fuhrer, R.M., Sutton Jr., S.M., Duesterwald, E., Vinju, J.J.: Accelerating the Creation of Customized, Language-Specific IDEs in Eclipse. In: Proceedings of OOPSLA 2009, pp. 191–206. ACM Press (2009)

    Google Scholar 

  10. Chen, F., Roşu, G., Venkatesan, R.P.: Rule-Based Analysis of Dimensional Safety. In: Nieuwenhuis, R. (ed.) RTA 2003. LNCS, vol. 2706, pp. 197–207. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  11. Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: All About Maude - A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007)

    MATH  Google Scholar 

  12. Cordy, J.R.: The TXL source transformation language. Science of Computer Programming 61(3), 190–210 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  13. Eker, S., Meseguer, J., Sridharanarayanan, A.: The Maude LTL Model Checker. In: Proceedings of WRLA 2002. ENTCS, vol. 71. Elsevier (2002)

    Google Scholar 

  14. Ellison, C., Roşu, G.: An Executable Formal Semantics of C with Applications. In: Proceedings of POPL 2012, pp. 533–544. ACM Press (2012)

    Google Scholar 

  15. Farzan, A., Chen, F., Meseguer, J., Roşu, G.: Formal Analysis of Java Programs in JavaFAN. In: Alur, R., Peled, D.A. (eds.) CAV 2004. LNCS, vol. 3114, pp. 501–505. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  16. Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison-Wesley (2000)

    Google Scholar 

  17. Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns. Elements of Reusable Object-Oriented Software. Addison-Wesley (1995)

    Google Scholar 

  18. Heering, J., Hendriks, P., Klint, P., Rekers, J.: The syntax definition formalism SDF - reference manual. SIGPLAN Notices 24(11), 43–75 (1989)

    Article  Google Scholar 

  19. Hills, M., Chen, F., Roşu, G.: A Rewriting Logic Approach to Static Checking of Units of Measurement in C. In: Proceedings of RULE 2008. Elsevier (2008) (to appear)

    Google Scholar 

  20. Hills, M., Şerbănuţă, T.F., Roşu, G.: A Rewrite Framework for Language Definitions and for Generation of Efficient Interpreters. In: Proceedings of WRLA 2006. ENTCS, vol. 176, pp. 215–231. Elsevier (2007)

    Google Scholar 

  21. Hills, M., Klint, P., van der Storm, T., Vinju, J.J.: A Case of Visitor versus Interpreter Pattern. In: Bishop, J., Vallecillo, A. (eds.) TOOLS 2011. LNCS, vol. 6705, pp. 228–243. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  22. Hills, M., Klint, P., Vinju, J.J.: RLSRunner: Linking Rascal with K for Program Analysis. In: Sloane, A., Aßmann, U. (eds.) SLE 2011. LNCS, vol. 6940, pp. 344–353. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  23. Hills, M., Klint, P., Vinju, J.J.: Scripting a Refactoring with Rascal and Eclipse. In: Proceedings of WDT 2012. ACM Press (to appear, 2012)

    Google Scholar 

  24. Hills, M., Roşu, G.: A Rewriting Logic Semantics Approach To Modular Program Analysis. In: Proceedings of RTA 2010. Leibniz International Proceedings in Informatics, vol. 6, pp. 151–160. Schloss Dagstuhl - Leibniz Center of Informatics (2010)

    Google Scholar 

  25. Hind, M., Burke, M.G., Carini, P.R., Choi, J.-D.: Interprocedural Pointer Alias Analysis. ACM TOPLAS 21(4), 848–894 (1999)

    Article  Google Scholar 

  26. Holt, R.C.: Grokking Software Architecture. In: Proceedings of WCRE 2008, pp. 5–14. IEEE (2008)

    Google Scholar 

  27. Huang, Y.-W., Yu, F., Hang, C., Tsai, C.-H., Lee, D.-T., Kuo, S.-Y.: Securing Web Application Code by Static Analysis and Runtime Protection. In: Proceedings of WWW 2004, pp. 40–52. ACM Press (2004)

    Google Scholar 

  28. Huang, Y.-W., Yu, F., Hang, C., Tsai, C.-H., Lee, D.T., Kuo, S.-Y.: Verifying Web Applications Using Bounded Model Checking. In: Proceedings of DSN 2004, pp. 199–208. IEEE (2004)

    Google Scholar 

  29. Jovanovic, N., Kruegel, C., Kirda, E.: Precise Alias Analysis for Static Detection of Web Application Vulnerabilities. In: Proceedings of PLAS 2006, pp. 27–36. ACM Press (2006)

    Google Scholar 

  30. Jovanovic, N., Krügel, C., Kirda, E.: Pixy: A Static Analysis Tool for Detecting Web Application Vulnerabilities (Short Paper). In: IEEE Symposium on Security and Privacy, pp. 258–263 (2006)

    Google Scholar 

  31. Klint, P.: Using Rscript for Software Analysis. In: Working Session on Query Technologies and Applications for Program Comprehension, QTAPC 2008 (2008)

    Google Scholar 

  32. Klint, P., van der Storm, T., Vinju, J.: RASCAL: A Domain Specific Language for Source Code Analysis and Manipulation. In: Proceedings of SCAM 2009, pp. 168–177. IEEE (2009)

    Google Scholar 

  33. Klint, P., van der Storm, T., Vinju, J.: EASY Meta-programming with Rascal. In: Fernandes, J.M., Lämmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2009. LNCS, vol. 6491, pp. 222–289. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  34. Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theoretical Computer Science 96(1), 73–155 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  35. Meseguer, J., Roşu, G.: The rewriting logic semantics project. Theoretical Computer Science 373(3), 213–237 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  36. Moreau, P.-E.: A choice-point library for backtrack programming. In: JICSLP 1998 Post-Conference Workshop on Implementation Technologies for Programming Languages based on Logic (1998)

    Google Scholar 

  37. Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana-Champaign (1992)

    Google Scholar 

  38. Opdyke, W.F., Johnson, R.E.: Refactoring: An aid in designing application frameworks and evolving object-oriented systems. In: Proceedings of Symposium on Object-Oriented Programming Emphasizing Practical Applications (1990)

    Google Scholar 

  39. Parr, T.: The Definitive ANTLR Reference: Building Domain-Specific Languages. Pragmatic Bookshelf (2007)

    Google Scholar 

  40. Riesco, A., Verdejo, A., Martí-Oliet, N.: A Complete Declarative Debugger for Maude. In: Johnson, M., Pavlovic, D. (eds.) AMAST 2010. LNCS, vol. 6486, pp. 216–225. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  41. Rimsa, A., d’Amorim, M., Pereira, F.M.Q.: Tainted Flow Analysis on e-SSA-Form Programs. In: Knoop, J. (ed.) CC 2011. LNCS, vol. 6601, pp. 124–143. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  42. Roşu, G., Chen, F.: Certifying Measurement Unit Safety Policy. In: Proceedings of ASE 2003, pp. 304–309. IEEE (2003)

    Google Scholar 

  43. Roşu, G., Şerbănuţă, T.F.: An Overview of the K Semantic Framework. Journal of Logic and Algebraic Programming 79(6), 397–434 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  44. Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.P.: Traits: Composable Units of Behaviour. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  45. van den Bos, J., Hills, M., Klint, P., van der Storm, T., Vinju, J.J.: Rascal: From Algebraic Specification to Meta-Programming. In: Proceedings of AMMSE 2011. EPTCS, vol. 56, pp. 15–32 (2011)

    Google Scholar 

  46. van den Brand, M., Bruntink, M., Economopoulos, G., de Jong, H., Klint, P., Kooiker, T., van der Storm, T., Vinju, J.: Using The Meta-environment for Maintenance and Renovation. In: Proceedings of CSMR 2007, pp. 331–332. IEEE (2007)

    Google Scholar 

  47. van den Brand, M., de Jong, H., Klint, P., Olivier, P.: Efficient Annotated Terms. Software, Practice & Experience 30, 259–291 (2000)

    Article  Google Scholar 

  48. den van Brand, M.G.J., van Deursen, A., Heering, J., de Jong, H.A., de Jonge, M., Kuipers, T., Klint, P., Moonen, L., Olivier, P.A., Scheerder, J., Vinju, J.J., Visser, E., Visser, J.: The ASF+SDF Meta-environment: A Component-Based Language Development Environment. In: Wilhelm, R. (ed.) CC 2001. LNCS, vol. 2027, pp. 365–370. Springer, Heidelberg (2001)

    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

Hills, M., Klint, P., Vinju, J.J. (2012). Program Analysis Scenarios in Rascal. In: Durán, F. (eds) Rewriting Logic and Its Applications. WRLA 2012. Lecture Notes in Computer Science, vol 7571. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34005-5_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-34005-5_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-34004-8

  • Online ISBN: 978-3-642-34005-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics