Abstract
Forward chaining of a logic program is specified by a meta-interpreter written in Prolog. Premises of forward rules are verified by Prolog's backward proof procedure. Since meta-interpreters in general suffer from the overhead of the additional meta-layer, a well-known technique, partial evaluation of the metainterpreter wrt the object-level program, is applied to reduce this overhead. Still several sources of inefficiency can be identified after this transformation. To compile the forward program into the Warren Abstract Machine (WAM) in an efficient way, the WAM is modified by splitting the code area into a backward and forward code area and by adding a new stack to record derived facts. This shows how an efficient implementation of meta-interpreters can have an effect on compilation and even on the design of the target machine.
Supported by BMFT Research Project ARC-TEC (grant ITW 8902 C4)
Preview
Unable to display preview. Download preview PDF.
References
Bancilhon, F. and Ramakrishnan, R. Performance Evaluation of Data Intensive Logic Programs. In Foundations of Deductive Databases and Logic Programming. Morgan Kaufmann Publishers, Minker, J., pp. 441–517, Los Altos, CA, 1988.
Boley, H. A relational/functional Language and its Compilation into the WAM. SEKI Report SR-90-05, Universität Kaiserslautern, 1990.
Chan, D., Dufresne, P., and Enders, R. Report on PHOCUS. Technical Report TR-LP-21-02, ECRC, Arabellastraße, München, April, 1987.
Cosmadopoulos, Y., Sergot, M., and Southwick,R.W. In PDK'91 — International Workshop on Processing Declarative Knowledge, 1991.
Van Emden and Kowalski, R. The Semantics of Predicate Logic as a Programming Language Journal of the ACM, Vol. 23, No. 4, October 1976.
Finin, T., Fritzson, R., and Matuszek, D. Adding Forward Chaining and Truth Maintenance to Prolog. In Artificial Intelligence Applications Conference, IEEE, Miami, March 1989, pp. 123–130.
Forgy, C.L. Rete: A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem. Artificial Intelligence 19 (1982), pp. 17–37.
Furukawa, K., Fujita, H., and Shintani, T. Deriving an Efficient Production System by Partial Evaluation. In NACLP 89, 1989, pp. 661–671.
Raisonment sur les contraintes en programmation Logique, PhD Thesis, University of Nice, 1989.
van Harmelen, F. On the Efficiency of Meta-level Inference. PhD Thesis, University of Edinburgh, 1989.
Hinkelmann, K. Bidirectional Reasoning of Horn Clause Programs: Transformation and Compilation. Technical Memo TM-91-02, DFKI GmbH, January, 1991.
Hinkelmann, K. Forward Logic Evauation: Developing a Compiler from a Partially Evaluatred Meta-Interpreter. Technical Memo TM-91-13, DFKI GmbH, 1991.
Komorowski, H.J. Partial Evaluation as a means for Inferencing Data Structures in an Applicative Language: A Theory and Implementation in the Case of Prolog. In POPL 82, 1982, pp. 255–267.
Lloyd, J.W. Foundations of Logic Programming, Springer-Verlag, Berlin, Heidelberg, New York (1987).
Miranker, D.P. TREAT: A Better Match Algorithm for AI Production Systems. In Proc. of AAAI-87, Philadelphia, PA, 1987, pp. 42–47.
Morris, P. A Forward Chaining Problem Solver. Logic Programming Newsletter 2(Autumn 1981), pp. 6–7.
Naqvi, S.A. and Tsur, S. A Logical Language for Data and Knowledge Bases, W.H. Freeman (1989).
Shintani, T. A Fast Prolog-Based Production System KORE/IE. In Proceedings of the Fifth International Conference and Symposium on Logic Programming, 1988, pp. 26–41.
Tamaki, H. and Sato, T. Unfold/Fold Transformations of Logic Programs. In Proceedings of the Second International Conference on Logic Programming, Uppsala, 1984, pp. 127–138.
Ullman J. Principles of Database and Knowledge Base Systems, Computer Science Press (1989).
Warren, D.H.D. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Menlo Park, CA, October, 1983.
Yamamoto, A. and Tanaka, H. Translating Production Rules into a Forward Reasoning Prolog Program. New Generation Computing 4(1986), pp. 97–105.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hinkelmann, K. (1993). Forward logic evaluation: Compiling a partially evaluated meta-interpreter into the WAM. In: Jürgen Ohlbach, H. (eds) GWAI-92: Advances in Artificial Intelligence. Lecture Notes in Computer Science, vol 671. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0019001
Download citation
DOI: https://doi.org/10.1007/BFb0019001
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-56667-0
Online ISBN: 978-3-540-47626-9
eBook Packages: Springer Book Archive