Abstract
We present an efficient implementation method for a language that amalgamates functional and logic programming styles. The operational semantics of the language consists of resolution to solve predicates and narrowing and rewriting to evaluate functional expressions. The implementation is based on an extension of the Warren Abstract Machine (WAM). This extension causes no overhead for pure logic programs and allows the execution of functional programs by narrowing and rewriting with the same efficiency as their relational equivalents. Moreover, there are many cases where functional programs are more efficiently executed than their relational equivalents.
on leave from Fachbereich Informatik, Universität Dortmund, W-4600 Dortmund 50
Preview
Unable to display preview. Download preview PDF.
References
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. Refined strategies for semantic unification. In Proc. of the TAPSOFT '81, pp. 276–290. Springer LNCS 250, 1987.
M. Bruynooghe, D. De Schreye, and B. Krekels. Compiling Control. Journal of Logic Programming (6), pp. 135–162, 1989.
W.F. Clocksin and C.S. Mellish. Programming in Prolog. Springer, third rev. and ext. edition, 1987.
D. DeGroot and G. Lindstrom, editors. Logic Programming, Functions, Relations, and Equations. Prentice Hall, 1986.
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.
A. Geser and H. Hussmann. Experiences with the RAP system — a specification interpreter combining term rewriting and resolution. In Proc. of ESOP 86, pp. 339–350. Springer LNCS 213, 1986.
M. Hanus. Formal Specification of a Prolog Compiler. In Proc. of the Workshop on Programming Language Implementation and Logic Programming, pp. 273–282, Orléans, 1988. Springer LNCS 348.
M. Hanus. Polymorphic Higher-Order Programming in Prolog. In Proc. Sixth International Conference on Logic Programming (Lisboa), pp. 382–397. MIT Press, 1989.
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. A Declarative Approach to Improve Control in Logic Programming. Univ. Dortmund, 1991.
M. Hanus and A. Schwab. ALF User's Manual. FB Informatik, Univ. Dortmund, 1991.
M. Hanus and A. Schwab. The Implementation of the Functional-Logic Language ALF. 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.
T. Heuillard. Compiling conditional rewriting systems. In Proc. 1st Int. Workshop on Conditional Term Rewriting Systems, pp. 111–128. Springer LNCS 308, 1987.
S. Hölldobler. From Paramodulation to Narrowing. In Proc. 5th Conference on Logic Programming 363-01 5th Symposium on Logic Programming (Seattle), pp. 327–342, 1988.
M. Huber and I. Varsek. Extended Prolog with Order-Sorted Resolution. In Proc. 4th IEEE Internat. Symposium on Logic Programming, pp. 34–43, San Francisco, 1987.
J.-M. Hullot. Canonical Forms and Unification. In Proc. 5th Conference on Automated Deduction, pp. 318–334. Springer LNCS 87, 1980.
A. Josephson and N. Dershowitz. An Implementation of Narrowing. Journal of Logic Programming (6), pp. 57–77, 1989.
C. Kirchner, H. Kirchner, and J. Meseguer. Operational Semantics of OBJ3 (Extended Abstract). In Proc. of the 15th ICALP, pp. 287–301. Springer LNCS 317, 1988.
H. Kuchen, R. Loogen, J.J. Moreno-Navarro, and M. Rodríguez-Artalejo. Graphbased Implementation of a Functional Logic Language. In Proc. ESOP 90, pp. 271–290. Springer LNCS 432, 1990.
J.W. Lloyd. Foundations of Logic Programming. Springer, second, extended edition, 1987.
R. Loogen. From Reduction Machines to Narrowing Machines. In Proc. of the TAPSOFT '91, pp. 438–457. Springer LNCS 494, 1991.
J.J. Moreno-Navarro, H. Kuchen, R. Loogen, and M. Rodríguez-Artalejo. Lazy Narrowing in a Graph Machine. In Proc. Second International Conference on Algebraic and Logic Programming, pp. 298–317. Springer LNCS 463, 1990.
J.J. Moreno-Navarro and M. Rodríguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Technical Report DIA/89/3, Universidad Complutense, Madrid, 1989.
L. Naish. Negation and Control in Prolog. Springer LNCS 238, 1987.
W. Nutt, P. Rety, and G. Smolka. Basic Narrowing Revisited. SEKI Report SR-87-07, FB Informatik, Univ. Kaiserslautern, 1987.
P. Padawitz. Computing in Horn Clause Theories, volume 16 of EATCS Monographs on Theoretical Computer Science. Springer, 1988.
L. Sterling and E. Shapiro. The Art of Prolog. MIT Press, 1986.
D.H.D. Warren. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Stanford, 1983.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hanus, M. (1991). Efficient implementation of narrowing and rewriting. In: Boley, H., Richter, M.M. (eds) Processing Declarative Knowledge. PDK 1991. Lecture Notes in Computer Science, vol 567. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0013543
Download citation
DOI: https://doi.org/10.1007/BFb0013543
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55033-4
Online ISBN: 978-3-540-46667-3
eBook Packages: Springer Book Archive