Skip to main content

Nondeterminism Analysis of Functional Logic Programs

  • Conference paper
Book cover Logic Programming (ICLP 2005)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3668))

Included in the following conference series:

Abstract

Information about the nondeterminism behavior of a functional logic program is important for various reasons. For instance, a nondeterministic choice in I/O operations results in a run-time error. Thus, it is desirable to ensure at compile time that a given program is not going to crash in this way. Furthermore, knowledge about nondeterminism can be exploited to optimize programs. In particular, if functional logic programs are compiled to target languages without builtin support for nondeterministic computations, the transformation can be much simpler if it is known that the source program is deterministic.

In this paper we present a nondeterminism analysis of functional logic programs in form of a type/effect system. We present a type inferencer to approximate the nondeterminism behavior via nonstandard types and show its correctness w.r.t. the operational semantics of functional logic programs. The type inference is based on a new compact representation of sets of types and effects.

The research described in this paper has been partially supported by the German Research Council (DFG) under grant Ha 2457/5-1.

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. Albert, E., Hanus, M., Huch, F., Oliver, J., Vidal, G.: Operational Semantics for Declarative Multi-Paradigm Languages. JSC 40(1), 795–829 (2005)

    MATH  MathSciNet  Google Scholar 

  2. Antoy, S., Echahed, R., Hanus, M.: A Needed Narrowing Strategy. Journal of the ACM 47(4), 776–822 (2000)

    Article  MathSciNet  Google Scholar 

  3. Antoy, S., Hanus, M.: Functional Logic Design Patterns. In: Hu, Z., Rodríguez-Artalejo, M. (eds.) FLOPS 2002. LNCS, vol. 2441, pp. 67–87. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  4. Braßel, B., Hanus, M., Huch, F.: Encapsulating Non-Determinism in Functional Logic Computations. Journal of Functional and Logic Programming 6 (2004)

    Google Scholar 

  5. Cortesi, A., File, G., Winsborough, W.: Prop revisited: Propositional Formula as Abstract Domain for Groundness Analysis. In: Proc. IEEE Symposium on Logic in Computer Science, pp. 322–327 (1991)

    Google Scholar 

  6. Debray, S.K., Warren, D.S.: Detection and Optimization of Functional Computations in Prolog. In: Proc. Third International Conference on Logic Programming (London). LNCS, vol. 225, pp. 490–504. Springer, Heidelberg (1986)

    Google Scholar 

  7. Demoen, B., et al.: Herbrand constraint solving in HAL. In: Proc. of ICLP 1999, pp. 260–274. MIT Press, Cambridge (1999)

    Google Scholar 

  8. Hanus, M.: The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming 19-20, 583–628 (1994)

    Article  MathSciNet  Google Scholar 

  9. Hanus, M.: A Unified Computation Model for Functional and Logic Programming. In: Proc. 24th ACM Symp. on Principles of Programming Languages, pp. 80–93 (1997)

    Google Scholar 

  10. Hanus, M.: A Functional Logic Programming Approach to Graphical User Interfaces. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, pp. 47–62. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  11. Hanus, M.: High-Level Server Side Web Scripting in Curry. In: Ramakrishnan, I.V. (ed.) PADL 2001. LNCS, vol. 1990, pp. 76–92. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  12. Hanus, M., Prehofer, C.: Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming 9(1), 33–75 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  13. Hanus, M., Steiner, F.: Controlling Search in Declarative Programs. In: Palamidessi, C., Meinke, K., Glaser, H. (eds.) ALP 1998 and PLILP 1998. LNCS, vol. 1490, pp. 374–390. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  14. Hanus, M., Steiner, F.: Type-based Nondeterminism Checking in Functional Logic Programs. In: Proc. of PPDP 2000, pp. 202–213. ACM Press, New York (2000)

    Google Scholar 

  15. Hanus, M. (ed.): Curry: An Integrated Functional Logic Language (Vers. 0.8). (2003), Available at http://www.informatik.uni-kiel.de/~curry

  16. Henderson, F., Somogyi, T., Conway, Z.: Determinism analysis in the Mercury compiler. In: Proc. 19th Australian Computer Science Conference, pp. 337–346 (1996)

    Google Scholar 

  17. Hughes, J.: Why Functional Programming Matters. In: Turner, D.A. (ed.) Research Topics in Functional Programming, pp. 17–42. Addison Wesley, Reading (1990)

    Google Scholar 

  18. Launchbury, J.: A Natural Semantics for Lazy Evaluation. In: Proc. of POPL 1993, pp. 144–154. ACM Press, New York (1993)

    Chapter  Google Scholar 

  19. Liu, F.: Towards lazy evaluation, sharing and non-determinism in resolution based functional logic languages. In: Proc. of FPCA 1993, pp. 201–209. ACM Press, New York (1993)

    Chapter  Google Scholar 

  20. Loogen, R., Winkler, S.: Dynamic Detection of Determinism in Functional Logic Languages. Theoretical Computer Science 142, 59–87 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  21. López-Fraguas, F., Sánchez-Hernández, J.: TOY: A Multiparadigm Declarative System. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  22. Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999)

    MATH  Google Scholar 

  23. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  24. Van Roy, P., Demoen, B., Willems, Y.D.: Improving the execution speed of compiled Prolog with modes, clause selection, and determinism. In: Proc. of the TAPSOFT 1987. LNCS, vol. 250, pp. 111–125. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  25. Wadler, P.: How to Declare an Imperative. ACM Computing Surveys 29(3), 240–263 (1997)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Braßel, B., Hanus, M. (2005). Nondeterminism Analysis of Functional Logic Programs. In: Gabbrielli, M., Gupta, G. (eds) Logic Programming. ICLP 2005. Lecture Notes in Computer Science, vol 3668. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11562931_21

Download citation

  • DOI: https://doi.org/10.1007/11562931_21

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-29208-1

  • Online ISBN: 978-3-540-31947-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics