Skip to main content

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1870))

Abstract

We present a generic preprocessor for combined static/dynamic validation and debugging of constraint logic programs. Passing programs through the preprocessor prior to execution allows detecting many bugs automatically. This is achieved by performing a repertoire of tests which range from simple syntactic checks to much more advanced checks based on static analysis of the program. Together with the program, the user may provide a series of assertions which trigger further automatic checking of the program. Such assertions are written using the assertion language presented in Chapter 1, which allows expressing a wide variety of properties. These properties extend beyond the predefined set which may be understandable by the available static analysers and include properties defined by means of user programs. In addition to user-provided assertions, in each particular CLP system assertions may be available for predefined system predicates. Checking of both user-provided assertions and assertions for system predicates is attempted first at compile-time by comparing them with the results of static analysis. This may allow statically proving that the assertions hold (i.e., they are validated) or that they are violated (and thus bugs detected). User-provided assertions (or parts of assertions) which cannot be statically proved nor disproved are optionally translated into run-time tests. The implementation of the preprocessor is generic in that it can be easily customised to different CLP systems and dialects and in that it is designed to allow the integration of additional analyses in a simple way. We also report on two tools which are instances of the generic preprocessor: CiaoPP (for the Ciao Prolog system) and CHIPRE (for the CHIP CLP(FD) system). The currently existing analyses include types, modes, non-failure, determinacy, and computational cost, and can treat modules separately, performing incremental analysis.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aggoun, A., Beldiceanu, N.: Overview of the chip compiler system. In: Proc. International Conference on Logic Programming, pp. 775–789. MIT Press, Cambridge (1991)

    Google Scholar 

  2. Bourdoncle, F.: Abstract debugging of higher-order imperative languages. In: Programming Languages Design and Implementation 1993, pp. 46–55 (1993)

    Google Scholar 

  3. Boye, J., Drabent, W., Małuszyński, J.: Declarative diagnosis of constraint programs: an assertion-based approach. In: Proc. of the 3rd. Int’l Workshop on Automated Debugging–AADEBUG 1997, Linköping, Sweden, pp. 123–141. U. of Linköping Press (May 1997)

    Google Scholar 

  4. Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López, P., Puebla, G.: The Ciao Prolog System. Reference Manual. The Ciao System Documentation Series–TR CLIP3/97.1, School of Computer Science, Technical University of Madrid (UPM) (August 1997)

    Google Scholar 

  5. Bueno, F., Cabeza, D., Hermenegildo, M., Puebla, G.: Global Analysis of Standard Prolog Programs. In: Riis Nielson, H. (ed.) ESOP 1996. LNCS, vol. 1058, pp. 108–124. Springer, Heidelberg (1996)

    Google Scholar 

  6. Bueno, F., García de la Banda, M., Hermenegildo, M.: Effectiveness of Abstract Interpretation in Automatic Parallelization: A Case Study in Logic Programming. ACM Transactions on Programming Languages and Systems 21(2), 189–238 (1999)

    Article  Google Scholar 

  7. Bueno, F., Deransart, P., Drabent, W., Ferrand, G., Hermenegildo, M., Maluszynski, J., Puebla, G.: On the Role of Semantic Approximations in Validation and Diagnosis of Constraint Logic Programs. In: Proc. of the 3rd. Int’l Workshop on Automated Debugging–AADEBUG 1997, Linköping, Sweden, pp. 155–170. U. of Linköping Press (May 1997)

    Google Scholar 

  8. Bueno, F., López, P., Puebla, G., Hermenegildo, M.: The Ciao Prolog Preprocessor. Technical Report CLIP8/95.0.7.20, Technical University of Madrid (UPM), Facultad de Informática, 28660 Boadilla del Monte, Madrid, Spain (November 1999)

    Google Scholar 

  9. Bueno, F., López, P., Puebla, G., Hermenegildo, M., Pietrzak, P.: The CHIP Assertion Preprocessor. Technical Report CLIP1/99.1, Technical University of Madrid (UPM), Facultad de Informática, 28660 Boadilla del Monte, Madrid, Spain (March 1999), Also as deliverable of the ESPRIT project DISCIPL

    Google Scholar 

  10. Byrd, L.: Understanding the Control Flow of Prolog Programs. In: Tárnlund, S.-A. (ed.) Workshop on Logic Programming, Debrecen (1980)

    Google Scholar 

  11. Cabeza, D., Hermenegildo, M.: A Modular, Standalone Compiler for Ciao Prolog and Its Generic Program Processing Library. Special Issue on Parallelism and Implementation of (C)LP Systems. Electronic Notes in Theoretical Computer Science. Elsevier - North Holland (2000) (to appear)

    Google Scholar 

  12. Cabeza, D., Hermenegildo, M.: The Ciao Module System: A New Module System for Prolog. Special Issue on Parallelism and Implementation of (C)LP Systems. Electronic Notes in Theoretical Computer Science. Elsevier - North Holland (2000) (to appear)

    Google Scholar 

  13. Le Charlier, B., Van Hentenryck, P.: Experimental Evaluation of a Generic Abstract Interpretation Algorithm for Prolog. ACM Transactions on Programming Languages and Systems 16(1), 35–101 (1994). The CLIP Group. Program Assertions. The Ciao System Documentation Series – TR CLIP4/97.1, Facultad de Informática, UPM (August 1997)

    Article  Google Scholar 

  14. Comini, M., Levi, G., Meo, M.C., Vitiello, G.: Abstract diagnosis. Journal of Logic Programming 39(1-3), 43–93 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  15. Comini, M., Levi, G., Vitiello, G.: Abstract debugging of logic programs. In: Fribourg, L., Turini, F. (eds.) LOPSTR 1994 and META 1994. LNCS, vol. 883, pp. 440–450. Springer, Heidelberg (1994)

    Google Scholar 

  16. The COSYTEC Team. CHIP System Documentation (April 1996)

    Google Scholar 

  17. Cousot, P., Cousot, R.: Abstract Interpretation: a Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In: Fourth ACM Symposium on Principles of Programming Languages, pp. 238–252 (1977)

    Google Scholar 

  18. Dart, P.W., Zobel, J.: A regular type language for logic programs. In: Pfenning, F. (ed.) Types in Logic Programming, pp. 157–187. MIT Press, Cambridge (1992)

    Google Scholar 

  19. Debray, S.K., López-García, P., Hermenegildo, M.: Non-Failure Analysis for Logic Programs. In: 1997 International Conference on Logic Programming, June 1997, pp. 48–62. MIT Press, Cambridge (1997)

    Google Scholar 

  20. Drabent, W., Nadjm-Tehrani, S., Małuszyński, J.: The Use of Assertions in Algorithmic Debugging. In: Proceedings of the Intl. Conf. on Fifth Generation Computer Systems, pp. 573–581 (1988)

    Google Scholar 

  21. Drabent, W., Nadjm-Tehrani, S., Małuszyński, J.: Algorithmic debugging with assertions. In: Abramson, H., Rogers, M.H. (eds.) Meta-programming in Logic Programming, pp. 501–522. MIT Press, Cambridge (1989)

    Google Scholar 

  22. Ducassé, M.: OPIUM - an advanced debugging system. In: Comyn, G., Ratcliffe, M.J., Fuchs, N.E. (eds.) LPSS 1992. LNCS (LNAI), vol. 636, pp. 303–312. Springer, Heidelberg (1992)

    Google Scholar 

  23. Ducassé, M.: A pragmatic survey of automated debugging. In: Fritzson, P.A. (ed.) AADEBUG 1993. LNCS, vol. 749, pp. 1–15. Springer, Heidelberg (1993)

    Chapter  Google Scholar 

  24. Ducassé, M., Noyé, J.: Logic programming environments: Dynamic program analysis and debugging. Journal of Logic Programming 19(20), 351–384 (1994)

    Article  MathSciNet  Google Scholar 

  25. Gallagher, J.P.: Tutorial on specialisation of logic programs. In: Proceedings of PEPM 1993, the ACM Sigplan Symposium on Partial Evaluation and Semantics Based Program Manipulation, pp. 88–98. ACM Press, New York (1993)

    Chapter  Google Scholar 

  26. Gallagher, J.P., de Waal, D.A.: Fast and precise regular approximations of logic programs. In: Van Hentenryck, P. (ed.) Proc. of the 11th International Conference on Logic Programming, pp. 599–613. The MIT Press, Cambridge (1994)

    Google Scholar 

  27. García de la Banda, M., Hermenegildo, M., Bruynooghe, M., Dumortier, V., Janssens, G., Simoens, W.: Global Analysis of Constraint Logic Programs. ACM Transactions on Programming Languages and Systems 18(5), 564–615 (1996)

    Article  Google Scholar 

  28. Hermenegildo, M.: A System for Automatically Generating Documentation for (C)LP Programs. Special Issue on Parallelism and Implementation of (C)LP Systems. Electronic Notes in Theoretical Computer Science (2000) (to appear)

    Google Scholar 

  29. Hermenegildo, M., Bueno, F., Cabeza, D., García de la Banda, M., López, P., Puebla, G.: The CIAO Multi-Dialect Compiler and System: An Experimentation Workbench for Future (C)LP Systems. In: Parallelism and Implementation of Logic and Constraint Logic Programming, Nova Science, Commack, NY, USA, pp. 65–85 (April 1999)

    Google Scholar 

  30. Hermenegildo, M., Bueno, F., Puebla, G., López, P.: Program Analysis, Debugging and Optimization Using the Ciao System Preprocessor. In: 1999 International Conference on Logic Programming, pp. 52–66. MIT Press, Cambridge (1999)

    Google Scholar 

  31. Hermenegildo, M., The CLIP Group: Programming with Global Analysis. In: Proceedings of ILPS 1997, pp. 49–52. MIT Press, Cambridge (1997)

    Google Scholar 

  32. Hermenegildo, M., Puebla, G., Bueno, F.: Using Global Analysis, Partial Specifications, and an Extensible Assertion Language for Program Validation and Debugging. In: Apt, K.R., Marek, V., Truszczynski, M., Warren, D.S. (eds.) The Logic Programming Paradigm: a 25–Year Perspective, pp. 161–192. Springer, Heidelberg (1999)

    Google Scholar 

  33. Hermenegildo, M., Warren, R., Debray, S.K.: Global Flow Analysis as a Practical Compilation Tool. Journal of Logic Programming 13(4), 349–367 (1992)

    Article  Google Scholar 

  34. Jaffar, J., Maher, M.J.: Constraint Logic Programming: A Survey. Journal of Logic Programming 19/20, 503–581 (1994)

    Article  MathSciNet  Google Scholar 

  35. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prenctice Hall, New York (1993)

    MATH  Google Scholar 

  36. Kelly, A., Macdonald, A., Marriott, K., Stuckey, P., Yap, R.: Eectiveness of optimizing compilation for CLP(R). In: Proceedings of Joint International Conference and Symposium on Logic Programming, pp. 37–51. The MIT Press, Cambridge (1996)

    Google Scholar 

  37. Kelly, A., Marriott, K., Søndergaard, H., Stuckey, P.J.: A generic object oriented incremental analyser for constraint logic programs. In: Proceedings of the 20th Australasian Computer Science Conference, pp. 92–101 (1997)

    Google Scholar 

  38. Muthukumar, K., Hermenegildo, M.: Compile-time Derivation of Variable Dependency Using Abstract Interpretation. Journal of Logic Programming 13(2/3), 315–347 (1992)

    Article  MATH  Google Scholar 

  39. Puebla, G., Bueno, F., Hermenegildo, M.: Combined Static and Dynamic Assertion-Based Debugging of Constraint Logic Programs. In: Bossi, A. (ed.) LOPSTR 1999. LNCS, vol. 1817. Springer, Heidelberg (2000) (to appear)

    Chapter  Google Scholar 

  40. Puebla, G., Hermenegildo, M.: Implementation of Multiple Specialization in Logic Programs. In: Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics Based Program Manipulation, pp. 77–87. ACM Press, New York (1995)

    Google Scholar 

  41. Puebla, G., Hermenegildo, M.: Abstract Multiple Specialization and its Application to Program Parallelization. J. of Logic Programming. Special Issue on Synthesis, Transformation and Analysis of Logic Programs 41(2&3), 279–316 (1999)

    MATH  MathSciNet  Google Scholar 

  42. Puebla, G., Hermenegildo, M.: Some Issues in Analysis and Specialization of Modular Ciao-Prolog Programs. In: Special Issue on Optimization and Implementation of Declarative Programming Languages. Electronic Notes in Theoretical Computer Science, vol. 30, Elsevier - North Holland (March 2000)

    Google Scholar 

  43. Shapiro, E.: Algorithmic Program Debugging. In: ACM Distiguished Dissertation. The MIT Press, Cambridge (1982)

    Google Scholar 

  44. Yardeni, E., Shapiro, E.: A Type System for Logic Programs. Concurrent Prolog: Collected Papers, 211–244 (1987)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Puebla, G., Bueno, F., Hermenegildo, M. (2000). A Generic Preprocessor for Program Validation and Debugging. In: Deransart, P., Hermenegildo, M.V., Małuszynski, J. (eds) Analysis and Visualization Tools for Constraint Programming. Lecture Notes in Computer Science, vol 1870. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10722311_3

Download citation

  • DOI: https://doi.org/10.1007/10722311_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-41137-6

  • Online ISBN: 978-3-540-40016-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics