ABSTRACT
Curry is a functional-logic language provided with a lazy evaluation strategy. This lazy behaviour is achieved, in part, by using a formalism called definitional trees. These trees provide an optimal order for reducing (to some degree) the actual parameters of functions, taking into account the shape of patterns in the left hand sides of their definition. The integration of more and more features of Constraint Programming into Curry should be as orthogonal as possible to existing features. For instance, having a function defined over several cases specified in terms of different constraints should be allowed, in the same way as pattern matching in the functional style is supported. However, this kind of definitions has not been allowed so far, and this is partly due to the absence of an analogue of definitional trees for sets of constraints. This paper reports a first proposal in this direction. A common framework for dealing with lazy pattern matching and constraint handling is presented, in the form of flat guards that can be used to obtain demand information in the same way that data patterns in the rules' left hand sides are currently used. Constraint definitional trees are introduced along with the algorithms needed for its generation from a given function definition. Traditional definitional trees are shown to be an instance of the constraint framework for constraints over algebraic data types. Due to their practical relevance, the case of constraints over numerical (non-algebraic) domains is devoted an specific treatment.
- Sergio Antoy, Rachid Echahed, and Michael Hanus. A needed narrowing strategy. In Proc. 21st. ACM Symposium on Principles of Programming Languages, pages 268--279, Portland, Oregon, 1994. ACM Press.]] Google ScholarDigital Library
- Puri Arenas Sánchez, Ana Gil Luezas, and Francisco López Fraguas. Combining lazy narrowing with disequality constraints. In Hermenegildo and Penjam, editors, Programming Language Implementation and Logic Programming, PLILP94, number 844 in LNCS, pages 385--399. Springer, 1994.]] Google ScholarDigital Library
- M. Hanus (ed.), H. Kuchen, and J.J. Moreno-Navarro et al. Curry: An integrated functional logic language. Technical report, RWTH Aachen, 2000.]]Google Scholar
- Michael Hanus. The integration of functions into logic programming: from theory to practice. Journal of Logic Programming, 19 & 20:583--628, 1994.]]Google ScholarCross Ref
- Michael Hanus, Sergio Antoy, Herbert Kuchen, Francisco J. López-Fraguas, Wolfgang Lux, Juan José Moreno-Navarro, and Frank Steiner. Curry: An Integrated Functional Logic Language, 0.8 edition, April 2003. Editor: Michael Hanus.]]Google Scholar
- M. Hermenegildo, F. Bueno, M. García de la Banda, and G. Puebla. The CIAO multi-dialect compiler and system: An experimentation workbench for future (C)LP systems. In Proceedings of the ILPS'95 Workshop on Visions for the Future of Logic Programming, Portland, Oregon, USA, december 1995. Available from http://www.clip.dia.fi.upm.es/_.]]Google Scholar
- Joxan Jaffar and Michael J. Maher. Constraint logic programming: A survey. Journal of Logic Programming, 19/20:503--581, 1994.]]Google ScholarCross Ref
- Wolfgang Lux. Adding linear constraints over real numbers to curry. In K. Ueda H. Kuchen, editor, Proc. FLOPS 2001, number 2024 in LNCS, pages 185--200. Springer-Verlag, March 2001.]] Google ScholarDigital Library
- Francisco López Fraguas, Mario Rodríguez Artalejo, and R. del Vado Virseda. A lazy narrowing calculus for declarative constraint programming. In Principles and Practice of Declarative Programming, PPDP2004, pages 43--54. ACM, 2004.]] Google ScholarDigital Library
- Francisco López Fraguas and Jaime Sánchez Hernández. TOY: A multiparadigm declarative system. In Narendran and Rusinowitz, editors, Rewriting Techniques and Applications, RTA1999, number 1631 in LNCS, pages 244--247. Springer, 1999.]] Google ScholarDigital Library
- Francisco Javier López Fraguas. A general scheme for constraint functional logic programming. In Algebraic and Logic Programming, LNCS. Springer Verlag, 1992.]] Google ScholarDigital Library
- Julio Mariño and José~María Rey. The implementation of Curry via its translation into Prolog. In Kuchen, editor, 7th Workshop on Functional and Logic Programming (WFLP98), number 63 in Working Papers. Westfälische Wilhelms-Universität Münster, 1998.]]Google Scholar
- Juan José Moreno-Navarro. Expressivity of functional logic languages and their implementation. In R. Barbuti M. Alpuente, editor, Joint Conference on Declarative Programming GULP-PRODE'94. GULP (Italian ALP Chapter), Universidad Politécnica Valencia, Servicio de publicaciones Universidad Politécnica de Valencia, september 1994.]]Google Scholar
Index Terms
- Adding constraints to curry via flat guards
Recommendations
A Proposal for Disequality Constraints in Curry
We describe the introduction of disequality constraints over algebraic data terms in the functional logic language Curry, and their implementation in Sloth, our Curry compiler. This addition extends the standard definition of Curry in several ways. On ...
A theory of overloading
We present a minimal extension of the Hindley/Milner system to allow for overloading of identifiers. Our approach relies on a combination of the HM(X) type system framework with Constraint Handling Rules (CHRs). CHRs are a declarative language for ...
A theory of overloading
We present a novel approach to allow for overloading of identifiers in the spirit of type classes. Our approach relies on a combination of the HM(X) type system framework with Constraint Handling Rules (CHRs). CHRs are a declarative language for writing ...
Comments