A Generic Program Slicing Technique Based on Language Definitions

  • Adrián Riesco
  • Irina Măriuca Asăvoae
  • Mihail Asăvoae
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7841)

Abstract

A formal executable semantics of a programming language has the necessary information to develop program debugging and reasoning techniques. In this paper we choose such a particular technique called program slicing and we introduce a generic algorithm which extracts a set of side-effects inducing constructs, directly from the formal executable semantics of a programming language. These constructs are further used to infer program slices, for given programs and specified slicing criteria. Our proposed approach improves on the parametrization of the language tools development because changes in the formal semantics are automatically carried out in the slicing procedure. We use the rewriting logic and the Maude system to implement a prototype and to test our technique.

Keywords

slicing semantics Maude debugging 

References

  1. 1.
    Agrawal, H., DeMillo, R.A., Spafford, E.H.: Debugging with dynamic slicing and backtracking. Software - Practice and Experience 23(6), 589–616 (1993)CrossRefGoogle Scholar
  2. 2.
    Alpuente, M., Ballis, D., Espert, J., Romero, D.: Backward trace slicing for rewriting logic theories. In: Bjørner, N., Sofronie-Stokkermans, V. (eds.) CADE 2011. LNCS (LNAI), vol. 6803, pp. 34–48. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  3. 3.
    Alpuente, M., Ballis, D., Frechina, F., Romero, D.: Backward trace slicing for conditional rewrite theories. In: Bjørner, N., Voronkov, A. (eds.) LPAR-18. LNCS, vol. 7180, pp. 62–76. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  4. 4.
    Baader, F., Snyder, W.: Unification theory. In: Robinson, A., Voronkov, A. (eds.) Handbook of Automated Reasoning, pp. 445–532. Elsevier (2001)Google Scholar
  5. 5.
    Bouhoula, A., Jouannaud, J.-P., Meseguer, J.: Specification and proof in membership equational logic. Theoretical Computer Science 236, 35–132 (2000)MathSciNetMATHCrossRefGoogle Scholar
  6. 6.
    Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: All About Maude. LNCS, vol. 4350. Springer, Heidelberg (2007)Google Scholar
  7. 7.
    Field, J., Ramalingam, G., Tip, F.: Parametric program slicing. In: Proc. of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1995, pp. 379–392. ACM Press (1995)Google Scholar
  8. 8.
    Field, J., Tip, F.: Dynamic dependence in term rewriting systems and its application to program slicing. Information & Software Technology 40(11-12), 609–636 (1998)CrossRefGoogle Scholar
  9. 9.
    Harman, M., Danicic, S.: Using program slicing to simplify testing. Journal of Software Testing, Verification and Reliability 5, 143–162 (1995)CrossRefGoogle Scholar
  10. 10.
    Horwitz, S., Reps, T.W., Binkley, D.: Interprocedural slicing using dependence graphs. ACM Transactions on Programming Languages Systems 12(1), 26–60 (1990)CrossRefGoogle Scholar
  11. 11.
    Jhala, R., Majumdar, R.: Path slicing. In: Proc. of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2005, pp. 38–47. ACM Press (2005)Google Scholar
  12. 12.
    Martí-Oliet, N., Meseguer, J.: Rewriting logic: roadmap and bibliography. Theoretical Computer Science 285(2), 121–154 (2002)MathSciNetMATHCrossRefGoogle Scholar
  13. 13.
    Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theoretical Computer Science 96(1), 73–155 (1992)MathSciNetMATHCrossRefGoogle Scholar
  14. 14.
    Riesco, A.: Using semantics specified in Maude to generate test cases. In: Roychoudhury, A., D’Souza, M. (eds.) ICTAC 2012. LNCS, vol. 7521, pp. 90–104. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  15. 15.
    Sandberg, C., Ermedahl, A., Gustafsson, J., Lisper, B.: Faster WCET flow analysis by program slicing. In: Proc. of the 2006 ACM SIGPLAN Conference on Languages, Compilers and Tools for Embedded Systems, LCTES 2006, pp. 103–112. ACM Press (2006)Google Scholar
  16. 16.
    Silva, J., Chitil, O.: Combining algorithmic debugging and program slicing. In: Proc. of the 8th ACM-SIGPLAN International Symposium on Principles and Practice of Declarative Programming, PPDP 2006, pp. 157–166. ACM Press (2006)Google Scholar
  17. 17.
    Sterling, L., Shapiro, E.Y.: The Art of Prolog - Advanced Programming Techniques. MIT Press (1986)Google Scholar
  18. 18.
    Tian, C., Feng, M., Gupta, R.: Speculative parallelization using state separation and multiple value prediction. In: Proc. of the 2010 International Symposium on Memory Management, ISMM 2010, pp. 63–72. ACM Press (2010)Google Scholar
  19. 19.
    Tip, F.: A survey of program slicing techniques. Journal of Programming Languages 3(3), 121–189 (1995)Google Scholar
  20. 20.
    Verdejo, A., Martí-Oliet, N.: Executable structural operational semantics in Maude. Journal of Logic and Algebraic Programming 67, 226–293 (2006)MathSciNetMATHCrossRefGoogle Scholar
  21. 21.
    Weiser, M.: Program slicing. In: Proc. of the 5th International Conference on Software Engineering, ICSE 1981, pp. 439–449. IEEE Press (1981)Google Scholar

Copyright information

© IFIP International Federation for Information Processing 2013

Authors and Affiliations

  • Adrián Riesco
    • 1
  • Irina Măriuca Asăvoae
    • 2
  • Mihail Asăvoae
    • 2
  1. 1.Universidad Complutense de MadridSpain
  2. 2.Alexandru Ioan Cuza UniversityRomania

Personalised recommendations