Abstract
This paper shows the advantages of amalgamating functional and logic programming languages. In comparison with pure functional languages, an amalgamated functional logic language has more expressive power. In comparison with pure logic languages, functional logic languages have a better control behaviour. The latter will be shown by presenting methods to translate logic programs into a functional logic language with a narrowing/rewriting semantics. The translated programs produce the same set of answers and have at least the same efficiency as the original programs. But in many cases the control behaviour of the translated programs is improved. This requires the addition of further knowledge to the programs. We discuss methods for this and show the gain in efficiency by means of several examples.
Preview
Unable to display preview. Download preview PDF.
References
H. AÏt-Kaci, P. Lincoln, and R. Nasr. Le Fun: Logic, equations, and Functions. In Proc. 4th IEEE Internat. Symposium on Logic Programming, pp. 17–23, San Francisco, 1987.
R. Barbuti, P. Mancarella, D. Pedreschi, and F. Turini. A Transformational Approach to Negation in Logic Programming. Journal of Logic Programming (8), pp. 201–228, 1990.
M. Bellia and G. Levi. The Relation between Logic and Functional Languages: A Survey. Journal of Logic Programming (3), pp. 217–236, 1986.
H. Bertling and H. Ganzinger. Completion-Time Optimization of Rewrite-Time Goal Solving. In Proc. of the Conference on Rewriting Techniques and Applications, pp. 45–58. Springer LNCS 355, 1989.
P.G. Bosco, C. Cecchi, and C. Moiso. An extension of WAM for K-LEAF: a WAM-based compilation of conditional narrowing. In Proc. Sixth International Conference on Logic Programming (Lisboa), pp. 318–333. MIT Press, 1989.
P.G. Bosco, E. Giovannetti, and C. Moiso. Narrowing vs. SLD-Resolution. Theoretical Computer Science 59, pp. 3–23, 1988.
M. Bruynooghe, D. De Schreye, and B. Krekels. Compiling Control. Journal of Logic Programming (6), pp. 135–162, 1989.
M.M.T. Chakravarty and H.C.R. Lock. The Implementation of Lazy Narrowing. In Proc. of the 3rd Int. Symposium on Programming Language Implementation and Logic Programming, pp. 123–134. Springer LNCS 528, 1991.
P.H. Cheong and L. Fribourg. Efficient Integration of Simplification into Prolog. In Proc. of the 3rd Int. Symposium on Programming Language Implementation and Logic Programming, pp. 359–370. Springer LNCS 528, 1991.
S.K. Debray and D.S. Warren. Functional Computations in Logic Programs. ACM Transactions on Programming Languages and Systems, Vol. 11, No. 3, pp. 451–481, 1989.
D. DeGroot and G. Lindstrom, editors. Logic Programming, Functions, Relations, and Equations. Prentice Hall, 1986.
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.
N. Dershowitz and M. Okada. Conditional Equational Programming and the Theory of Conditional Term Rewriting. In Proc. Int. Conf. on Fifth Generation Computer Systems, pp. 337–346, 1988.
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.
L. Fribourg. SLOG: A Logic Programming Language Interpreter Based on Clausal Superposition and Rewriting. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 172–184, Boston, 1985.
H. Ganzinger. A Completion Procedure for Conditional Equations. J. of Symb. Computation, Vol. 11, pp. 51–81, 1991.
E. Giovannetti and C. Moiso. A completeness result for E-unification algorithms based on conditional narrowing. In Proc. Workshop on Foundations of Logic and Functional Programming, pp. 157–167. Springer LNCS 306, 1986.
J.A. Goguen and J. Meseguer. Eqlog: Equality, Types, and Generic Modules for Logic Programming. In D. DeGroot and G. Lindstrom, editors, Logic Programming, Functions, Relations, and Equations, pp. 295–363. Prentice Hall, 1986.
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.
M. Hanus. A Functional and Logic Language with Polymorphic Types. In Proc. Int. Symposium on Design and Implementation of Symbolic Computation Systems, pp. 215–224. Springer LNCS 429, 1990.
M. Hanus. Efficient Implementation of Narrowing and Rewriting. In Proc. Int. Workshop on Processing Declarative Knowledge, pp. 344–365. Springer LNAI 567, 1991.
M. Hanus. Parametric Order-Sorted Types in Logic Programming. In Proc. of the TAPSOFT '91, pp. 181–200. Springer LNCS 494, 1991.
M. Hanus. An Abstract Interpretation Algorithm for Residuating Logic Programs. Technical Report MPI-I-92-217, Max-Planck-Institut für Informatik, Saarbrücken, 1992.
M. Hanus. Incremental Rewriting in Narrowing Derivations. In Proc. of the 3rd International Conference on Algebraic and Logic Programming. Springer LNCS, 1992.
M. Hanus and A. Schwab. ALF User's Manual. FB Informatik, Univ. Dortmund, 1991.
S. Haridi and P. Brand. Andorra Prolog: An Integration of Prolog and Committed Choice Languages. In Proc. Int. Conf. on Fifth Generation Computer Systems, pp. 745–754, 1988.
R. Harper, D.B. MacQueen, and R. Milner. Standard ML. LFCS Report Series ECS-LFCS-86-2, University of Edinburgh, 1986.
S. Hölldobler. Foundations of Equational Logic Programming. Springer LNCS 353, 1989.
J.-M. Hullot. Canonical Forms and Unification. In Proc. 5th Conference on Automated Deduction, pp. 318–334. Springer LNCS 87, 1980.
H. Hussmann. Unification in Conditional-Equational Theories. In Proc. EUROCAL '85, pp. 543–553. Springer LNCS 204, 1985.
J. Jaffar and J.-L. Lassez. Constraint Logic Programming. In Proc. of the 14th ACM Symposium on Principles of Programming Languages, pp. 111–119, Munich, 1987.
J.W. Lloyd. Foundations of Logic Programming. Springer, second, extended edition, 1987.
R. Loogen. From Reduction Machines to Narrowing Machines. In Proc. of the TAP-SOFT '91, pp. 438–457. Springer LNCS 494, 1991.
A. Middeldorp and E. Hamoen. Counterexamples to Completeness Results for Basic Narrowing. In Proc. of the 3rd International Conference on Algebraic and Logic Programming. Springer LNCS, 1992.
A. Mück. Compilation of Narrowing. In Proc. of the 2nd Int. Workshop on Programming Language Implementation and Logic Programming, pp. 16–29. Springer LNCS 456, 1990.
L. Naish. Negation and Control in Prolog. Springer LNCS 238, 1987.
L. Naish. Adding equations to NU-Prolog. In Proc. of the 3rd Int. Symposium on Programming Language Implementation and Logic Programming, pp. 15–26. Springer LNCS 528, 1991.
K. Nakamura. Control of logic program execution based on the functional relation. In Proc. Third International Conference on Logic Programming (London), pp. 505–512. Springer LNCS 225, 1986.
W. Nutt, P. Réty, and G. Smolka. Basic Narrowing Revisited. Journal of Symbolic Computation, Vol. 7, pp. 295–317, 1989.
P. Padawitz. Computing in Horn Clause Theories, volume 16 of EATCS Monographs on Theoretical Computer Science. Springer, 1988.
U.S. Reddy. Transformation of Logic Programs into Functional Programs. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 187–196, Atlantic City, 1984.
U.S. Reddy. Narrowing as the Operational Semantics of Functional Languages. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 138–151, Boston, 1985.
G. Smolka. Logic Programming over Polymorphically Order-Sorted Types. Dissertation, FB Informatik, Univ. Kaiserslautern, 1989.
L. Sterling and E. Shapiro. The Art of Prolog. MIT Press, 1986.
D. Turner. Miranda: A non-strict functional language with polymorphic types. In Conference on Functional Programming Languages and Computer Architecture, Nancy, France, pp. 1–16. Springer LNCS 201, 1985.
K. Verschaetse, D. De Schreye, and M. Bruynooghe. Generation And Compilation of Efficient Computation Rules. In Proc. Seventh International Conference on Logic Programming, pp. 700–714. MIT Press, 1990.
D.H.D. Warren. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Stanford, 1983.
D. Wolz. Design of a Compiler for Lazy Pattern Driven Narrowing. In Recent Trends in Data Type Specification, pp. 362–379. Springer LNCS 534, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hanus, M. (1992). Improving control of logic programs by using functional logic languages. In: Bruynooghe, M., Wirsing, M. (eds) Programming Language Implementation and Logic Programming. PLILP 1992. Lecture Notes in Computer Science, vol 631. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55844-6_124
Download citation
DOI: https://doi.org/10.1007/3-540-55844-6_124
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55844-6
Online ISBN: 978-3-540-47297-1
eBook Packages: Springer Book Archive