skip to main content
10.1145/3302516.3307345acmotherconferencesArticle/Chapter ViewAbstractPublication PagesccConference Proceedingsconference-collections
research-article

A static slicing method for functional programs and its incremental version

Published:16 February 2019Publication History

ABSTRACT

An effective static slicing technique for functional programs must have two features. Its handling of function calls must be context sensitive without being inefficient, and, because of the widespread use of algebraic datatypes, it must take into account structure transmitted dependences. It has been shown that any analysis that combines these two characteristics is undecidable, and existing slicing methods drop one or the other. We propose a slicing method that only weakens (and not entirely drop) the requirement of context-sensitivity and that too for some and not all programs.

We then consider applications that require the same program to be sliced with respect to several slicing criteria. We propose an incremental version of our slicing method to handle such situations efficiently. The incremental version consists of a one time pre-computation step that uses the non-incremental version to slice the program with respect to a fixed default slicing criterion and processes the results to a canonical form. Presented with a slicing criterion, a low-cost incremental step uses the results of the pre-computation to obtain the slice.

Our experiments with a prototype incremental slicer confirms the expected benefits---the cost of incremental slicing, even when amortized over only a few slicing criteria, is much lower than the cost of non-incremental slicing.

References

  1. David Binkley and Mark Harman. 2004. A survey of empirical results on program slicing. Advances in Computers 62 (2004).Google ScholarGoogle Scholar
  2. Sandip Kumar Biswas. 1997.Google ScholarGoogle Scholar
  3. Dynamic Slicing in Higher-order Programming Languages. Ph.D. Dissertation. University of Pennsylvania, Philadelphia, PA, USA.Google ScholarGoogle Scholar
  4. R. Hindley. 1969. The Principal Type-Scheme of an Object in Combinatory Logic. Trans. Amer. Math. Soc. 146 (1969), 29–60. http://www.jstor.org/stable/1995158Google ScholarGoogle Scholar
  5. Prasanna Kumar K. 2019.Google ScholarGoogle Scholar
  6. Dependence Analysis of Functional Programs and its Applications. Ph.D. Dissertation. Indian Institute of Technology, Bombay, Mumbai, India.Google ScholarGoogle Scholar
  7. Amey Karkare, Uday Khedker, and Amitabha Sanyal. 2007.Google ScholarGoogle Scholar
  8. Liveness of Heap Data for Functional Programs. In Heap Analysis and Verification Workshop.Google ScholarGoogle Scholar
  9. Yanhong A. Liu and Scott D. Stoller. 2003. Eliminating Dead Code on Recursive Data. Sci. Comput. Program. 47 (2003). Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Robin Milner. 1978. A theory of type polymorphism in programming. J. Comput. System Sci. 17, 3 (1978), 348 – 375. 0000(78)90014- 4Google ScholarGoogle ScholarCross RefCross Ref
  11. Neil Mitchell and Colin Runciman. 2009. Losing Functions Without Gaining Data: Another Look at Defunctionalisation. In Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Mehryar Mohri and Mark-Jan Nederhof. 2000. Regular Approximation of Context-Free Grammars through Transformation. In Robustness in Language and Speech Technology. Kluwer Academic Publishers.Google ScholarGoogle Scholar
  13. NoFib. 2019.Google ScholarGoogle Scholar
  14. Haskell Benchmark Suite. http://git.haskell.org/nofib.git. (Last accessed).Google ScholarGoogle Scholar
  15. Claudio Ochoa, Josep Silva, and Germán Vidal. 2008. Dynamic Slicing of Lazy Functional Programs Based on Redex Trails. Higher Order Symbol. Comput. 21 (2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Roly Perera, Umut A. Acar, James Cheney, and Paul Blain Levy. 2012. Functional programs that explain their work. In ACM SIGPLAN International Conference on Functional Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Simon L. Peyton-Jones. 1987.Google ScholarGoogle Scholar
  18. The Implementation of Functional Programming Languages. Prentice-Hall.Google ScholarGoogle Scholar
  19. Benjamin C. Pierce. 2002.Google ScholarGoogle Scholar
  20. Types and Programming Languages (1st ed.). The MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Thomas Reps. 2000. Undecidability of Context-sensitive Data-dependence Analysis. ACM Trans. Program. Lang. Syst. (2000). Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Thomas W. Reps and Todd Turnidge. 1996. Program Specialization via Program Slicing. In Partial Evaluation, International Seminar, Dagstuhl Castle, Germany. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Nuno F. Rodrigues and Luis S. Barbosa. 2006. Component Identification Through Program Slicing. Electronic Notes in Theoretical Computer Science 160 (2006).Google ScholarGoogle Scholar
  24. Nuno F. Rodrigues and Luis S. Barbosa. 2006. Program Slicing by Calculation. Journal of Universal Computer Science (2006).Google ScholarGoogle Scholar
  25. Amr Sabry and Matthias Felleisen. 1992.Google ScholarGoogle Scholar
  26. Reasoning About Programs in Continuation-passing Style. SIGPLAN Lisp Pointers (1992). Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Josep Silva. 2012.Google ScholarGoogle Scholar
  28. A Vocabulary of Program Slicing-based Techniques. ACM Comput. Surv. (2012). Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Josep Silva, Salvador Tamarit, and César Tomás. 2012.Google ScholarGoogle Scholar
  30. System Dependence Graphs in Sequential Erlang. In Proceedings of the 15th International Conference on Fundamental Approaches to Software Engineering (FASE’12). Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Frank Tip. 1995. A Survey of Program Slicing Techniques. Journal of Programming Languages 3 (1995).Google ScholarGoogle Scholar

Index Terms

  1. A static slicing method for functional programs and its incremental version

          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
          • Published in

            cover image ACM Other conferences
            CC 2019: Proceedings of the 28th International Conference on Compiler Construction
            February 2019
            204 pages
            ISBN:9781450362771
            DOI:10.1145/3302516

            Copyright © 2019 ACM

            © 2019 Association for Computing Machinery. ACM acknowledges that this contribution was authored or co-authored by an employee, contractor or affiliate of a national government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only.

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 16 February 2019

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader