Abstract
In this paper, we extend the well-known Naish’s declarative debugging scheme for diagnosing wrong computed answers in first-order lazy functional-logic programs to the higher-order setting of the simply typed λ-calculus, where programs are presented by conditional pattern rewrite systems. Our approach generalizes and combines declarative debugging techniques previously developed for less expressive declarative programming paradigms involving applicative rewrite rules instead of λ-abstractions and decidable higher-order unification. Debugging starts with the observation of a wrong computed answer which the user regards as incorrect w.r.t. an intended model that provides a declarative description of the program’s semantics. Debugging proceeds by exploring an abridged proof tree built on a higher-order rewriting logic with λ-abstractions that provides a purely declarative view of the computation. Finally, debugging ends with the detection of a defined function rule in the program that is incorrect w.r.t. the intended model. We prove the logical correctness of the debugging method for any sound goal solving system whose computed answers are logical consequences of the program.
This work has been partially supported by the Spanish projects TIN2005-09207-C03-03 (MERIT-FORMS), TIN2008-06622-C03-01 (FAST-STAMP), S-0505/TIC/0407 (PROMESAS-CAM), and UCM-BSCH-GR58/08-910502 (GPD-UCM).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Caballero, R., López-Fraguas, F.J., Rodríguez-Artalejo, M.: Theoretical Foundations for the Declarative Debugging of Lazy Functional-Logic Programs. In: Kuchen, H., Ueda, K. (eds.) FLOPS 2001. LNCS, vol. 2024, pp. 170–184. Springer, Heidelberg (2001)
Caballero, R., Rodríguez-Artalejo, M.: \(\mathcal{DDT}\): A Declarative Debugging Tool for Functional-Logic Languages. In: Kameyama, Y., Stuckey, P.J. (eds.) FLOPS 2004. LNCS, vol. 2998, pp. 70–84. Springer, Heidelberg (2004)
López-Fraguas, F.J., Rodríguez-Artalejo, M., del Vado-Vírseda, R.: A New Generic Scheme for Functional-Logic Programming with Constraints. Journal of Higher-Order and Symbolic Computation 20(1/2), 73–122 (2007)
González-Moreno, J.C., Hortalá-González, M.T., Rodríguez-Artalejo, M.: A higher-order rewriting logic for functional-logic programming. In: Proc. ICLP 1997, pp. 153–167 (1997)
González-Moreno, J.C., Hortalá-González, M.T., López-Fraguas, F.J., Rodríguez-Artalejo, M.: An approach to declarative programming based on a rewriting logic. Journal of Logic Programming 40, 47–87 (1999)
Hanus, M.: Curry: an Integrated Functional Logic Language., http://www-i2.informatik.uni-kiel.de/~curry/
Hanus, M., Prehofer, C.: Higher-order narrowing with definitional trees. Journal of Functional Programming 9(1), 33–75 (1999)
Hindley, J.R., Seldin, J.P.: Introduction to Combinatorics and λ-Calculus. Cambridge University Press, Cambridge (1986)
Lloyd, J.W.: Combining functional and logic programming languages. In: Proc. ILPS 1994 (1994)
Lock, H.C.: The Implementation of Functional-Logic Languages. Oldenbourg Verlag (1993)
López-Fraguas, F.J., Sánchez-Hernández, J.: \(\mathcal{TOY}\): A Multiparadigm Declarative System. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999), http://toy.sourceforge.net
Paulson, L.C.: Isabelle: A Generic Theorem Prover. LNCS, vol. 828. Springer, Heidelberg (1994)
Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. TCS 96, 73–155 (1992)
Miller, D.: A logic programming language with λ-abstraction, function variables, and simple unification. Journal of Logic and Computation 1(4), 497–536 (1991)
Nakahara, K., Middeldorp, A., Ida, T.: A complete narrowing calculus for higher-order functional-logic programming. In: Swierstra, S.D. (ed.) PLILP 1995. LNCS, vol. 982, pp. 97–114. Springer, Heidelberg (1995)
Naish, L.: A Declarative Debugging Scheme. Journal of Functional and Logic Programming (1997)
Smolka, G.: The Definition of Kernel Oz. Technical Report DFKI Research Report RR-94-23, Saarbrücken, Germany (1994)
del Vado-Vírseda, R.: A Demand-driven Narrowing Calculus with Overlapping Definitional Trees. In: Proc. PPDP 2003, pp. 253–263. ACM, New York (2003)
del Vado Vírseda, R.: Declarative Constraint Programming with Definitional Trees. In: Gramlich, B. (ed.) FroCos 2005. LNCS (LNAI), vol. 3717, pp. 184–199. Springer, Heidelberg (2005)
del Vado Vírseda, R.: A Higher-Order Demand-Driven Narrowing Calculus with Definitional Trees. In: Jones, C.B., Liu, Z., Woodcock, J. (eds.) ICTAC 2007. LNCS, vol. 4711, pp. 169–184. Springer, Heidelberg (2007)
del Vado-Vírseda, R.: A Higher-Order Logical Framework for the Algorithmic Debugging and Verification of Declarative Programs. In: Proc. PPDP 2009, pp. 49–60. ACM Press, New York (2009)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
del Vado Vírseda, R., Castiñeiras, I. (2010). A Theoretical Framework for the Declarative Debugging of Functional Logic Programs with Lambda Abstractions. In: Escobar, S. (eds) Functional and Constraint Logic Programming. WFLP 2009. Lecture Notes in Computer Science, vol 5979. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11999-6_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-11999-6_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-11998-9
Online ISBN: 978-3-642-11999-6
eBook Packages: Computer ScienceComputer Science (R0)