Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Reporting Failures in Functional Logic Programs

Published: 01 June 2007 Publication History

Abstract

Computing with failures is a typical programming technique in functional logic programs. However, there are also situations where a program should not fail (e.g., in a deterministic top-level computation) but the evaluation fails accidentally, e.g., due to missing pattern combinations in an operation defined by pattern matching. In this case, the programmer is interested in the context of the failed program point in order to analyze the reason of the failure. Therefore, this paper discusses techniques for reporting failures and proposes a new one that has been integrated in a Prolog-based compiler for the declarative multi-paradigm language Curry. Our new technique supports separate compilation of modules, i.e., the compilation of modules has not taken into account whether failures should be reported or not. The failure reporting is only considered in some linking code for modules. In contrast to previous approaches, the execution of programs in the failure reporting mode causes only a small overhead so that it can be also used in larger applications.

References

[1]
Albert, E., Hanus, M., Huch, F., Oliver, J. and Vidal, G., Operational Semantics for Declarative Multi-Paradigm Languages. Journal of Symbolic Computation. v40 i1. 795-829.
[2]
S. Antoy. Non-Determinism and Lazy Evaluation in Logic Programming. In Proc. Int. Workshop on Logic Program Synthesis and Transformation (LOPSTR'91), pp. 318--331. Springer Workshops in Computing, 1991
[3]
Antoy, S., Echahed, R. and Hanus, M., A Needed Narrowing Strategy. Journal of the ACM. v47 i4. 776-822.
[4]
Antoy, S. and Hanus, M., Compiling Multi-Paradigm Declarative Programs into Prolog. In: LNCS, 1794. Springer. pp. 171-185.
[5]
Antoy, S. and Hanus, M., Functional Logic Design Patterns. In: LNCS, 2441. Springer. pp. 67-87.
[6]
Antoy, S., Hanus, M., Liu, J. and Tolmach, A., A Virtual Machine for Functional Logic Computations. In: LNCS, 3474. Springer. pp. 108-125.
[7]
Antoy, S., Hanus, M., Massey, B. and Steiner, F., An Implementation of Narrowing Strategies. In: Proc. of the 3rd International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, ACM Press. pp. 207-217.
[8]
Braßel, B., Chitil, O., Hanus, M. and Huch, F., Observing Functional Logic Computations. In: LNCS, 3057. Springer. pp. 193-208.
[9]
B. Brassel, S. Fischer, and F. Huch. A Program Transformation for Tracing Functional Logic Computations. In Pre-Proceedings of the International Symposium on Logic-based Program Synthesis and Transformation (LOPSTR'06), pp. 141--157. Technical Report CS-2006-5, Università ca' Foscari di Venezia, 2006
[10]
Braßel, B., Hanus, M. and Huch, F., Encapsulating Non-Determinism in Functional Logic Computations. Journal of Functional and Logic Programming. v2004 i6.
[11]
Braßel, B., Hanus, M., Huch, F. and Vidal, G., A Semantics for Tracing Declarative Multi-Paradigm Programs. In: Proceedings of the 6th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, ACM Press. pp. 179-190.
[12]
Braßel, B. and Huch, F., Translating Curry to Haskell. In: Proc. of the ACM SIGPLAN 2005 Workshop on Curry and Functional Logic Programming, ACM Press. pp. 60-65.
[13]
L. Byrd. Understanding the Control Flow of Prolog Programs. In Proc. of the Workshop on Logic Programming, Debrecen, 1980
[14]
Cheong, P.H. and Fribourg, L., Implementation of Narrowing: The Prolog-Based Approach. In: Apt, K.R., de Bakker, J.W., Rutten, J.J.M.M. (Eds.), Logic programming languages: constraints, functions, and objects, MIT Press. pp. 1-20.
[15]
Chitil, O., Runciman, C. and Wallace, M., Freja, Hat and Hood -- A Comparative Evaluation of Three Systems for Tracing and Debugging Lazy Functional Programs. In: LNCS, 2011. Springer. pp. 176-193.
[16]
Gill, A., Debugging Haskell by Observing Intermediate Data Structures. Electr. Notes Theor. Comput. Sci. v41 i1.
[17]
Hanus, M., The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming. v19&20. 583-628.
[18]
Hanus, M., Efficient Translation of Lazy Functional Logic Programs into Prolog. In: LNCS, 1048. Springer. pp. 252-266.
[19]
M. Hanus. A Unified Computation Model for Functional and Logic Programming. In Proc. of the 24th ACM Symposium on Principles of Programming Languages (Paris), pp. 80--93, 1997
[20]
Hanus, M., A Functional Logic Programming Approach to Graphical User Interfaces. In: LNCS, 1753. Springer. pp. 47-62.
[21]
Hanus, M., High-Level Server Side Web Scripting in Curry. In: LNCS, 1990. Springer. pp. 76-92.
[22]
M. Hanus. Adding Constraint Handling Rules to Curry. In Proc. 20th Workshop on Logic Programming (WLP 2006), pp. 81--90. INFSYS Research Report 1843-06-02 (TU Wien), 2006
[23]
Hanus, M., Type-Oriented Construction of Web User Interfaces. In: Proceedings of the 8th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, ACM Press. pp. 27-38.
[24]
http://www.informatik.uni-kiel.de/~pakcs/
[25]
http://www.informatik.uni-kiel.de/~pakcs/
[26]
Hanus, M. and Sadre, R., An Abstract Machine for Curry and its Concurrent Implementation in Java. Journal of Functional and Logic Programming. v1999 i6.
[27]
Hanus, M. and Steiner, F., Controlling Search in Declarative Programs. In: LNCS, 1490. Springer. pp. 374-390.
[28]
M. Hanus (ed.). Curry: An Integrated Functional Logic Language (Vers. 0.8.2). Available at http://www.informatik.uni-kiel.de/~curry, 2006
[29]
J.A. Jiménez-Martin, J. Marino-Carballo, and J.J. Moreno-Navarro. Efficient Compilation of Lazy Narrowing into Prolog. In Proc. Int. Workshop on Logic Program Synthesis and Transformation (LOPSTR'92), pp. 253--270. Springer Workshops in Computing Series, 1992
[30]
Loogen, R., Lopez Fraguas, F. and Rodríguez Artalejo, M., A Demand Driven Computation Strategy for Lazy Narrowing. In: LNCS, 714. Springer. pp. 184-200.
[31]
López-Fraguas, F. and Sánchez-Hernández, J., TOY: A Multiparadigm Declarative System. In: LNCS, 1631. Springer. pp. 244-247.
[32]
Lux, W., Implementing Encapsulated Search for a Lazy Functional Logic Language. In: LNCS, 1722. Springer. pp. 100-113.
[33]
In: Peyton Jones, S. (Ed.), Haskell 98 Language and Libraries---The Revised Report, Cambridge University Press.
[34]
Sterling, L. and Shapiro, E., The Art of Prolog. 1994. 2nd edition. MIT Press, Cambridge, Massachusetts.
[35]
Wadler, P., How to Declare an Imperative. ACM Computing Surveys. v29 i3. 240-263.
[36]
D.H.D. Warren. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Stanford, 1983

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Electronic Notes in Theoretical Computer Science (ENTCS)
Electronic Notes in Theoretical Computer Science (ENTCS)  Volume 177, Issue
June, 2007
275 pages

Publisher

Elsevier Science Publishers B. V.

Netherlands

Publication History

Published: 01 June 2007

Author Tags

  1. Functional logic programming
  2. debugging
  3. implementation

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 0
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media