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.
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
Albert, E., Hanus, M., Huch, F., Oliver, J., Vidal, G.: Operational Semantics for Declarative Multi-Paradigm Languages. JSC 40(1), 795–829 (2005)
Antoy, S., Echahed, R., Hanus, M.: A Needed Narrowing Strategy. Journal of the ACM 47(4), 776–822 (2000)
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)
Braßel, B., Hanus, M., Huch, F.: Encapsulating Non-Determinism in Functional Logic Computations. Journal of Functional and Logic Programming 6 (2004)
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)
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)
Demoen, B., et al.: Herbrand constraint solving in HAL. In: Proc. of ICLP 1999, pp. 260–274. MIT Press, Cambridge (1999)
Hanus, M.: The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming 19-20, 583–628 (1994)
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)
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)
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)
Hanus, M., Prehofer, C.: Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming 9(1), 33–75 (1999)
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)
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)
Hanus, M. (ed.): Curry: An Integrated Functional Logic Language (Vers. 0.8). (2003), Available at http://www.informatik.uni-kiel.de/~curry
Henderson, F., Somogyi, T., Conway, Z.: Determinism analysis in the Mercury compiler. In: Proc. 19th Australian Computer Science Conference, pp. 337–346 (1996)
Hughes, J.: Why Functional Programming Matters. In: Turner, D.A. (ed.) Research Topics in Functional Programming, pp. 17–42. Addison Wesley, Reading (1990)
Launchbury, J.: A Natural Semantics for Lazy Evaluation. In: Proc. of POPL 1993, pp. 144–154. ACM Press, New York (1993)
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)
Loogen, R., Winkler, S.: Dynamic Detection of Determinism in Functional Logic Languages. Theoretical Computer Science 142, 59–87 (1995)
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)
Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999)
Peyton Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)
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)
Wadler, P.: How to Declare an Imperative. ACM Computing Surveys 29(3), 240–263 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)