skip to main content
article
Free Access

A new foundation for control dependence and slicing for modern program structures

Published:02 August 2007Publication History
Skip Abstract Section

Abstract

The notion of control dependence underlies many program analysis and transformation techniques. Despite being widely used, existing definitions and approaches to calculating control dependence are difficult to apply directly to modern program structures because these make substantial use of exception processing and increasingly support reactive systems designed to run indefinitely.

This article revisits foundational issues surrounding control dependence, and develops definitions and algorithms for computing several variations of control dependence that can be directly applied to modern program structures. To provide a foundation for slicing reactive systems, the article proposes a notion of slicing correctness based on weak bisimulation, and proves that some of these new definitions of control dependence generate slices that conform to this notion of correctness. This new framework of control dependence definitions, with corresponding correctness results, is even able to support programs with irreducible control flow graphs. Finally, a variety of properties show that the new definitions conservatively extend classic definitions. These new definitions and algorithms form the basis of the Indus Java slicer, a publicly available program slicer that has been implemented for full Java.

References

  1. Allen, M. and Horwitz, S. 2003. Slicing Java programs that throw and catch exceptions. In Procedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM). ACM, 44--54. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andersen, L. O. 1994. Program analysis and specialization for the C programming languages. Ph.D. thesis, DIKU, University of Copenhagen, DIKU, Universitetsparken 1, DK-2100, Copenhagen ∅, Denmark.Google ScholarGoogle Scholar
  3. Ball, T. and Horwitz, S. 1993. Slicing programs with arbitrary control-flow. In Proceedings of the 1st International Workshop on Automated and Algorithmic Debugging (AADEBUG). Lecture Notes in Computer Science, vol. 749. Springer, 206--222. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bilardi, G. and Pingali, K. 1996. A framework for generalized control dependences. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (Pennsylvania, PA). ACM Press, New York, 291--300. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Clarke, E. M., Grumberg, O., and Peled, D. A. 1999. Model Checking. MIT Press, Cambridge, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Corbett, J. C., Dwyer, M. B., Hatcliff, J., Laubach, S., Păsăreanu, C. S., Robby, and Zheng, H. 2000. Bandera: Extracting finite-state models from Java source code. In Proceedings of the 22nd International Conference on Software Engineering (ICSE). 439--448. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Ferrante, J., Ottenstein, K. J., and Warren, J. O. 1987. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9, 3 (Jul.), 319--349. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Francel, M. A. and Rugaber, S. 1999. The relationship of slicing and debugging to program understanding. In Proceedings of the 7th IEEE International Workshop on Program Comprehension (IWPC). 106--113. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Hatcliff, J., Dwyer, M. B., and Zheng, H. 2000. Slicing software for model construction. J. Higher-Order Symb. Comput. 13, 4, 315--353. A special issue containing selected papers from the 1999 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Hatcliff, J., Corbett, J. C., Dwyer, M. B., Sokolowski, S., and Zheng, H. 1999. A formal study of slicing for multi-threaded programs with JVM concurrency primitives. In Proceedings on the International Symposium on Static Analysis (SAS). Lecture Notes in Computer Science, vol. 1694. Springer, 1--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Hecht, M. S. and Ullman, J. D. 1974. Characterizations of reducible flow graphs. J. ACM 21, 3, 367--375. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Horwitz, S., Reps, T., and Binkley, D. 1990. Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12, 1, 26--60. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Horwitz, S., Pfeiffer, P., and Reps, T. W. 1989. Dependence analysis for pointer variables. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). ACM, 28--40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. I. Millett, L. and Teitelbaum, T. 1998. Slicing Promela and its applications to model checking, simulation, and protocol understanding. In Proceedings of the 4th International SPIN Workshop.Google ScholarGoogle Scholar
  15. Jayaraman, G., Ranganath, V. P., and Hatcliff, J. 2004. Kaveri: Delivering Indus Java program slicer to Eclipse. http://projects.cis.ksu.edu/docman/?group_id=12.Google ScholarGoogle Scholar
  16. Johnson, R. and Pingali, K. 1993. Dependence-Based program analysis. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 78--89. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Krinke, J. 1998. Static slicing of threaded programs. In Proceedings of the ACM SIGPLAN/SIGFSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE). 35--42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Milner, R. 1989. Communication and Concurrency. Prentice-Hall. ISBN: 0-13-115007-3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Muchnick, S. S. 1997. Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Podgurski, A. and Clarke, L. 1990. A formal model of program dependences and its implications for software testing, debugging, and maintenance. IEEE Trans. Softw. Eng. 16, 9, 965--979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Ranganath, V. P., Amtoft, T., Banerjee, A., B. Dwyer, M., and Hatcliff, J. 2005. A new foundation for control-dependence and slicing for modern program structures. In Proceedings of the European Symposium on Programming Languages and Systems (ESOP). Lecture Notes in Computer Science, vol. 3444. Springer, 77--93. Extended version available at http://projects.cis. ksu.edu/docman/?group_id=12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. SAnToS Laboratory. 2007 Indus, a toolkit to customize and adapt Java programs. http://indus. projects.cis.ksu.edu.Google ScholarGoogle Scholar
  23. Stafford, J. 2000. A formal, language-independent, and compositional approach to interprocedural control dependence analysis. Ph.D. thesis, University of Colorado. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Tip, F. 1995. A survey of program slicing techniques. J. Programm. Lang. 3, 121--189.Google ScholarGoogle Scholar
  25. Weiser, M. 1984. Program slicing. IEEE Trans. Softw. Eng. 10, 4, 352--357.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A new foundation for control dependence and slicing for modern program structures

        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

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!