Skip to main content
Log in

Static and Dynamic Slicing of Constraint Logic Programs

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

Slicing is a program analysis technique originally developed for imperative languages. It facilitates understanding of data flow and debugging.

This paper discusses slicing of Constraint Logic Programs. Constraint Logic Programming (CLP) is an emerging software technology with a growing number of applications. Data flow in constraint programs is not explicit, and for this reason the concepts of slice and the slicing techniques of imperative languages are not directly applicable.

This paper formulates declarative notions of slice suitable for CLP. They provide a basis for defining slicing techniques (both dynamic and static) based on variable sharing. The techniques are further extended by using groundness information.

A prototype dynamic slicer of CLP programs implementing the presented ideas is briefly described together with the results of some slicing experiments.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Bates, S. and Horwitz, S. 1993. Incremental program testing using program dependence graphs. In Conference Record of the 20th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Charleston, South California: ACM Press, pp. 384–396.

    Google Scholar 

  • Deransart, P. and Aillaud, C. 2000. Towards a language for CLP choice-tree visualisation. In P. Deransart, M. Hermenegildo, and J. Małuszyński, editors, Analysis and Visualization Tools for Constraint Programming, Springer Verlag, pp. 209–236, LNCS.

  • Deransart, P. and Małuszyński, J. 1993. A Grammatical View of Logic Programming. London, England: The MIT Press.

    Google Scholar 

  • Forgács, I. and Gyimóthy, T. 1997. An efficient interprocedural slicing method for large programs. In Proceedings of SEKE'97, Madrid, pp. 279–287.

  • Gyimóthy, T., Beszádes, À., and Forgács, I. 1999. An efficient relevant slicing method for debugging. In Proceedings of the 7th European Software Engineering Conference (ESEC'99), Toulouse, France: Springer Verlag, pp. 303–322, LNCS Vol. 1687.

    Google Scholar 

  • Gyimóthy, T. and Paakki, J. 1995. Static slicing of logic programs. In Proceedings of Second International Workshop on Automated and Algorithmic Debugging (AADEBUG'95), France: Saint Malo, pp. 85–105.

  • Harmath, L., Szilágyi, Gy., Gyimóthy, T., and Csirik, J. 1999. Dynamic slicing of logic programs. In Poceedings of the Program Analysis and Verification, Fenno-Ugric Symposium (FUSST'99), Tallin: Estonia, pp. 101–113.

  • Horwitz, S. and Reps, T. 1992. The use of program dependence graphs in software engineering. In Proceedings of the Fourteenth International Conference on Software Engineering, Australia: Melbourne, pp. 392–411.

  • Horwitz, S., Reps, T., and Binkley, D. 1990. Interprocedural slicing using dependence graphs. ACM Transactions on Programming Languages and Systems, 12:26–61.

    Google Scholar 

  • http://www.sics.se/sicstus.html

  • Jaffar, J. and Maher, M.J. 1994. Constraint logic programming: A survey. The Journal of Logic Programming, 19/20:503–582.

    Google Scholar 

  • Kamkar, M. and Fritzson, P. 1995. Evaluation of program slicing tools. In Proceedings of the Second International Workshop on Automated and Algorithmic Debugging (AADEBUG'95), France: Saint Malo, pp. 51–69.

  • Kókai, G., Harmath, L., and Gyimóthy, T. 1997. Algorithmic debugging and testing of prolog programs. In Proceedings of the Fourteenth International Conference on Logic Programming, Eighth Workshop on Logic Programming Environments (ICLP'97), Belgium: Leuven, pp. 14–21.

  • Korel, B. and Rilling, J. 1997. Application of dynamic slicing in program debugging. In Proceedings of the Third International Workshop on Automatic Debugging (AADEBUG'97), Sweden: Linköping, pp. 43–59.

  • Marriott, K. and Stuckey, P.J. 1998. Programming with Constraints. An Introduction. London, England: The MIT Press.

    Google Scholar 

  • Schoening, S. and Ducassá, M. 1996. A backward slicing algorithm for prolog. In Proceedings of the Third International Static Analysis Symposium (SAS'96), Springer-Verlag, pp. 317–331, LNCS, Vol. 1145.

  • Shapiro, E. 1983. Algorithmic Debugging. London, England: The MIT Press.

    Google Scholar 

  • Somogyi, Z., Henderson, F., Conway, T. 1996. The execution algorithm of mercury, an efficient purely declarative logic programming language. JLP, 29(1–3):17–64.

    Google Scholar 

  • Szilágyi, GY., Gyimóthy, T., and Maluszyński, J. 1998. Slicing of constraint logic programs. Technical Report, Linköping University Electronic Press 1998/020, www.ep.liu.se/ea/cis/1998/002.

  • Szilágyi, Gy., Gyimóthy, T., and Małuszyński, J. 2000. Slicing of constraint logic programs. In Proceedings of the Fourth International Workshop on Automated Debugging (AADEBUG'2000), Germany: Munich, pp. 176–187.

  • Tessier, A. and Fèrrand, G. 2000. Declarative diagnosis in the CLP scheme. In P. Deransart, M. Hermenegildo, and J. Maluszyński, editors, Analysis and Visualization Tools for Constraint Programming. Springer Verlag, pp. 151–173, LNCS.

  • Tip, F. 1995. A survey of program slicing techniques. Journal of Programming Languages, 3(3):121–189.

    Google Scholar 

  • Weiser, M. 1982. Programmers use slices when debugging. Communications of the ACM, pp. 446–452.

  • Zhao, J., Cheng, J., and Ushijima, K. 1997. Slicing concurrent logic programs. In Proceedings of the Second Fuji International Workshop on Functional and Logic Programming, pp. 143–162.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Szilágyi, G., Gyimóthy, T. & Małuszyński, J. Static and Dynamic Slicing of Constraint Logic Programs. Automated Software Engineering 9, 41–65 (2002). https://doi.org/10.1023/A:1013280119003

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1013280119003

Navigation