Abstract
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.
This work has been supported in part by projects ESPRIT LTR #22532 DiSCiPl and CICYT TIC99-1151 EDIPIA. The authors would also like to thank Jan Małuszyński, Wlodek Drabent and Pierre Deransart for many interesting discussions on assertions.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Apt, K.R., Marchiori, E.: Reasoning about Prolog programs: from modes through types to assertions. Formal Aspects of Computing 6(6), 743–765 (1994)
Apt, K.R., Pedreschi, D.: Reasoning about termination of pure PROLOG programs. Information and Computation 1(106), 109–157 (1993)
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)
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)
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)
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)
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)
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)
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)
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)
Deransart, P.: Proof methods of declarative properties of definite programs. Theoretical Computer Science 118, 99–166 (1993)
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)
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)
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)
Ferrand, G.: Error diagnosis in logic programming. J. Logic Programming 4, 177–198 (1987)
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)
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)
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)
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)
Hermenegildo, M.: The CLIP Group. Programming with Global Analysis. In: Proceedings of ILPS 1997, Cambridge, MA, pp. 49–52. MIT Press, Cambridge (1997)
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)
Hill, P., Lloyd, J.: The Goedel Programming Language. MIT Press, Cambridge (1994)
Jaffar, J., Maher, M.J.: Constraint Logic Programming: A Survey. Journal of Logic Programming 19/20, 503–581 (1994)
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)
Muthukumar, K., Hermenegildo, M.: Compile-time Derivation of Variable Dependency Using Abstract Interpretation. Journal of Logic Programming 13(2/3), 315–347 (1992)
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)
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)
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)
Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury: an efficient purely declarative logic programming language. JLP 29(1–3) (October 1996)
Vetillard, E.: Utilisation de Declarations en Programmation Logique avec Constraintes. PhD thesis, U. of Aix-Marseilles II (1994)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Puebla, G., Bueno, F., Hermenegildo, M. (2000). Combined Static and Dynamic Assertion-Based Debugging of Constraint Logic Programs. In: Bossi, A. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 1999. Lecture Notes in Computer Science, vol 1817. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10720327_16
Download citation
DOI: https://doi.org/10.1007/10720327_16
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67628-7
Online ISBN: 978-3-540-45148-8
eBook Packages: Springer Book Archive