skip to main content
research-article
Open access

Static Backward Slicing of Non-deterministic Programs and Systems

Published: 25 August 2018 Publication History

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.
[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.
[3]
Torben Amtoft. 2008. Slicing for modern program structures: A theory for eliminating irrelevant loops. Inform. Process. Lett. 106, 2 (2008), 45--51.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[13]
David Wendell Binkley. 1998. The application of program slicing to regression testing. Inf. Softw Technol. 40, 11 and 12 (1998), 583--594.
[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.
[15]
David Wendell Binkley and Keith Brian Gallagher. 1996. Program slicing. In Advances in Computing, vol. 43, Marvin Zelkowitz (Ed.). Academic Press, 1--50.
[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.
[17]
David Wendell Binkley and Mark Harman. 2004. A survey of empirical results on program slicing. Adv. Comput. 62 (2004), 105--178.
[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.
[19]
Gerardo Canfora, Aniello Cimitile, and Andrea De Lucia. 1998. Conditioned program slicing. Inf. Softw. Technol. 40, 11 and 12 (1998), 595--607.
[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.
[21]
Sebastian Danicic. 1999. Dataflow Minimal Slicing. Ph.D. Dissertation. University of North London, UK, School of Informatics.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[29]
Sebastian Danicic, Robert Hierons, and Michael Laurence. 2010. Decidability of strong equivalence for slices of linear, free, near-liberal program schemas. (unpublished).
[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.
[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.
[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.
[33]
Mohammed Daoudi. 2006. On Symbolic Execution Based Intraprocedural Conditioned Slicing. Ph.D. Dissertation. Goldsmiths, University of London.
[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.
[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.
[36]
Dorothy E. Denning and Peter J. Denning. 1977. Certification of programs for secure information flow. Commun. ACM 20, 7 (1977), 504--513.
[37]
Edskar Wabe Dijkstra. 1972. A Discipline of Programming. Prentice-Hall.
[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.
[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.
[40]
Robert W. Floyd. 1962. Algorithm 97: Shortest path. Commun. ACM 5, 6 (1962), 345.
[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.
[42]
Tybor Gallai. 1961. Maximum-minimum sätze und verallgemeinerte faktoren von graphen. Acta Math. Acad. Sci. Hung. 12, 131--173.
[43]
Roberto Giacobazzi and Isabella Mastroeni. 2003. Non--standard semantics for program slicing. Higher-Order Symbol. Comput. 16, 4 (2003), 297--339.
[44]
Rajiv Gopal. 1991. Dynamic program slicing based on dependence graphs. In Proceedings of the IEEE Conference on Software Maintenance. 191--200.
[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.
[46]
Grammatech Inc. 2002. The CodeSurfer Slicing System. Retrieved from www.grammatech.com.
[47]
Mark Harman, David Wendell Binkley, and Sebastian Danicic. 2003. Amorphous Program Slicing. J. Syst. Softw. 68, 1 (Oct. 2003), 45--64.
[48]
Mark Harman and Robert Mark Hierons. 2001. An overview of program slicing. Softw. Focus 2, 3 (2001), 85--92.
[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.
[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.
[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.
[52]
Susan Horwitz, Thomas Reps, and David Wendell Binkley. 1988. Interprocedural slicing using dependence graphs. Proc. SIGPLAN Not. 23, 7 (1988), 35--46.
[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.
[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.
[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.
[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).
[57]
Bogdan Korel and Janusz Laski. 1988. Dynamic program slicing. Inf. Process. Lett. 29, 3 (Oct. 1988), 155--163.
[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.
[59]
Bogdan Korel and Jurgen Rilling. 1998. Dynamic program slicing methods. Inf. Softw. Technol. 40, 11 and 12 (1998), 647--659.
[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.
[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.
[62]
Arun Lakhotia and Prabhat Singh. 2003. Challenges in getting formal with viruses. Virus Bulletin (Sept. 2003).
[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.
[64]
Karl J. Ottenstein and Linda M. Ottenstein. 1984. The program dependence graph in software development environments. SIGPLAN Not. 19, 5 (1984), 177--184.
[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.
[66]
Lyle Ramshaw. 1988. Eliminating goto's while preserving program structure. J. ACM 35, 4 (1988), 893--920.
[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.
[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).
[69]
Saurabh Sinha, Mary Jean Harrold, and Gregg Rothermel. 2001. Interprocedural control dependence. ACM Trans. Softw. Eng. Methodol. 10, 2 (2001), 209--254.
[70]
Joseph E. Stoy. 1985. Denotational Semantics: The Scott--Strachey Approach to Programming Language Theory (3rd ed.). MIT Press.
[71]
Robert Endre Tarjan. 1972. Depth-first search and linear graph algorithms. SIAM J. Comput. 1, 2 (1972), 146--160.
[72]
Frank Tip. 1995. A survey of program slicing techniques. J. Program. Lang. 3, 3 (Sep. 1995), 121--189.
[73]
Guda A. Venkatesh. 1991. The semantic approach to program slicing. SIGPLAN Not. 26, 6 (1991), 107--119.
[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.
[75]
Martin Ward and Hussein Zedan. 2007. Slicing as a program transformation. ACM Trans. Program. Lang. Syst. 29, 2 (2007), 7.
[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.
[77]
Mark Weiser. 1981. Program Slicing. In Proceedings of the 5th International Conference on Software Engineering. 439--449.
[78]
Michael Weiss. 1992. The transitive closure of control dependence: The iterated join. ACM Lett. Program. Lang. Syst. 1, 2 (1992), 178--190.
[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.

Cited By

View all

Index Terms

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

    Recommendations

    Comments

    Information & Contributors

    Information

    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
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 25 August 2018
    Accepted: 01 January 2018
    Revised: 01 July 2015
    Received: 01 August 2013
    Published in TOPLAS Volume 40, Issue 3

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Control Dependence
    2. Program Slicing

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)103
    • Downloads (Last 6 weeks)17
    Reflects downloads up to 23 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    HTML Format

    View this article in HTML Format.

    HTML Format

    Login options

    Full Access

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media