Combined Static and Dynamic Assertion-Based Debugging of Constraint Logic Programs

  • Germán Puebla
  • Francisco Bueno
  • Manuel Hermenegildo
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1817)


We propose a general framework for assertion-based debugging of constraint logic programs. Assertions are linguistic constructions for expressing properties of programs. We define several assertion schemas for writing (partial) specifications for constraint logic programs using quite general properties, including user-defined programs. The framework is aimed at detecting deviations of the program behavior (symptoms) with respect to the given assertions, either at compile-time (i.e., statically) or run-time (i.e., dynamically). We provide techniques for using information from global analysis both to detect at compile-time assertions which do not hold in at least one of the possible executions (i.e., static symptoms) and assertions which hold for all possible executions (i.e., statically proved assertions). We also provide program transformations which introduce tests in the program for checking at run-time those assertions whose status cannot be determined at compile-time. Both the static and the dynamic checking are provably safe in the sense that all errors flagged are definite violations of the specifications. Finally, we report briefly on the currently implemented instances of the generic framework.


Logic Program Operational Semantic Abstract Interpretation Combine Static Program Transformation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Apt, K.R., Marchiori, E.: Reasoning about Prolog programs: from modes through types to assertions. Formal Aspects of Computing 6(6), 743–765 (1994)zbMATHCrossRefGoogle Scholar
  2. 2.
    Apt, K.R., Pedreschi, D.: Reasoning about termination of pure PROLOG programs. Information and Computation 1(106), 109–157 (1993)CrossRefMathSciNetGoogle Scholar
  3. 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 (1997)Google Scholar
  4. 4.
    Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López-García, 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. 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. 6.
    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, May 1997, pp. 155–170. U. of Linköping Press (1997)Google Scholar
  7. 7.
    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)CrossRefGoogle Scholar
  8. 8.
    Comini, M., Levi, G., Meo, M.C., Vitiello, G.: Proving properties of logic programs by abstract diagnosis. In: Dam, M. (ed.) LOMAPS-WS 1996. LNCS, vol. 1192, pp. 22–50. Springer, Heidelberg (1997)Google Scholar
  9. 9.
    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
  10. 10.
    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
  11. 11.
    Deransart, P.: Proof methods of declarative properties of definite programs. Theoretical Computer Science 118, 99–166 (1993)zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Deransart, P., Hermenegildo, M., Maluszynski, J.: Debugging of Constraint Programs: The DiSCiPl Approach. In: Deransart, P., Hermenegildo, M., Maluszynski, J. (eds.) Analysis and Visualization Tools for Constraint Programming. Springer, Heidelberg (2000) (to appear)CrossRefGoogle Scholar
  13. 13.
    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
  14. 14.
    Drabent, W., Nadjm-Tehrani, S., Maluszynski, 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
  15. 15.
    Ferrand, G.: Error diagnosis in logic programming. J. Logic Programming 4, 177–198 (1987)zbMATHCrossRefMathSciNetGoogle Scholar
  16. 16.
    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. MIT Press, Cambridge (1994)Google Scholar
  17. 17.
    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)CrossRefGoogle Scholar
  18. 18.
    Hermenegildo, M.: A Documentation Generator for Logic Programming Systems. In: ICLP 1999 Workshop on Logic Programming Environments, N.M. State University, December 1999, pp. 80–97 (1999)Google Scholar
  19. 19.
    Hermenegildo, M., Bueno, F., Puebla, G., López-García, P.: Program Analysis, Debugging and Optimization Using the Ciao System Preprocessor. In: 1999 International Conference on Logic Programming, November 1999, pp. 52–66. MIT Press, Cambridge (1999)Google Scholar
  20. 20.
    Hermenegildo, M.: The CLIP Group. Programming with Global Analysis. In: Proceedings of ILPS 1997, Cambridge, MA, pp. 49–52. MIT Press, Cambridge (1997)Google Scholar
  21. 21.
    Hermenegildo, M., Puebla, G., Bueno, F.: Using Global Analysis, Partial Speci fications, 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
  22. 22.
    Hill, P., Lloyd, J.: The Goedel Programming Language. MIT Press, Cambridge (1994)zbMATHGoogle Scholar
  23. 23.
    Jaffar, J., Maher, M.J.: Constraint Logic Programming: A Survey. Journal of Logic Programming 19/20, 503–581 (1994)CrossRefMathSciNetGoogle Scholar
  24. 24.
    Le Métayer, D.: Proving properties of programs defined over recursive data structures. In: ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 88–99 (1995)Google Scholar
  25. 25.
    Muthukumar, K., Hermenegildo, M.: Compile-time Derivation of Variable Dependency Using Abstract Interpretation. Journal of Logic Programming 13(2/3), 315–347 (1992)zbMATHCrossRefGoogle Scholar
  26. 26.
    Puebla, G., Bueno, F., Hermenegildo, M.: A Generic Preprocessor for Program Validation and Debugging. In: Deransart, P., Hermenegildo, M., Maluszynski, J. (eds.) Analysis and Visualization Tools for Constraint Programming, Springer, Heidelberg (2000) (to appear)Google Scholar
  27. 27.
    Puebla, G., Bueno, F., Hermenegildo, M.: An Assertion Language for Debugging of Constraint Logic Programs. In: Deransart, P., Hermenegildo, M., Maluszynski, J. (eds.) Analysis and Visualization Tools for Constraint Programming, Springer. Heidelberg (2000) (to appear)Google Scholar
  28. 28.
    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)zbMATHMathSciNetGoogle Scholar
  29. 29.
    Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury: an efficient purely declarative logic programming language. JLP 29(1–3) (October 1996)Google Scholar
  30. 30.
    Vetillard, E.: Utilisation de Declarations en Programmation Logique avec Constraintes. PhD thesis, U. of Aix-Marseilles II (1994)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Germán Puebla
    • 1
  • Francisco Bueno
    • 1
  • Manuel Hermenegildo
    • 1
  1. 1.Department of Computer ScienceTechnical University of Madrid (UPM) 

Personalised recommendations