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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
S. Antoy: Lazy Evaluation in Logic, Proceedings PLILP’91
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
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.
P.G. Bosco, E. Giovannetti, C. Moiso: Narrowing versus SLD- resolution, Theoretical Computer Science 59, 1988, pp. 3–23.
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
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.
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.
P.H. Cheong: Compiling Lazy Narrowing into Prolog, to appear in: New Generation Computing, 1992.
M. van Emden, K. Yukawa: Logic Programming with Equations, Journal of Logic Programming 4, 1987, pp. 265–288
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].
D. DeGroot, G. Lindstrom (eds.): Logic Programming: Functions, Relations, Equations, Prentice Hall, 1986.
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.
J. Hughes: Why Functional Programming Matters, Technical Report 16, Programming Methodology Group, University of Goteborg, November 1984.
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).
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.
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.
J. Marino-Carballo, J.J. Moreno Navarro, Some notes on lazy evaluation, 1st Compulog-Network Meeting on Programming Languages, Pisa 1992.
MM92b] J. Marino-Carballo, J.J. Moreno-Navarro, Strictness Analysis for Lazy Narrowing, Technical Report, Facultad de Informatica de Madrid, 1992 (to appear).
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.
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.
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.
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.
S. Narain: A technique for doing lazy evaluation in logic, Journal of Logic Programming 3, 1986, pp. 259–276.
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.
U.S. Reddy: Functional Logic Languages, Part I, Workshop on Graph Reduction, LNCS 279, 1987, pp. 401–425.
SY86] P.A. Subrahmanyan, J.H. You: FUNLOG:A Computational Model Integrating Logic and Functional Programming, in [dGL86],pp.l57–198.
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.
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.
D.H.D. Warren: An Abstract PROLOG Instruction Set, Technical Note 309, SRI International, Menlo Park, California, October 1983
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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