skip to main content
10.1145/174675.177899acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free Access

A needed narrowing strategy

Authors Info & Claims
Published:01 February 1994Publication History

ABSTRACT

Narrowing is the operational principle of languages that integrate functional and logic programming. We propose a notion of a needed narrowing step that, for inductively sequential rewrite systems, extends the Huet and Le´vy notion of a needed reduction step. We define a strategy, based on this notion, that computes only needed narrowing steps. Our strategy is sound and complete for a large class of rewrite systems, is optimal w.r.t. the cost measure that counts the number of distinct steps of a derivation, computes only independent unifiers, and is efficiently implemented by pattern matching.

References

  1. 1.S. Antoy. Definitional trees. In ALP'92, pages 143- 157. Springer LNCS 632, 1992. Google ScholarGoogle Scholar
  2. 2.S. Antoy. Lazy rewriting in logic programming. Technical Report 90-17, Rev~ 2, Portland State University, Portland, OR, 1992. (Submitted for publication).Google ScholarGoogle Scholar
  3. 3.S. Antoy, R. Echahed, and M. tIanus. A needed narrowing strategy. Technical report, MPI-I-93- 243, Max-Planck-Institut f/Jr Informatik, Saarbriicken, 1993.Google ScholarGoogle Scholar
  4. 4.H. Barendregt, M. van Eekelen, J. Glauert, R. Kenneway, and M. Sleep. Term graph rewriting. In PARLE'87, pages 141-158. Springer LNCS 259, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.M. Bellia and G. Levi. The relation between logic and functional languages: a survey. Journal of Logic Programming, 3(3):217-236, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.D. Bert and R. Echahed. Design and implementation of a generic, logic and functional programming language. In ESOP-86, pages 119-132. Springer LNCS 213, 1986. Google ScholarGoogle Scholar
  7. 7.G. Boudol. Computational semantics of term rewriting systems. In M. Nivat and J. C. Reynolds, editors, Algebrazc methods in semantics, chapter 5. Cambridge University Press, Cambridge, UK, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.P. H. Cheong. Compiling lazy narrowing into Prolog. New Generation Computing, 1992. (to appear).Google ScholarGoogle Scholar
  9. 9.J. Darlington and Y. Guo. Narrowing and unification in functional programming- an evaluation mechanism for absolute set abstraction. In Proc. of the Conference on Rewriting Techniques and Applications, pages 92-108. Springer LNCS 355, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.D. DeGroot and G. Lindstrom, editors. Logic Programming, Functions, Relatzons, and Equations. Prentice Hall, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.N. Dershowitz and J. Jouannaud. Rewrite systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science B: Formal Methods and Semantics, chapter 6, pages 243-320. North Holland, Amsterdam, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.R. Echahed. On completeness of narrowing strategies. In Proc. CAAP'88, pages 89-101. Springer LNCS 299, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.R. Echahed. Uniform narrowing strategies. In Proceedings of the Third International Conference on Algebraic and Logic Programming, pages 259-275, Volterra, Italy, September 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.M. J. Fay. First-order unification in an equational theory, in Proc. 4th Workshop on Automated Deduction, pages 161-167, Austin (Texas), 1979. Academic Press.Google ScholarGoogle Scholar
  15. 15.L. Fribourg. SLOG: A logic programming language interpreter based on clausal superposition and rewriting. In Proc. IEEE Internal. Symposium on Logzc Programming, pages 172-184, Boston, 1985.Google ScholarGoogle Scholar
  16. 16.E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel LEAF: a logic plus functional language. The Journal of Computer and Syslem Sciences, 42:139-185, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.J. A. Goguen and J. Meseguer. Eqlog: Equality, types, and generic modules for logic programming. In D. DeGroot and G. Lindstrom, editors, Logzc Programming, Functzons, Relations, and Equations, pages 295-363. Prentice Hall, 1986.Google ScholarGoogle Scholar
  18. 18.W. Hans, R. Loogen, and S. Winkler. On the interaction of lazy evaluation and backtracking. In Proc. of the 4lh International Symposium on Programming Language Implementation and Logic Programmzng, pages 355-369. Springer LNCS 631, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19.M. Hanus. Compiling logic programs with equality. In Proc. of the 2nd Int. Workshop on Programming Language Implementation and Logic Programmzng, pages 387-401. Springer LNCS 456, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20.A. tterold. Narrowing techniques applied to idempotent unification. Technical Report SR-86-16, SEKI, 1986.Google ScholarGoogle Scholar
  21. 21.C. M. Hoffmann and M. J. O'Donnell. Implementation of an interpreter for abstract equations. In 111h A CM Symposzum on the Pmnciple of Programming Languages, Salt Lake City, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 22.S. HSlldobler. Foundations of Equational Logzc Programming. Springer LNCS 353, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 23.G. Huet and J.-M. Hullot. Proofs by induction in equational theories with constructors. JCSS, 25:239-266, 1982.Google ScholarGoogle ScholarCross RefCross Ref
  24. 24.G. Huet and J.-J. L~vy. Computations in orthogonal term rewrltln8 systems, in J.-L. Lassez and G. Plotkin, editors, Computatzonal log,c: essays ,n honour of Alan Rob,nson. MIT Press, Cambridge, MA, 1991. Previous version: Call by need computations in non-ambiguous linear term rewriting systems, Technical Report 359, INRIA, Le Chesnay, France, 1979.Google ScholarGoogle Scholar
  25. 25.J.-M. Hullot. Canonical forms and unification. In Proc. 5th Conference on Automated Deduclzon, pages 318-334. Springer LNCS 87, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 26.J. A. Jim~nez-Martln, J. Marifio-Carballo, and J. J. Moreno-Navarro. Efficient implementation of lazy narrowing into PROLOG. In LOPSTR'92, 1993. Previous version: Some Techniques for the Efficient Implementation of Lazy Narrowing, Technical Report-FIM.75/LyS/92, Facultad de Informatica, Universidad Politecnica de Madrid, 1992.Google ScholarGoogle Scholar
  27. 27.J. R. Kennaway. Sequential evaluation strategies for parallel-or and related reduction systems. Annals of Pure and Applzed Logic, 43:31-56, 1989.Google ScholarGoogle ScholarCross RefCross Ref
  28. 28.J. R. Kennaway. The specificity rule for lazy pattern-matching in ambiguous term rewrite systems. In Third European Symp. on Programming. pages 256-270, 1990. LNCS 432. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 29.J. W. Klop. Term Rewriting Systems. in S. Abramsky, D. Gabbay, and T. Maibaum, editors, Handbook of Logic in Computer Science, Vol. H, pages 1-112. Oxford University Press, 1992. Previous version: Term rewriting systems, Technical Report CS-R9073, Stichting Mathematisch Centrum, Amsterdam, 1990.Google ScholarGoogle Scholar
  30. 30.J. W. Klop and A. Middeldorp. Sequentiality in orthogonal term rewriting systems. Journal of Symbolic Computatzon, pages 161-195, 1991. Previous version: Technical Report CS-R8932, Stichting Mathematisch Centrum, Amsterdam, The Netherlands, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. 31.S. Krischer and A. Bockmayr. Detecting redundant narrowing derivations by the LSE-SL reducibility test. In Proc. RTA'91. Springer LNCS 488, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 32.R. Loogen, F. Lopez Fraguas, and M. Rodriguez Artalejo. A demand driven computation strategy for lazy narrowing. In Proc. of the 5th International Symposium on Programming Language Implementation and Logic Programmzng, pages 184- 200. Springer LNCS 714, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. 33.L. Maranget. Optimal derivation in weak lambdacalculi and in orthogonal terms rewriting systems. In 171h Annual Syrup. on Pmnczples of Prog. Languagc~, page~ 255-269. ACM, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. 34.A. Middeldorp, August 1993. Personal Communication.Google ScholarGoogle Scholar
  35. 35.A. Middeldorp and E. Hamoen. Counterexamples to completeness results for basic narrowing (extended abstract). In Proceedings of the Third Internatzonal Conference on Algebrazc and Logzc Programming, pages 244-258, Volterra, Italy, September 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 36.J. J. Moreno-Navarro, H. Kuchen, R. Loogen, and M. Rodriguez-Artaiejo. Lazy narrowing in a graph machine. In Proc. Second International Conference on Algebraic and Logic Programmzng, pages 298- 317. Springer LNCS 463, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. 37.J. J. Moreno-Navarro and M. Rodriguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programruing, 12:191-223, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. 38.W. Nutt, P. R~ty, and G. Smolka. Basic narrowing revisited. Journal of Symbolic Computation, 7:295- 317, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. 39.M. J. O'Donneli. Computing in Systems Described by Equations. Springer LNCS 58, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. 40.M. J. O'Donnell. Equational Logic as a Programming Language. MIT Press, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. 41.M. J. Oyamaguchi. Nv-sequentiality: A decidable condition for call-by-need computations in term rewriting systems. SIAM Journal on Computation, 22(1):114-135, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. 42.P. Padawitz. Computzng in Horn Clause Theories, volume 16 of EATCS Monographs on Theoretical Computer Science. Springer, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. 43.G.D. Plotkin. Building-in equational theories. Machine Intelligence, 7:73-90, 1972.Google ScholarGoogle Scholar
  44. 44.U. S. Reddy. Narrowing as the operational semantics of functional languages. In Proc. IEEE Internal. Symposium on Logzc Programming, pages 138-151, Boston, 1985.Google ScholarGoogle Scholar
  45. 45.R. C. Sekar and I. V. Ramakrishnan. Programming in equational logic: Beyond strong sequentiality. In Proceedings of the Fzflh Annual IEEE Symposium on Logic in Computer Science, pages 230-241, Philadelphia, PA, June 1990.Google ScholarGoogle ScholarCross RefCross Ref
  46. 46.J. R. SIagie. Automated theorem-proving for theories with simplifiers, commutativity, and associativity. Journal of the A CM, 21(4):622-642, 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. 47.M. R. Sleep, M. J. Plasmeijer, and M. C. J. D. van Eekelen, editors. Term Graph Rewriting Theory and Practice. J. Wiley & Sons, Chichester, UK, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. 48.S. Thatte. A refinement of strong sequentiality for term rewriting with constructors. Information and Computation, 72:46-65, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. 49.J.-H. You. Enumerating outer narrowing derivations for constructor-based term rewriting systems. Journal of Symbolic Computation, 7:319-341, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A needed narrowing strategy

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            POPL '94: Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
            February 1994
            492 pages
            ISBN:0897916360
            DOI:10.1145/174675

            Copyright © 1994 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 1 February 1994

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            POPL '94 Paper Acceptance Rate39of173submissions,23%Overall Acceptance Rate824of4,130submissions,20%

            Upcoming Conference

            POPL '25

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader