Skip to main content

Efficient Compilation of Lazy Narrowing into Prolog

  • Chapter

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

Abstract

The paper presents new techniques for the transformation of lazy narrowing in logic programs. A formalism, called demand patterns, is introduced, and used to define a demand driven strategy to compute lazy narrowing. The strategy is used to produce standard PROLOG code from programs written in a functional-logic language. Our method has a number of advantages over other approaches. While it can compute a larger class of programs, it needs less reevaluation effort, and fully uses efficient elements of PROLOG compilers. The gain of efficiency is shown by presenting the execution times of some example programs.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. S. Antoy: Lazy Evaluation in Logic, Proceedings PLILP’91

    Google Scholar 

  2. Springer Verlag, 1991, LNCS 528, pp. 371–382. [An91b] S. Antoy: Non-Determinism and Lazy Evaluation in Logic Programming, LOPSTR’91. [BL86] M. Bellia, G. Levi: The Relation between Logic and Functional

    Google Scholar 

  3. Languages, Journal of Logic Programming 3, 1986, pp. 217–236. [BGLMP87] G.P. Bosco, E. Giovanetti,G. Levi,C. Moisso, C. Palamidessi: A complete semantic characterization of K-LEAF, A logic language with partial evaluation, Symposium on Logic Programming, S. Francisco, 1987.

    Google Scholar 

  4. P.G. Bosco, E. Giovannetti, C. Moiso: Narrowing versus SLD- resolution, Theoretical Computer Science 59, 1988, pp. 3–23.

    Article  MathSciNet  MATH  Google Scholar 

  5. P.G. Bosco, C. Cecchi, E. Giovannetti, C. Moiso, C. Palamidessi: Using Resolution for a Sound and Efficient Integration of Logic and Functional Programming, in: J. de Bakker (ed.), Languages for parallel architectures: Design, Semantics, Implementation Models, Wiley 1989

    Google Scholar 

  6. P.G. feosco,’ C. Cecchi, C. Moiso: An Extension of WAM for K LEAF: A WAM-based Compilation of Conditional Narrowing, Procs. Int. Conf. on Logic Programming, The MIT Press, 1989, pp. 318–333.

    Google Scholar 

  7. M. Chakravarty, H. Lock: The Implementation of Lazy Narrowing, Symp. on Progr. Language Impl. and Logic Progr (PLILP’91), Springer Verlag, 1991, LNCS 528, pp. 123–134.

    Google Scholar 

  8. P.H. Cheong: Compiling Lazy Narrowing into Prolog, to appear in: New Generation Computing, 1992.

    Google Scholar 

  9. M. van Emden, K. Yukawa: Logic Programming with Equations, Journal of Logic Programming 4, 1987, pp. 265–288

    Article  MathSciNet  MATH  Google Scholar 

  10. GM84] J.A. Goguen, J. Meseguer: EQLOG: Equality, Types and Generic Modules for Logic Programming, Journal of Logic Programming 1(2), 1984, pp. 179–210; also in [dGL86].

    Google Scholar 

  11. D. DeGroot, G. Lindstrom (eds.): Logic Programming: Functions, Relations, Equations, Prentice Hall, 1986.

    Google Scholar 

  12. M. Hanus: Compiling Logic Programs with Equality, Symp. on Progr. Language Impl. and Logic Progr (PLILP’90), Springer Ver-lag, 1990, LNCS 456, pp. 387–401.

    Google Scholar 

  13. J. Hughes: Why Functional Programming Matters, Technical Report 16, Programming Methodology Group, University of Goteborg, November 1984.

    Google Scholar 

  14. JMM92] J.A. Jimenez-Martin, J. Marino-Carballo, J.J. Moreno-Navarro, Efficient Compilation of Lazy Narrowing into PROLOG, Technical Report, Facultad de Informatica de Madrid, 1992 (to appear).

    Google Scholar 

  15. H. Kuchen, R. Loogen, J.J. Moreno Navarro, M. Rodriguez Artalejo: Graph-Based Implementation of a Functional Logic Language, European Symp. on Prog. (ESOP) 1990, LNCS 432, 1990, pp. 271–290.

    Google Scholar 

  16. KLMR91] H. Kuchen, R. Loogen, J.J. Moreno-Navarro, M. Rodriguez- Artalejo: Graph Narrowing to Implement a Functional Language, Technical Report. Facultad de Informatica de Madrid.

    Google Scholar 

  17. J. Marino-Carballo, J.J. Moreno Navarro, Some notes on lazy evaluation, 1st Compulog-Network Meeting on Programming Languages, Pisa 1992.

    Google Scholar 

  18. MM92b] J. Marino-Carballo, J.J. Moreno-Navarro, Strictness Analysis for Lazy Narrowing, Technical Report, Facultad de Informatica de Madrid, 1992 (to appear).

    Google Scholar 

  19. J.J. Moreno N avarro, H. Kuchen, R. Loogen, M. Rodriguez- Artalejo: Lazy Narrowing in a Graph Machine, 2nd Int. Conf. on Algebraic and Logic Programming (ALP), LNCS 456, 1990, pp. 298–317.

    Google Scholar 

  20. J.J. Moreno Navarro, M. Rodriguez-Artalejo: BABEL: A Functional and Logic Programming Language Based on Constructor Discipline and Narrowing, Conf. on Algebraic and Logic Programming (ALP), LNCS 343, 1989, pp. 223–232.

    Google Scholar 

  21. J.J. Moreno Navarro, M.Tiodriguez Artalejo: Logic Programming with Functions and Predicates: The Language BABEL, Journal of Logic Programming, 12, 1992, pp. 189–223.

    Article  Google Scholar 

  22. L. Naish: Adding Equations to NU-Prolog, Symp. on Progr. Language Impl. and Logic Progr (PLILP’91), Springer Verlag, 1991, LNCS 528, pp. 15–26.

    Google Scholar 

  23. S. Narain: A technique for doing lazy evaluation in logic, Journal of Logic Programming 3, 1986, pp. 259–276.

    Article  MathSciNet  MATH  Google Scholar 

  24. U.S. Iteddy: Narrowing as the Operational Semantics of Functional Languages, IEEE Int. Symp. on Logic Progr., IEEE Computer Society Press, 1985, pp. 138–151.

    Google Scholar 

  25. U.S. Reddy: Functional Logic Languages, Part I, Workshop on Graph Reduction, LNCS 279, 1987, pp. 401–425.

    Google Scholar 

  26. SY86] P.A. Subrahmanyan, J.H. You: FUNLOG:A Computational Model Integrating Logic and Functional Programming, in [dGL86],pp.l57–198.

    Google Scholar 

  27. Tu85] D.A. Turner: MIRANDA, a Non-strict Functional Language with Polymorphic Types, Procs. Int. Conf. on Functional Programming Languages and Architectures, Springer Verlag, LNCS 201, 1985, pp. 1–16.

    Google Scholar 

  28. D.H.D. Warren: Higher-order Extensions to PROLOG: Are they Needed?, in J.E. Hayes, D. Mitchie, Y.H. Yao (eds.), Machine Intelligence 10, Ellis Horwood Ltd., John Wiley*Sons, 1982, pp. 441–454.

    Google Scholar 

  29. D.H.D. Warren: An Abstract PROLOG Instruction Set, Technical Note 309, SRI International, Menlo Park, California, October 1983

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1993 Springer-Verlag London

About this chapter

Cite this chapter

Jiménez-Martín, J.A., Mariño-Carballo, J., Moreno-Navarro, J.J. (1993). Efficient Compilation of Lazy Narrowing into Prolog. In: Lau, KK., Clement, T.P. (eds) Logic Program Synthesis and Transformation. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3560-9_18

Download citation

  • DOI: https://doi.org/10.1007/978-1-4471-3560-9_18

  • Publisher Name: Springer, London

  • Print ISBN: 978-3-540-19806-2

  • Online ISBN: 978-1-4471-3560-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics