Abstract
We introduce a handful of software design patterns for functional logic languages. Following usual approaches, for each pattern we propose a name and we describe its intent, applicability, structure, consequences, etc. Our patterns deal with data type construction, identifier declarations, mappings, search, non-determinism and other fundamental aspects of the design and implementation of programs. We present some problems and we show fragments of programs that solve these problems using our patterns. The programming language of our examples is Curry. The complete programs are available on-line.
This research has been partially supported by the DAAD/NSF grant INT-9981317, the German Research Council (DFG) grant Ha 2457/1-2 and the NSF grant CCR-0110496.
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
H. Aït-Kaci. An overview of LIFE. In J. Schmidt and A. Stogny, editors, Proc. Workshop on Next Generation Information System Technology, pages 42–58. Springer LNCS 504, 1990. 68, 69
H. Aït-Kaci, P. Lincoln, and R. Nasr. Le Fun: Logic, equations, and functions. In Proc. 4th IEEE Internat. Symposium on Logic Programming, pages 17–23, San Francisco, 1987. 68, 69
S. Antoy. Optimal non-deterministic functional logic computations. In Proc. International Conference on Algebraic and Logic Programming (ALP’97), pages 16–30. Springer LNCS 1298, 1997. 69
S. Antoy, R. Echahed, and M. Hanus. A needed narrowing strategy. Journal of the ACM, 47(4):776–822, 2000. 69, 71
S. Antoy and M. Hanus. Compiling multi-paradigm declarative programs into Prolog. In Proc. International Workshop on Frontiers of Combining Systems (FroCoS’2000), pages 171–185. Springer LNCS 1794, 2000. 74
S. Antoy, M. Hanus, B. Massey, and F. Steiner. An implementation of narrowing strategies. In Proc. of the 3rd International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP 2001), pages 207–217. ACM Press, 2001. 78
K. Beck and W. Cunningham. Using pattern languages for object-oriented programs. In Specification and Design for Object-Oriented Programming (OOPSLA-87), 1987. 67
J. Boye. S-SLD-resolution — an operational semantics for logic programs with external procedures. In Proc. of the 3rd Int. Symposium on Programming Language Implementation and Logic Programming, pages 383–393. Springer LNCS 528, 1991. 69
F. Bueno, D. Cabeza, M. Carro, M. Hermenegildo, P. López-García, and G. Puebla. The Ciao Prolog system. Reference manual. Technical report CLIP3/97.1, School of Computer Science, Technical University of Madrid (UPM), 1997. 68
R. Caballero and F. López-Fraguas. A functional-logic perspective of parsing. In Proc. of the 4th Fuji Int’l Symposium on Functional and Logic Programming, pages 85–99, Tsukuba, Japan, 1999. Springer LNCS 1722. 68
K. Claessen, T. Vullinghs, and E. Meijer. Structuring graphical paradigms in TkGofer. In Proc. of the International Conference on Functional Programming (ICFP’97), pages 251–262. ACM SIGPLAN Notices Vol. 32, No. 8, 1997. 81
J.W. Cooper. Java Design Patterns. Addison Wesley, 2000. 67
M. Erwig. Functional programming with graphs. In 2nd ACM SIGPLAN Int. Conf. on Functional Programming (ICFP’97), pages 52–65, 1997. 81
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley, 1994. 67, 71
J. González-Moreno, M. Hortalá-González, F. López-Fraguas, and M. Rodríguez-Artalejo. An approach to declarative programming based on a rewriting logic. Journal of Logic Programming, 40:47–87, 1999. 69
M. Grand. Patterns in Java. J. Wiley, 1998. 67, 71
M. Hanus. Improving control of logic programs by using functional logic languages. In Proc. of the 4th International Symposium on Programming Language Implementation and Logic Programming, pages 1–23. Springer LNCS 631, 1992. 69
M. Hanus. The integration of functions into logic programming: From theory to practice. Journal of Logic Programming, 19&20:583–628, 1994. 68
M. Hanus. Analysis of residuating logic programs. Journal of Logic Programming, 24(3):161–199, 1995. 69
M. Hanus. Efficient translation of lazy functional logic programs into Prolog. In Proc. Fifth International Workshop on Logic Program Synthesis and Transformation, pages 252–266. Springer LNCS 1048, 1995. 69
M. Hanus. A unified computation model for functional and logic programming. In Proc. of the 24th ACM Symposium on Principles of Programming Languages (Paris), pages 80–93, 1997. 69, 71
M. Hanus. Distributed programming in a multi-paradigm declarative language. In Proc. of the International Conference on Principles and Practice of Declarative Programming (PPDP’99), pages 376–395. Springer LNCS 1702, 1999. 71
M. Hanus. A functional logic programming approach to graphical user interfaces. In International Workshop on Practical Aspects of Declarative Languages (PADL’00), pages 47–62. Springer LNCS 1753, 2000. 71, 79, 81, 82
M. Hanus. High-level server side web scripting in Curry. In Proc. of the Third International Symposium on Practical Aspects of Declarative Languages (PADL’01), pages 76–92. Springer LNCS 1990, 2001. 71, 79, 81, 82
M. Hanus, S. Antoy, K. Höppner, J. Koj, P. Niederau, R. Sadre, and F. Steiner. PAKCS: The Portland Aachen Kiel Curry System. Available at http://www.informatik.uni-kiel.de/~{}pakcs/, 2002. 71
M. Hanus and R. Sadre. An abstract machine for Curry and its concurrent implementation in Java. Journal of Functional and Logic Programming, 1999(6), 1999. 78
M. Hanus and F. Steiner. Controlling search in declarative programs. In Principles of Declarative Programming (Proc. Joint International Symposium PLILP/ALP’98), pages 374–390. Springer LNCS 1490, 1998. 71, 77, 87
M. Hanus (ed.). Curry: An integrated functional logic language (vers. 0.7). Available at http://www.informatik.uni-kiel.de/~curry, 2000. 68, 69, 71
E. Horowitz and S. Sahni. Fundamentals of Computer Algorithms. Computer Science Press, 1978. 77
J. Langr. Essential Java Style: Patterns for Implementation. Prentice Hall, 2000. 71, 72
J. Lloyd. Programming in an integrated functional and logic language. Journal of Functional and Logic Programming, (3):1–49, 1999. 68, 69
F. López-Fraguas and J. Sánchez-Hernández. TOY: A Multiparadigm Declarative System. In Proc. of RTA’ 99, pages 244–247. Springer LNCS 1631, 1999. 68
E. Meijer. Server side web scripting in Haskell. Journal of Functional Programming, 10(1):1–18, 2000. 81
L. Naish. Adding equations to NU-Prolog. In Proc. of the 3rd Int. Symposium on Programming Language Implementation and Logic Programming, pages 15–26. Springer LNCS 528, 1991. 68, 69
S. Peyton Jones and J. Hughes. Haskell 98: A non-strict, purely functional language. http://www.haskell.org, 1999. 69
V. Saraswat. Concurrent Constraint Programming. MIT Press, 1993. 71
C. Schulte and G. Smolka. Encapsulated search for higher-order concurrent constraint programming. In Proc. of the 1994 International Logic Programming Symposium, pages 505–520. MIT Press, 1994. 77
G. Smolka. The Oz programming model. In J. van Leeuwen, editor, Computer Science Today: Recent Trends and Developments, pages 324–343. Springer LNCS 1000, 1995. 68
Z. Somogyi, F. Henderson, and T. Conway. The execution algorithm of Mercury, an efficient purely declarative logic programming language. Journal of Logic Programming, 29(1–3):17–64, 1996. 68
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Antoy, S., Hanus, M. (2002). Functional Logic Design Patterns. In: Hu, Z., Rodríguez-Artalejo, M. (eds) Functional and Logic Programming. FLOPS 2002. Lecture Notes in Computer Science, vol 2441. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45788-7_4
Download citation
DOI: https://doi.org/10.1007/3-540-45788-7_4
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-44233-2
Online ISBN: 978-3-540-45788-6
eBook Packages: Springer Book Archive