skip to main content
10.1145/1014007.1014020acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
Article

Dynamic slicing based on redex trails

Published:24 August 2004Publication History

ABSTRACT

Tracing computations is a widely used methodology for program debugging. Lazy languages, in particular, pose new demands on tracing techniques since following the actual trace of a computation is generally useless. Typically, they rely on the construction of a redex trail, a graph that describes the reductions of a computation and its relationships. While tracing provides a significant help for locating bugs, the task still remains complex. A well-known debugging technique for imperative programs is based on dynamic slicing, a method to find the program statements that influence the computation of a value for a specific program input.In this work, we introduce a novel technique for dynamic slicing in lazy functional logic languages. Rather than starting from scratch, our technique relies on (a slight extension of) redex trails. We provide a method to compute a correct and minimal dynamic slice from the redex trail of a computation. A clear advantage of our proposal is that one can enhance existing tracers with slicing capabilities with a modest implementation effort, since the same data structure (the redex trail) can be used for both tracing and slicing.

References

  1. E. Albert, M. Hanus, F. Huch, J. Oliver, and G. Vidal. Operational Semantics for Functional Logic Languages. Electronic Notes in Theoretical Computer Science, vol. 76 (Proc. of WFLP'02), 2002.]]Google ScholarGoogle Scholar
  2. S.K. Biswas. A Demand-Driven Set-Based Analysis. In Proc. of ACM Symp. on Principles of Programming Languages, pages 372--385. ACM Press, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S.K. Biswas. Dynamic Slicing in Higher-Order Programming Languages. PhD thesis, Department of CIS, University of Pennsylvania, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Braßel, M. Hanus, F. Huch, and G. Vidal. A Semantics for Tracing Declarative Multi-Paradigm Programs. In Proc. of the 6th Int'l Conf. on Principles and Practice of Declarative Programming (PPDP'04). ACM Press, 2004. To appear.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. Ferrante, K.J. Ottenstein, and J.D. Warren. The Program Dependence Graph and Its Use in Optimization. ACM Transactions on Programming Languages and Systems, 9(3):319--349, 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Gill. Debugging Haskell by Observing Intermediate Data Structures. In Proc. of the 4th Haskell Workshop. Technical report, University of Nottingham, 2000.]]Google ScholarGoogle Scholar
  7. T. Hallgren. Haskell Tools from the Programatica Project. In Proc. of the ACM Workshop on Haskell (Haskell'03), pages 103--106. ACM Press, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Hanus. A Unified Computation Model for Functional and Logic Programming. In Proc. of the 24th ACM Symp. on Principles of Programming Languages (POPL'97), pages 80--93. ACM, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Hanus and C. Prehofer. Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming, 9(1):33--75, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at: http://www.informatik.uni-kiel.de/~curry/+.]]Google ScholarGoogle Scholar
  11. B. Korel and J. Laski. Dynamic Program Slicing. Information Processing Letters, 29(3):155--163, 1988.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Y.A. Liu and S.D. Stoller. Eliminating Dead Code on Recursive Data. Science of Computer Programming, 47:221--242, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. F. López-Fraguas and J. Sánchez-Hernández. TOY: A Multiparadigm Declarative System. In Proc. of Int'l Conf. on Rewriting Techniques and Applications (RTA'99), pages 244--247. Springer LNCS 1631, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. H. Nilsson and J. Sparud. The Evaluation Dependence Tree as a Basis for Lazy Functional Debugging. Automated Software Engineering, 4(2):121--150, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Peyton~Jones, editor. Haskell 98 Language and Libraries: The Revised Report. CUP, 2003.]]Google ScholarGoogle Scholar
  16. B. Pope and L. Naish. A Program Transformation for Debugging Haskell 98. In Proc. of ACSC 2003, volume 16 of Conferences in Research and Practice in Information Technology, pages 227--236. ACS, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. Reps and T. Turnidge. Program Specialization via Program Slicing. In Partial Evaluation. Dagstuhl Castle, Germany, pages 409--429. Springer LNCS 1110, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Sparud and C. Runciman. Tracing Lazy Functional Computations Using Redex Trails. In Proc. of Int'l Symp. on Programming Languages, Implementations, Logics and Programs (PLILP'97), pages 291--308. Springer LNCS 1292, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. F. Tip. A Survey of Program Slicing Techniques. Journal of Programming Languages, 3:121--189, 1995.]]Google ScholarGoogle Scholar
  20. G. Vidal. Forward Slicing of Multi-Paradigm Declarative Programs Based on Partial Evaluation. In Logic-based Program Synthesis and Transformation, LOPSTR'02, pp. 219--237. Springer LNCS 2664, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Wallace, O. Chitil, T. Brehm, and C. Runciman. Multiple-View Tracing for Haskell: a New Hat. In Proc. of the 2001 ACM SIGPLAN Haskell Workshop. Universiteit Utrecht UU-CS-2001-23, 2001.]]Google ScholarGoogle Scholar
  22. M.D. Weiser. Program Slicing. IEEE Transactions on Software Engineering, 10(4):352--357, 1984.]]Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dynamic slicing based on redex trails

      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 Conferences
        PEPM '04: Proceedings of the 2004 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
        August 2004
        212 pages
        ISBN:1581138350
        DOI:10.1145/1014007

        Copyright © 2004 ACM

        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: 24 August 2004

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate66of120submissions,55%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader