skip to main content
research-article
Free Access

Static Backward Slicing of Non-deterministic Programs and Systems

Published:25 August 2018Publication History
Skip Abstract Section

Abstract

A theory of slicing non-deterministic programs and systems is developed. Non-deterministic programs and systems are represented as non-deterministic program graphs (NDPGs) that allow arbitrary non-deterministic branching to be expressed. Structural and semantic relationships that must exist between an NDPG and (1) its non-termination insensitive (weak) slices and (2) its non-termination sensitive (strong) slices are defined. Weak and strong commitment closure are introduced. These are the NDPG equivalents of being closed under non-termination sensitive and non-termination insensitive control dependence; properties defined on subsets of vertices of the equivalent deterministic structure: the control flow graph.

It is proved that if a subset of the vertices of an NDPG is both data dependence closed and (weak/strong) commitment closed, then the resulting induced graph will, indeed, satisfy our structural and semantic requirements. O(n3) algorithms for computing minimal data and weak/strong commitment closed sets are given. The resulting induced graphs are thus guaranteed to be weak and strong slices, respectively.

It is demonstrated, with examples, that programs written in Dijkstra's non-deterministic guarded command language (DNGCL) can be converted to NDPGs to which our slicing algorithms can then be applied. It is proved that the resulting slices (NDPGs) can always be converted back to valid DNGCL programs, highlighting the applicability of our approach to slicing at the source code level.

References

  1. Hiralal Agrawal and Joseph R. Horgan. 1990. Dynamic program slicing. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. 246--256. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. R. Allen, Ken Kennedy, Carrie Porterfield, and Joe Warren. 1983. Conversion of control de- pendence to data dependence. In Proceedings of the 10th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL’83). ACM, New York, NY, 177--189. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Torben Amtoft. 2008. Slicing for modern program structures: A theory for eliminating irrelevant loops. Inform. Process. Lett. 106, 2 (2008), 45--51. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Kelly Androutsopoulos, David Clark, Mark Harman, R. Hierons, Zheng Li, and Laurence Tratt. 2012. Amorphous slicing of extended finite state machines. IEEE Trans. Softw. Eng. 39, 7 (2012), 892--909. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Kelly Androutsopoulos, David Clark, Mark Harman, Zheng Li, and Laurie Tratt. 2009a. Control dependence for extended finite state machines. In Fundamental Approaches to Software Engineering (FASE’09). LNCS, vol. 5503. Springer, York, UK, 216--230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Kelly Androutsopoulos, David Clark, Mark Harman, Zheng Li, and Laurie Tratt. 2009b. Control dependence for extended finite state machines. In Fundamental Approaches to Software Engineering (FASE’09). LNCS, vol. 5503. Springer, York, UK, 216--230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Richard Barraclough, David Binkley, Sebastian Danicic, Mark Harman, Robert Hierons, Ákos Kiss, and Michael Laurence. 2010. A trajectory-based strict semantics for program slicing. Theoret. Comput. Sci. 411, 11--13 (Mar. 2010), 1372--1386. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Árpád Beszédes, Tamás Gergely, Zsolt Mihály Szabó, János Csirik, and Tibor Gyimóthy. 2001. Dynamic slicing method for maintenance of large c programs. In Proceedings of the 5th European Conference on Software Maintenance and Reengineering (CSMR’01). IEEE Computer Society, 105--113. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Gianfranco Bilardi and Keshav Pingali. 1996. A framework for generalized control dependence. In Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation (PLDI’96). ACM, New York, NY, 291--300. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. David Binkley, Sebastian Danicic, Tibor Gyimóthy, Mark Harman, Ákos Kiss, and Bogdan Korel. 2006. Theoretical foundations of dynamic program slicing. Theoret. Comput. Sci. 360, 1 (2006), 23--41. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Dave Binkley, Sebastian Danicic, Tibor Gyimóthy, Mark Harman, Ákos Kiss, and Lahcen Ouarbya. 2004. Formalizing executable dynamic and forward slicing. In Proceedings of the 4th International Workshop on Source Code Analysis and Manipulation (SCAM’04). IEEE Computer Society Press, Los Alamitos, CA, 43--52. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. David Binkley and Mark Harman. 2005. Forward slices are smaller than backward slices. In Proceedings of the 5th IEEE International Workshop on Source Code Analysis and Manipulation. IEEE Computer Society Press, Los Alamitos, CA, 15--24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. David Wendell Binkley. 1998. The application of program slicing to regression testing. Inf. Softw Technol. 40, 11 and 12 (1998), 583--594.Google ScholarGoogle Scholar
  14. David Wendell Binkley, Sebastian Danicic, Mark Harman, John Howroyd, and Lahcen Ouarbya. 2006. A formal relationship between program slicing and partial evaluation. Formal Aspects Comput 18, 2 (2006), 103--119. Google ScholarGoogle ScholarCross RefCross Ref
  15. David Wendell Binkley and Keith Brian Gallagher. 1996. Program slicing. In Advances in Computing, vol. 43, Marvin Zelkowitz (Ed.). Academic Press, 1--50.Google ScholarGoogle Scholar
  16. David Wendell Binkley and Mark Harman. 2003. A large-scale empirical study of forward and backward static slice size and context sensitivity. In Proceedings of the IEEE International Conference on Software Maintenance (Amsterdam, Netherlands). IEEE Computer Society Press, Los Alamitos, CA, 44--53. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. David Wendell Binkley and Mark Harman. 2004. A survey of empirical results on program slicing. Adv. Comput. 62 (2004), 105--178.Google ScholarGoogle ScholarCross RefCross Ref
  18. David Wendell Binkley, Susan Horwitz, and Tom Reps. 1995. Program integration for languages with procedure calls. ACM Trans. Softw. Eng. Methodol. 4, 1 (1995), 3--35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Gerardo Canfora, Aniello Cimitile, and Andrea De Lucia. 1998. Conditioned program slicing. Inf. Softw. Technol. 40, 11 and 12 (1998), 595--607.Google ScholarGoogle Scholar
  20. Sebastian Danicic, Mark Harman, John Howroyd, and Lahcen Ouarbya. 2007a. A non-standard semantics for program slicing and dependence analysis. Logic Algebr. Program. 72, 2 (July-August 2007), 123--240.Google ScholarGoogle Scholar
  21. Sebastian Danicic. 1999. Dataflow Minimal Slicing. Ph.D. Dissertation. University of North London, UK, School of Informatics.Google ScholarGoogle Scholar
  22. Sebastian Danicic, Richard Barraclough, Mark Harman, John Howroyd, Akos Kiss, and Mike Laurence. 2011. A unifying theory of control dependence and its application to arbitrary program structures. Theoret. Comput. Sci. 412, 49 (Nov. 2011), 6809--6842. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Sebastian Danicic, David Binkley, Tibor Gyimóthy, Mark Harman, Ákos Kiss, and Bogdan Korel. 2006. A formalisation of the relationship between forms of program slicing. Sci. Comput. Program. 62, 3 (2006), 228--252. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Sebastian Danicic, Chris Fox, Mark Harman, and Rob Mark Hierons. 2000. ConSIT: A conditioned program slicer. In Proceedings of the IEEE International Conference on Software Maintenance (ICSM’00). IEEE Computer Society Press, Los Alamitos, CA, 216--226. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Sebastian Danicic, Chris Fox, Mark Harman, Robert Mark Hierons, John Howroyd, and Mike Laurence. 2005. Slicing algorithms are minimal for programs which can be expressed as linear, free, liberal schemas. Comput. J. 48, 6 (2005), 737--748. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Sebastian Danicic, Mark Harman, Robert Mark Hierons, John Howroyd, and Mike Laurence. 2007b. Equivalence of linear, free, liberal, structured program schemas is decidable in polynomial time. Theoret. Comput. Sci. 373, 1--2 (Mar. 2007), 1--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Sebastian Danicic, Robert Hierons, and Mike Laurence. 2007c. On the computational complexity of dynamic slicing problems for program schemas. In Proceedings of the 3rd International Workshop on Programming Language Interference and Dependence.Google ScholarGoogle Scholar
  28. Sebastian Danicic, Robert Hierons, and Mike Laurence. 2008. Weisers's algorithm computes minimal path-faithful slices of function-linear, free program schemas. In Proceedings of the 4th International Workshop on Programming Language Interference and Dependence.Google ScholarGoogle Scholar
  29. Sebastian Danicic, Robert Hierons, and Michael Laurence. 2010. Decidability of strong equivalence for slices of linear, free, near-liberal program schemas. (unpublished).Google ScholarGoogle Scholar
  30. Sebastian Danicic, Robert Hierons, and Michael Laurence. 2011a. Characterizing minimal semanticspreserving slices of predicate-linear, free, liberal program schemas. J. Logic Algebr. Program. 80, 8 (2011), 481–496.Google ScholarGoogle ScholarCross RefCross Ref
  31. Sebastian Danicic, Robert Hierons, and Michael Laurence. 2011b. Complexity of data dependence problems for program schemas with concurrency. ACM Trans. Comput. Logic 13, 2 (2011), Article 15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Sebastian Danicic, Robert Hierons, and Michael Laurence. 2011c. On the computational complexity of dynamic slicing problems for program schemas. Math. Struct. Comput. Sci. 21, 6 (2011), 1339–1362. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Mohammed Daoudi. 2006. On Symbolic Execution Based Intraprocedural Conditioned Slicing. Ph.D. Dissertation. Goldsmiths, University of London.Google ScholarGoogle Scholar
  34. Mohammed Daoudi, Sebastian Danicic, John Howroyd, Mark Harman, Chris Fox, Lahcen Ouarbya, and Martin Ward. 2002. ConSUS: A scalable approach to conditioned slicing. In Proceedings of the IEEE Working Conference on Reverse Engineering (WCRE’02). IEEE Computer Society Press, Los Alamitos, CA, 109--118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Andrea De Lucia. 2001. Program slicing: Methods and applications. In Proceedings of the 1st IEEE International Workshop on Source Code Analysis and Manipulation. IEEE Computer Society Press, Los Alamitos, CA, 142--149.Google ScholarGoogle ScholarCross RefCross Ref
  36. Dorothy E. Denning and Peter J. Denning. 1977. Certification of programs for secure information flow. Commun. ACM 20, 7 (1977), 504--513. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Edskar Wabe Dijkstra. 1972. A Discipline of Programming. Prentice-Hall.Google ScholarGoogle Scholar
  38. Evelyn Duesterwald, Rajiv Gupta, and M. Soffa. 1993. Distributed slicing and partial re-execution for distributed programs. In Languages and Compilers for Parallel Computing. Springer, 497--511. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Jeanne Ferrante, Karl J. Ottenstein, and Joe D. Warren. 1987. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9, 3 (Jul. 1987), 319--349. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Robert W. Floyd. 1962. Algorithm 97: Shortest path. Commun. ACM 5, 6 (1962), 345. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Keith B. Gallagher and James R. Lyle. 1991. Using program slicing in software maintenance. IEEE Trans. Softw. Eng. 17, 8 (Aug. 1991), 751--761. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Tybor Gallai. 1961. Maximum-minimum sätze und verallgemeinerte faktoren von graphen. Acta Math. Acad. Sci. Hung. 12, 131--173.Google ScholarGoogle ScholarCross RefCross Ref
  43. Roberto Giacobazzi and Isabella Mastroeni. 2003. Non--standard semantics for program slicing. Higher-Order Symbol. Comput. 16, 4 (2003), 297--339. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Rajiv Gopal. 1991. Dynamic program slicing based on dependence graphs. In Proceedings of the IEEE Conference on Software Maintenance. 191--200.Google ScholarGoogle ScholarCross RefCross Ref
  45. V. Gouranton and D. Le Métayer. 1999. Dynamic slicing: A generic analysis based on a natural semantics format. J. Logic Comput 9, 6 (Dec. 1999), 835--871.Google ScholarGoogle ScholarCross RefCross Ref
  46. Grammatech Inc. 2002. The CodeSurfer Slicing System. Retrieved from www.grammatech.com.Google ScholarGoogle Scholar
  47. Mark Harman, David Wendell Binkley, and Sebastian Danicic. 2003. Amorphous Program Slicing. J. Syst. Softw. 68, 1 (Oct. 2003), 45--64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Mark Harman and Robert Mark Hierons. 2001. An overview of program slicing. Softw. Focus 2, 3 (2001), 85--92.Google ScholarGoogle ScholarCross RefCross Ref
  49. Mark Harman, Lin Hu, Robert Mark Hierons, Joachim Wegener, Harmen Sthamer, Andr� Baresel, and Marc Roper. 2004. Testability transformation. IEEE Trans. Softw. Eng. 30, 1 (Jan. 2004), 3--16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. John Hatcliff, James Corbett, Matthew Dwyer, Stefan Sokolowski, and Hongjun Zheng. 1999. A formal study of slicing for multi-threaded programs with JVM concurrency primitives. In Static Analysis. Springer, 1--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. John Hatcliff, Matthew B. Dwyer, and Hongjun Zheng. 2000. Slicing software for model construction. Higher-Order Symbol. Comput. 13, 4 (Dec. 2000), 315--353. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Susan Horwitz, Thomas Reps, and David Wendell Binkley. 1988. Interprocedural slicing using dependence graphs. Proc. SIGPLAN Not. 23, 7 (1988), 35--46. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Susan Horwitz, Thomas Reps, and David Wendell Binkley. 1990. Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12, 1 (1990), 26--61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Mariam Kamkar, Nahid Shahmehri, and Peter Fritzson. 1992. Interprocedural dynamic slicing. In Proceedings of the 4th Conference on Programming Language Implementation and Logic Programming. 370--384. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Raghavan Komondoor and Susan Horwitz. 2000. Semantics-preserving procedure extraction. In Proceedings of the 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’00). ACM Press, New York, NY, 155--169. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Bogdan Korel. 1995. Computation of dynamic slices for programs with arbitrary control flow. In Proceedings of the 2nd International Workshop on Automated Algorithmic Debugging (AADEBUG’95), Mireille Ducassï (Ed).Google ScholarGoogle Scholar
  57. Bogdan Korel and Janusz Laski. 1988. Dynamic program slicing. Inf. Process. Lett. 29, 3 (Oct. 1988), 155--163. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Bogdan Korel and Jurgen Rilling. 1997. Dynamic program slicing in understanding of program execution. In Proceedings of the 5th IEEE International Workshop on Program Comprenhesion (IWPC’97). IEEE Computer Society Press, Los Alamitos, CA, 80--89. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Bogdan Korel and Jurgen Rilling. 1998. Dynamic program slicing methods. Inf. Softw. Technol. 40, 11 and 12 (1998), 647--659.Google ScholarGoogle Scholar
  60. Bogdan Korel, Inderdeep Singh, Luay Tahat, and Boris Vaysburg. 2003a. Slicing of state-based models. In Proceedings of the International Conference on Software Maintenance (ICSM’03). IEEE, 34--43. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Bogdan Korel, Inderdeep Singh, Luay Tahat, and Boris Vaysburg. 2003b. Slicing of state based models. In Proceedings of the IEEE International Conference on Software Maintenance (ICSM’03). IEEE Computer Society Press, Los Alamitos, CA, 34--43. Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. Arun Lakhotia and Prabhat Singh. 2003. Challenges in getting formal with viruses. Virus Bulletin (Sept. 2003).Google ScholarGoogle Scholar
  63. I. A. Natour. 1988. On the control dependence in the program dependence graph. In Proceedings of the 1988 ACM 16th Annual Conference on Computer Science (CSC’88). ACM, New York, NY, 510--519. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Karl J. Ottenstein and Linda M. Ottenstein. 1984. The program dependence graph in software development environments. SIGPLAN Not. 19, 5 (1984), 177--184. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. A. Podgurski and L. A. Clarke. 1990. A formal model of program dependences and its implications for software testing, debugging, and maintenance. IEEE Trans. Softw. Eng. 16, 9 (1990), 965--79. Google ScholarGoogle ScholarDigital LibraryDigital Library
  66. Lyle Ramshaw. 1988. Eliminating goto's while preserving program structure. J. ACM 35, 4 (1988), 893--920. Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Venkatesh Prasad Ranganath, Torben Amtoft, Anindya Banerjee, Matthew B. Dwyer, and John Hatcliff. 2005. A new foundation for control-dependence and slicing for modern program structures. In Proceedings of the European Symposium on Programming. 77--93. Google ScholarGoogle ScholarDigital LibraryDigital Library
  68. Venkatesh Prasad Ranganath, Torben Amtoft, Anindya Banerjee, John Hatcliff, and Matthew B. Dwyer. 2007. A new foundation for control dependence and slicing for modern program structures. ACM Trans. Program. Lang. Syst. 29, 5 (2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. Saurabh Sinha, Mary Jean Harrold, and Gregg Rothermel. 2001. Interprocedural control dependence. ACM Trans. Softw. Eng. Methodol. 10, 2 (2001), 209--254. Google ScholarGoogle ScholarDigital LibraryDigital Library
  70. Joseph E. Stoy. 1985. Denotational Semantics: The Scott--Strachey Approach to Programming Language Theory (3rd ed.). MIT Press.Google ScholarGoogle Scholar
  71. Robert Endre Tarjan. 1972. Depth-first search and linear graph algorithms. SIAM J. Comput. 1, 2 (1972), 146--160.Google ScholarGoogle ScholarDigital LibraryDigital Library
  72. Frank Tip. 1995. A survey of program slicing techniques. J. Program. Lang. 3, 3 (Sep. 1995), 121--189.Google ScholarGoogle Scholar
  73. Guda A. Venkatesh. 1991. The semantic approach to program slicing. SIGPLAN Not. 26, 6 (1991), 107--119. Google ScholarGoogle ScholarDigital LibraryDigital Library
  74. Martin Ward. 2002. Program slicing via fermat transformations. In Proceedings of the 26th IEEE Annual Computer Software and Applications Conference (COMPSAC’02). IEEE Computer Society Press, Los Alamitos, CA, 357--362. Google ScholarGoogle ScholarDigital LibraryDigital Library
  75. Martin Ward and Hussein Zedan. 2007. Slicing as a program transformation. ACM Trans. Program. Lang. Syst. 29, 2 (2007), 7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  76. Mark Weiser. 1979. Program Slices: Formal, Psychological, and Practical Investigations of an Automatic Program Abstraction Method. Ph.D. Dissertation. University of Michigan, Ann Arbor, MI. Google ScholarGoogle ScholarDigital LibraryDigital Library
  77. Mark Weiser. 1981. Program Slicing. In Proceedings of the 5th International Conference on Software Engineering. 439--449. Google ScholarGoogle ScholarDigital LibraryDigital Library
  78. Michael Weiss. 1992. The transitive closure of control dependence: The iterated join. ACM Lett. Program. Lang. Syst. 1, 2 (1992), 178--190. Google ScholarGoogle ScholarDigital LibraryDigital Library
  79. Baowen Xu, Ju Qian, Xiaofang Zhang, Zhongqiang Wu, and Lin Chen. 2005. A brief survey of program slicing. ACM SIGSOFT Softw. Eng. Not. 30, 2 (2005), 1--36. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Static Backward Slicing of Non-deterministic Programs and Systems

    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 Transactions on Programming Languages and Systems
      ACM Transactions on Programming Languages and Systems  Volume 40, Issue 3
      September 2018
      230 pages
      ISSN:0164-0925
      EISSN:1558-4593
      DOI:10.1145/3236464
      Issue’s Table of Contents

      Copyright © 2018 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 August 2018
      • Accepted: 1 January 2018
      • Revised: 1 July 2015
      • Received: 1 August 2013
      Published in toplas Volume 40, Issue 3

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    HTML Format

    View this article in HTML Format .

    View HTML Format
    About Cookies On This Site

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

    Learn more

    Got it!