Skip to main content

Abstract Diagnosis of Functional Programs

  • Conference paper
  • First Online:
Logic Based Program Synthesis and Transformation (LOPSTR 2002)

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

Abstract

We present a generic scheme for the declarative debugging of functional programs modeled as term rewriting systems. We associate to our programs a semantics based on a (continuous) immediate consequence operator, \( T_\mathcal{R} \), which models the (values/normal forms) semantics of \( \mathcal{R} \) . Then, we develop an effective debugging methodology which is based on abstract interpretation: by approximating the intended specification of the semantics of \( \mathcal{R} \) we derive a finitely terminating bottom-up diagnosis method, which can be used statically. Our debugging framework does not require the user to either provide error symptoms in advance or answer questions concerning program correctness. We have made available a prototypical implementation in Haskell and have tested it on some non trivial examples.

Work partially supported by CICYT TIC2001-2705-C03-01, Acciones Integradas HI2000-0161, HA2001-0059, HU2001-0019, and Generalitat Valenciana GV01-424.

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. M. Alpuente, F. J. Correa, and M. Falaschi. Declarative Debugging of Functional Logic Programs. In B. Gramlich and S. Lucas, editors, Proceedings of the International Workshop on Reduction Strategies in Rewriting and Programming (WRS 2001), volume 57 of Electronic Notes in Theoretical Computer Science, North Holland, 2001. Elsevier Science Publishers.

    Google Scholar 

  2. K. R. Apt. From Logic Programming to PROLOG. Prentice-Hall, 1997.

    Google Scholar 

  3. K. R. Apt and E. Marchiori. Reasoning about PROLOG programs: from Modes through types to assertions. Formal Aspects of Computing, 6(6A):743–765, 1994.

    Article  MATH  Google Scholar 

  4. F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998.

    Google Scholar 

  5. D. Bert and R. Echahed. Abstraction of Conditional Term Rewriting Systems. In J. W. Lloyd, editor, Proceedings of the 1995 Int’l Symposium on Logic Programming (ILPS’95), pages 162–176, Cambridge, Mass., 1995. The MIT Press.

    Google Scholar 

  6. F. Bueno, P. Deransart, W. Drabent, G. Ferrand, M. Hermenegildo, J. Maluszyński, and G. Puebla. On the Role of Semantic Approximations in Validation and Diagnosis of Constraint Logic Programs. In M. Kamkar, editor, Proceedings of the AADEBUG’97 (The Third International Workshop on Automated Debugging), pages 155–169, Linkoping, Sweden, 1997. University of Linkoping Press.

    Google Scholar 

  7. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP’00), 35(9):268–279, 2000.

    Article  Google Scholar 

  8. M. Clavel, F. Durán, S. Eker, and J. Meseguer. Building Equational Proving Tools by Reflection in Rewriting Logic. In K. Futatsugi, A. Nakagawa, and T. Tamai, editors, Cafe: An Industrial-Strength Algebraic Formal Method, pages 1–32. Elsevier, 2000.

    Google Scholar 

  9. M. Comini, G. Levi, M. C. Meo, and G. Vitiello. Proving properties of Logic Programs by Abstract Diagnosis. In M. Dams, editor, Proceedings of Analysis and Verification of Multiple-Agent Languages, 5th LOMAPS Workshop (LOMAPS’96), volume 1192 of Lecture Notes in Computer Science, pages 22–50, Berlin, 1996. Springer-Verlag.

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  11. M. Comini, G. Levi, and G. Vitiello. Declarative Diagnosis Revisited. In J. W. Lloyd, editor, Proceedings of the 1995 Int’l Symposium on Logic Programming (ILPS’95), pages 275–287, Cambridge, Mass., 1995. The MIT Press.

    Google Scholar 

  12. P. Cousot. Constructive Design of a Hierarchy of Semantics of a Transition System by Abstract Interpretation. Theoretical Computer Science, 277(1–2):47–103, 2002.

    Article  MATH  MathSciNet  Google Scholar 

  13. F. Durán. Termination Checker and Knuth-Bendix Completion Tools for Maude Equational Specifications. Technical report, Universidad de Málaga, July 2000.

    Google Scholar 

  14. M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. Declarative Modeling of the Operational Behavior of Logic Languages. Theoretical Computer Science, 69(3):289–318, 1989.

    Article  MATH  MathSciNet  Google Scholar 

  15. M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. A Model-Theoretic Reconstruction of the Operational Semantics of Logic Programs. Information and Computation, 103(1):86–113, 1993.

    Article  MATH  MathSciNet  Google Scholar 

  16. G. Ferrand. Error Diagnosis in Logic Programming, an Adaptation of E. Y. Shapiro’s Method. Journal of Logic Programming, 4(3):177–198, 1987.

    Article  MATH  MathSciNet  Google Scholar 

  17. J. A. Goguen and G. Malcom. Software Engineering with OBJ. Kluwer Academic Publishers, Boston, 2000.

    Google Scholar 

  18. J. W. Klop. Term Rewriting Systems. In S. Abramsky, D. M. Gabbay, and T. S. E. Maibaum, editors, Handbook of Logic in Computer Science, volume I, pages 1–112. Oxford University Press, 1992.

    Google Scholar 

  19. J. W. Lloyd. Declarative error diagnosis. New Generation Computing, 5(2):133–154, 1987.

    MATH  Google Scholar 

  20. M. J. Maher. Equivalences of Logic Programs. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 627–658. Morgan Kaufmann, Los Altos, Ca., 1988.

    Google Scholar 

  21. H. Nilsson. Tracing piece by piece: affordable debugging for lazy functional languages. In Proceedings of the 1999 ACM SIGPLAN Int’l Conf. on Functional Programming, pages 36–47. ACM Press, 1999.

    Google Scholar 

  22. H. Nilsson and P. Fritzson. Algoritmic debugging for lazy functional languages. Journal of Functional Programming, 4(1):337–370, 1994.

    Article  Google Scholar 

  23. J. T. O’Donell and C. V. Hall. Debugging in Applicative Languages. Lisp and Symbolic Computation, 1(2):113–145, 1988.

    Article  Google Scholar 

  24. P. Padawitz. Computing in Horn Clause Theories, volume 16 of EATCS Monographs on Theoretical Computer Science. Springer-Verlag, Berlin, 1988.

    MATH  Google Scholar 

  25. R. Plasmeijer and M. van Eekelen. Functional Programming and Parallel Graph Rewriting. Addison-Wesley, Reading, MA, 1993.

    MATH  Google Scholar 

  26. E. Y. Shapiro. Algorithmic Program Debugging. In Proceedings of Ninth Annual ACM Symp. on Principles of Programming Languages, pages 412–531. ACM Press, 1982.

    Google Scholar 

  27. M.B. Smyth. Power Domains. Journal of Computer and System Sciences, 16:23–36, 1978.

    Article  MATH  MathSciNet  Google Scholar 

  28. J. Sparud and H. Nilsson. The architecture of a debugger for lazy functional languages. In M. Ducassé, editor, Proceedings Second International Workshop on Automated and Algorithmic Debugging, AADEBUG’95, 1995.

    Google Scholar 

  29. H. Tamaki and T. Sato. Unfold/Fold Transformations of Logic Programs. In S. A. Tärnlund, editor, Proceedings of Second Int’l Conf. on Logic Programming, pages 127–139, 1984.

    Google Scholar 

  30. I. Toyn. Exploratory Environments for Functional Programming. PhD thesis, University of York, U.K., 1987.

    Google Scholar 

  31. P. Wadler. Functional Programming: An angry half-dozen. ACM SIGPLAN Notices, 33(2):25–30, 1998.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Alpuente, M., Comini, M., Escobar, S., Falaschi, M., Lucas, S. (2003). Abstract Diagnosis of Functional Programs. In: Leuschel, M. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2002. Lecture Notes in Computer Science, vol 2664. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45013-0_1

Download citation

  • DOI: https://doi.org/10.1007/3-540-45013-0_1

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40438-5

  • Online ISBN: 978-3-540-45013-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics