Forward Slicing of Multi-paradigm Declarative Programs Based on Partial Evaluation

  • Germán Vidal
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2664)


Program slicing has been mainly studied in the context of imperative languages, where it has been applied to many software engineering tasks, like program understanding, maintenance, debugging, testing, code reuse, etc. This paper introduces the first forward slicing technique for multi-paradigm declarative programs. In particular, we show how program slicing can be defined in terms of online partial evaluation. Our approach clarifies the relation between both methodologies and provides a simple way to develop program slicing tools from existing partial evaluators.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    S.M. Abramov and R. Glück. The Universal Resolving Algorithm: Inverse Computation in a Functional Language. In Mathematics of Program Construction. Proceedings, pages 187–212. Springer LNCS 1837, 2000.CrossRefGoogle Scholar
  2. 2.
    E. Albert, M. Hanus, F. Huch, J. Olvier, and G. Vidal. Operational Semantics for Functional Logic Languages. In Proc. of the Int’l Workshop on Functional and (Constraint) Logic Programming (WFLP’02), volume 76 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, 2002.Google Scholar
  3. 3.
    E. Albert, M. Hanus, and G. Vidal. A Practical Partial Evaluation Scheme for Multi-Paradigm Declarative Languages. Journal of Functional and Logic Programming, 2002(1), 2002.Google Scholar
  4. 4.
    E. Albert and G. Vidal. The Narrowing-Driven Approach to Functional Logic Program Specialization. New Generation Computing, 20(1):3–26, 2002.zbMATHMathSciNetCrossRefGoogle Scholar
  5. 5.
    M. Alpuente, M. Falaschi, and G. Vidal. Partial Evaluation of Functional Logic Programs. ACM TOPLAS, 20(4):768–844, 1998.CrossRefGoogle Scholar
  6. 6.
    S. Antoy. Definitional trees. In Proc. of the 3rd Int’l Conference on Algebraic and Logic Programming (ALP’92), pages 143–157. Springer LNCS 632, 1992.CrossRefGoogle Scholar
  7. 7.
    S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, 47(4): 776–822, 2000.CrossRefMathSciNetGoogle Scholar
  8. 8.
    M. Das, T. Reps, and P. Van Hentenryck. Semantic Foundations of Binding-Time Analysis for Imperative Programs. In Proc. of the Symp. on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’95), pages 100–110, 1995.Google Scholar
  9. 9.
    D. De Schreye, R. Glück, J. Jørgensen, M. Leuschel, B. Martens, and M.H. Sørensen. Conjunctive Partial Deduction: Foundations, Control, Algorihtms, and Experiments. Journal of Logic Programming, 41(2&3):231–277, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    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.zbMATHCrossRefGoogle Scholar
  11. 11.
    J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of the ACM Symp. on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’93), pages 88–98. ACM, New York, 1993.CrossRefGoogle Scholar
  12. 12.
    R. Glück and M.H. Sørensen. A Roadmap to Metacomputation by Supercompilation. In O. Danvy, R. Glück, and P. Thiemann, editors, Partial Evaluation, Int’l Seminar, Dagstuhl Castle, Germany, pages 137–160. Springer LNCS 1110, 1996.Google Scholar
  13. 13.
    V. Gouranton. Deriving Analysers by Folding/Unfolding of Natural Semantics and a Case Study: Slicing. In Proc. of SAS’98, pages 115–133, 1998.Google Scholar
  14. 14.
    M. Hanus. A Unified Computation Model for Functional and Logic Programming. In Proc. of ACM Symp. on Principles of Programming Languages (POPL’97), pages 80–93. ACM, New York, 1997.Google Scholar
  15. 15.
    M. Hanus, S. Antoy, J. Koj, R. Sadre, and F. Steiner. PAKCS 1.2: The Portland Aachen Kiel Curry System User Manual. Technical report, University of Kiel, Germany, 2000.Google Scholar
  16. 16.
    M. Hanus and C. Prehofer. Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming, 9(1):33–75, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  17. 17.
    M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at:
  18. 18.
    J. Hughes. Backwards Analysis of Functional Programs. In Proc. of the Int’l Workshop on Partial Evaluation and Mixed Computation, pages 187–208. North-Holland, Amsterdam, 1988.Google Scholar
  19. 19.
    D.J. Kuck, R.H. Kuhn, D.A. Padua, B. Leasure, and M. Wolfe. Dependence Graphs and Compiler Optimization. In Proc. of the 8th Symp. on the Principles of Programming Languages (POPL’81), SIGPLAN Notices, pages 207–218, 1981.Google Scholar
  20. 20.
    M. Leuschel. Program Specialization and Abstract Interpretation Reconciled. In Proc. of the Joint Int’l Conf. and Symp. on Logic Programming (JICSLP’98), pages 220–234. MIT Press, 1998.Google Scholar
  21. 21.
    M. Leuschel and M.H. Sørensen. Redundant Argument Filtering of Logic Programs. In Proc. of LOPSTR’96, pages 83–103. LNCS 1207 83–103, 1996.Google Scholar
  22. 22.
    F. López-Fraguas and J. Sánchez-Hernández. TOY: A Multiparadigm Declarative System. In Proc. of RTA’99, pages 244–247. Springer LNCS 1631, 1999.Google Scholar
  23. 23.
    T. Mogensen. Separating Binding-Times in Language Specifications. In Proc. of 4th Int’l Conf. on Functional Programming and Computer Architecture (FPCA’89), pages 12–25. ACM, New York, 1989.CrossRefGoogle Scholar
  24. 24.
    T. Reps and T. Turnidge. Program Specialization via Program Slicing. In O. Danvy, R. Glück, and P. Thiemann, editors, Partial Evaluation. Dagstuhl Castle, Germany, February 1996, pages 409–429. Springer LNCS 1110, 1996.Google Scholar
  25. 25.
    S. Schoenig and M. Ducasse. A Backward Slicing Algorithm for Prolog. In Proc. of SAS’96, pages 317–331. Springer LNCS 1145, 1996.Google Scholar
  26. 26.
    J.P. Secher and M.H. Sørensen. From Checking to Inference via Driving and Dag Grammars. In ACM Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’02), pages 41–51. ACM, New York, 2002.CrossRefGoogle Scholar
  27. 27.
    P. Sestoft. Deriving a Lazy Abstract Machine. Journal of Functional Programming, 7(3):231–264, 1997.zbMATHCrossRefMathSciNetGoogle Scholar
  28. 28.
    M.H. Sørensen, R. Glück, and N.D. Jones. A Positive Supercompiler. Journal of Functional Programming, 6(6):811–838, 1996.zbMATHGoogle Scholar
  29. 29.
    G. Szilagyi, T. Gyimothy, and J. Maluszynski. Static and Dynamic Slicing of Constraint Logic Programs. J. Automated Software Engineering, 9(1):41–65, 2002.zbMATHCrossRefGoogle Scholar
  30. 30.
    F. Tip. A Survey of Program Slicing Techniques. Journal of Programming Languages, 3:121–189, 1995.Google Scholar
  31. 31.
    V.F. Turchin. The Concept of a Supercompiler. ACM Transactions on Programming Languages and Systems, 8(3):292–325, July 1986.zbMATHCrossRefMathSciNetGoogle Scholar
  32. 32.
    G. Vidal. Forward Slicing by Partial Evaluation. Technical report, DSIC, Technical University of Valencia, 2003. Available from
  33. 33.
    M.D. Weiser. Program Slices: Formal, Psychological, and Practical Investigations of an Automatic Program Abstraction Method. PhD thesis, The University of Michigan, 1979.Google Scholar
  34. 34.
    M.D. Weiser. Program Slicing. IEEE Transactions on Software Engineering, 10(4):352–357, 1984.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Germán Vidal
    • 1
  1. 1.DSICTechnical University of ValenciaValenciaSpain

Personalised recommendations