Abstract
Logic languages can deal with non-deterministic computations via built-in search facilities. However, standard search methods like global backtracking are often not sufficient and a source of many programming errors. Therefore, we propose the addition of a single primitive to logic-oriented languages to control non-deterministic computation steps. Based on this primitive, a number of different search strategies can be easily implemented. These search operators can be applied if the standard search facilities are not successful or to encapsulate search. The latter is important if logic programs interact with the (non-backtrackable) outside world.
We define the search control primitive based on an abstract notion of computation steps so that it can be integrated into various logic-oriented languages, but to provide concrete examples we also present the integration of such a control primitive into the multi-paradigm declarative language Curry. The lazy evaluation strategy of Curry simplifies the implementation of search strategies, which also shows the advantages of integrating functions into logic languages.
This research has been partially supported by the German Research Council (DFG) under grant Ha 2457/1-1.
Preview
Unable to display preview. Download preview PDF.
References
S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. In Proc. 21st ACM Symposium on Principles of Programming Languages, pp. 268–279, Portland, 1994.
M. Hanus. Lazy Narrowing with Simplification. Computer Languages, Vol. 23, No. 2–4, pp. 61–85, 1997.
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.
M. Hanus and F. Steiner. Controlling Search in Declarative Programs. Technical Report, RWTH Aachen, 1998
M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at http://www-i2.informatik.rwth-aachen.de/~hanus/curry, 1998.
P. Hudak, S. Peyton Jones, and P. Wadler. Report on the Programming Language Haskell (Version 1.2). SIGPLAN Notices, Vol. 27, No. 5, 1992.
J. Hughes. Why Functional Programming Matters. In D.A. Turner, editor, Research Topcis in Functional Programming, pp. 17–42. Addison Wesley, 1990.
S. Janson and S. Haridi. Programming Paradigms of the Andorra Kernel Language. In Proc. 1991 International Logic Programming Symposium, pp. 167–183. MIT Press, 1991.
J.W. Lloyd. Foundations of Logic Programming. Springer, second, extended edition, 1987.
R. Loogen, F. Lopez Fraguas, and M. RodrÃguez Artalejo. A Demand Driven Computation Strategy for Lazy Narrowing. In Proc. of the 5th International Symposium on Programming Language Implementation and Logic Programming, pp. 184–200. Springer LNCS 714, 1993.
R. Loogen and S. Winkler. Dynamic Detection of Determinism in Functional Logic Languages. Theoretical Computer Science 142, pp. 59–87, 1995.
G. Nadathur, B. Jayaraman, and K. Kwon. Scoping Constructs in Logic Programming: Implementation Problems and their Solution. Journal of Logic Programming, Vol. 25, No. 2, pp. 119–161, 1995.
G. Nadathur and D. Miller. An overview of λProlog. In Proc. 5th Conference on Logic Programming & 5th Symposium on Logic Programming (Seattle), pages 810–827. MIT Press, 1988.
C. Schulte. Programming Constraint Inference Engines. In Proc. of the Third International Conference on Principles and Practice of Constraint Programming, pp. 519–533. Springer LNCS 1330, 1997.
C. Schulte and G. Smolka. Encapsulated Search for Higher-Order Concurrent Constraint Programming. In Proc. of the 1994 International Logic Programming Symposium, pp. 505–520. MIT Press, 1994.
G. Smolka. The Oz Programming Model. In J. van Leeuwen, editor, Computer Science Today: Recent Trends and Developments, pp. 324–343. Springer LNCS 1000, 1995.
P. Wadler. How to Replace Failure by a List of Successes. In Functional Programming and Computer Architecture. Springer LNCS 201, 1985.
P. Wadler. How to Declare an Imperative. In Proc. of the 1995 International Logic Programming Symposium, pp. 18–32. MIT Press, 1995.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hanus, M., Steiner, F. (1998). Controlling search in declarative programs. In: Palamidessi, C., Glaser, H., Meinke, K. (eds) Principles of Declarative Programming. ALP PLILP 1998 1998. Lecture Notes in Computer Science, vol 1490. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0056627
Download citation
DOI: https://doi.org/10.1007/BFb0056627
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-65012-6
Online ISBN: 978-3-540-49766-0
eBook Packages: Springer Book Archive