# Combining lazy narrowing and simplification

## Abstract

Languages that integrate functional and logic programming styles with a complete operational semantics are based on narrowing. In order to avoid useless computations and to deal with infinite data structures, lazy narrowing strategies have been proposed in the past. This paper presents an important improvement of lazy narrowing by incorporating deterministic simplification steps into lazy narrowing derivations. These simplification steps reduce the search space so that in some cases infinite search spaces are reduced to finite ones. We show that the completeness of lazy narrowing is not destroyed by the simplification process and demonstrate the improved operational behavior by means of several examples.

## Preview

Unable to display preview. Download preview PDF.

## References

- 1.S. Antoy. Definitional Trees. In
*Proc. of the 3rd Int. Conf. on Algebraic and Logic Programming*, pp. 143–157. Springer LNCS 632, 1992.Google Scholar - 2.S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. In
*Proc. 21st ACM Symp. on Principles of Programming Languages*, pp. 268–279, Portland, 1994.Google Scholar - 3.D. Bert and R. Echahed. Design and Implementation of a Generic, Logic and Functional Programming Language. In
*Proc. European Symposium on Programming*, pp. 119–132. Springer LNCS 213, 1986.Google Scholar - 4.M.M.T. Chakravarty and H.C.R. Lock. The Implementation of Lazy Narrowing. In
*Proc. of the 3rd Int. Symp. on Programming Language Implementation and Logic Programming*, pp. 123–134. Springer LNCS 528, 1991.Google Scholar - 5.J. Darlington and Y. Guo. Narrowing and unification in functional programming — an evaluation mechanism for absolute set abstraction. In
*Proc. of the Conf. on Rewriting Techniques and Applications*, pp. 92–108. Springer LNCS 355, 1989.Google Scholar - 6.N. Dershowitz. Termination of Rewriting.
*J. Symbolic Computation*, Vol. 3, pp. 69–116, 1987.Google Scholar - 7.N. Dershowitz and J.-P. Jouannaud. Rewrite Systems. In J. van Leeuwen, editor,
*Handbook of Theoretical Computer Science, Vol. B*, pp. 243–320. Elsevier, 1990.Google Scholar - 8.N. Dershowitz, S. Mitra, and G. Sivakumar. Equation Solving in Conditional AC-Theories. In
*Proc. of the 2nd Int. Conf. on Algebraic and Logic Programming*, pp. 283–297. Springer LNCS 463, 1990.Google Scholar - 9.N. Dershowitz and D.A. Plaisted. Equational Programming. In
*Machine Intelligence 11*, pp. 21–56. Oxford Press, 1988.Google Scholar - 10.R. Echahed. On Completeness of Narrowing Strategies. In
*Proc. CAAP'88*, pp. 89–101. Springer LNCS 299, 1988.Google Scholar - 11.R. Echahed. Uniform Narrowing Strategies. In
*Proc. of the 3rd Int. Conf. on Algebraic and Logic Programming*, pp. 259–275. Springer LNCS 632, 1992.Google Scholar - 12.M.J. Fay. First-Order Unification in an Equational Theory. In
*Proc. 4th Workshop on Automated Deduction*, pp. 161–167, Austin (Texas), 1979. Academic Press.Google Scholar - 13.L. Fribourg. SLOG: A Logic Programming Language Interpreter Based on Clausal Superposition and Rewriting. In
*Proc. IEEE Int. Symp. on Logic Programming*, pp. 172–184, Boston, 1985.Google Scholar - 14.E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel LEAF: A Logic plus Functional Language.
*Journal of Computer and System Sciences*, Vol. 42, No. 2, pp. 139–185, 1991.Google Scholar - 15.W. Hans, R. Loogen, and S. Winkler. On the Interaction of Lazy Evaluation and Backtracking. In
*Proc. of the 4th Int. Symp. on Programming Language Implementation and Logic Programming*, pp. 355–369. Springer LNCS 631, 1992.Google Scholar - 16.M. Hanus. Compiling Logic Programs with Equality. In
*Proc. of the 2nd Int. Workshop on Programming Language Implementation and Logic Programming*, pp. 387–401. Springer LNCS 456, 1990.Google Scholar - 17.M. Hanus. Efficient Implementation of Narrowing and Rewriting. In
*Proc. Int. Workshop on Processing Declarative Knowledge*, pp. 344–365. Springer LNAI 567, 1991.Google Scholar - 18.M. Hanus. Improving Control of Logic Programs by Using Functional Logic Languages. In
*Proc. of the 4th Int. Symp. on Programming Language Implementation and Logic Programming*, pp. 1–23. Springer LNCS 631, 1992.Google Scholar - 19.M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice.
*To appear in Journal of Logic Programming*, 1994. Also available as Technical Report MPI-I-94-201, Max-Planck-Institut für Informatik, Saarbrücken.Google Scholar - 20.M. Hanus. Lazy Unification with Simplification. In
*Proc. 5th European Symposium on Programming*, pp. 272–286. Springer LNCS 788, 1994.Google Scholar - 21.S. Hölldobler.
*Foundations of Equational Logic Programming*. Springer LNCS 353, 1989.Google Scholar - 22.J.-M. Hullot. Canonical Forms and Unification. In
*Proc. 5th Conf. on Automated Deduction*, pp. 318–334. Springer LNCS 87, 1980.Google Scholar - 23.A. Josephson and N. Dershowitz. An Implementation of Narrowing.
*Journal of Logic Programming*(*6*), pp. 57–77, 1989.Google Scholar - 24.R. Loogen. Relating the Implementation Techniques of Functional and Functional Logic Languages.
*New Generation Computing*, Vol. 11, pp. 179–215, 1993.Google Scholar - 25.R. Loogen, F. Lopez Fraguas, and M. Rodríguez Artalejo. A Demand Driven Computation Strategy for Lazy Narrowing. In
*Proc. of the 5th Int. Symp. on Programming Language Implementation and Logic Programming*, pp. 184–200. Springer LNCS 714, 1993.Google Scholar - 26.R. Loogen and S. Winkler. Dynamic Detection of Determinism in Functional Logic Languages. In
*Proc. of the 3rd Int. Symp. on Programming Language Implementation and Logic Programming*, pp. 335–346. Springer LNCS 528, 1991.Google Scholar - 27.J.J. Moreno-Navarro, H. Kuchen, R. Loogen, and M. Rodríguez-Artalejo. Lazy Narrowing in a Graph Machine. In
*Proc. Second Int. Conf. on Algebraic and Logic Programming*, pp. 298–317. Springer LNCS 463, 1990.Google Scholar - 28.J.J. Moreno-Navarro, H. Kuchen, J. Marino-Carballo, S. Winkler, and W. Hans. Efficient Lazy Narrowing Using Demandedness Analysis. In
*Proc. of the 5th Int. Symp. on Programming Language Implementation and Logic Programming*, pp. 167–183. Springer LNCS 714, 1993.Google Scholar - 29.J.J. Moreno-Navarro and M. Rodríguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL.
*Journal of Logic Programming*, Vol. 12, pp. 191–223, 1992.Google Scholar - 30.W. Nutt, P. Réty, and G. Smolka. Basic Narrowing Revisited.
*Journal of Symbolic Computation*, Vol. 7, pp. 295–317, 1989.Google Scholar - 31.P. Padawitz.
*Computing in Horn Clause Theories*, volume 16 of*EATCS Monographs on Theoretical Computer Science*. Springer, 1988.Google Scholar - 32.U.S. Reddy. Narrowing as the Operational Semantics of Functional Languages. In
*Proc. IEEE Int. Symp. on Logic Programming*, pp. 138–151, Boston, 1985.Google Scholar - 33.P. Réty. Improving basic narrowing techniques. In
*Proc. of the Conf. on Rewriting Techniques and Applications*, pp. 228–241. Springer LNCS 256, 1987.Google Scholar - 34.J.R. Slagle. Automated Theorem-Proving for Theories with Simplifiers, Commutativity, and Associativity.
*Journal of the ACM*, Vol. 21, No. 4, pp. 622–642, 1974.Google Scholar