Skip to main content

Forward logic evaluation: Compiling a partially evaluated meta-interpreter into the WAM

  • Technical Papers
  • Conference paper
  • First Online:
GWAI-92: Advances in Artificial Intelligence

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 671))

  • 166 Accesses

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)

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. Boley, H. A relational/functional Language and its Compilation into the WAM. SEKI Report SR-90-05, Universität Kaiserslautern, 1990.

    Google Scholar 

  3. Chan, D., Dufresne, P., and Enders, R. Report on PHOCUS. Technical Report TR-LP-21-02, ECRC, Arabellastraße, München, April, 1987.

    Google Scholar 

  4. Cosmadopoulos, Y., Sergot, M., and Southwick,R.W. In PDK'91 — International Workshop on Processing Declarative Knowledge, 1991.

    Google Scholar 

  5. Van Emden and Kowalski, R. The Semantics of Predicate Logic as a Programming Language Journal of the ACM, Vol. 23, No. 4, October 1976.

    Google Scholar 

  6. 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.

    Google Scholar 

  7. Forgy, C.L. Rete: A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem. Artificial Intelligence 19 (1982), pp. 17–37.

    Article  Google Scholar 

  8. Furukawa, K., Fujita, H., and Shintani, T. Deriving an Efficient Production System by Partial Evaluation. In NACLP 89, 1989, pp. 661–671.

    Google Scholar 

  9. Raisonment sur les contraintes en programmation Logique, PhD Thesis, University of Nice, 1989.

    Google Scholar 

  10. van Harmelen, F. On the Efficiency of Meta-level Inference. PhD Thesis, University of Edinburgh, 1989.

    Google Scholar 

  11. Hinkelmann, K. Bidirectional Reasoning of Horn Clause Programs: Transformation and Compilation. Technical Memo TM-91-02, DFKI GmbH, January, 1991.

    Google Scholar 

  12. Hinkelmann, K. Forward Logic Evauation: Developing a Compiler from a Partially Evaluatred Meta-Interpreter. Technical Memo TM-91-13, DFKI GmbH, 1991.

    Google Scholar 

  13. 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.

    Google Scholar 

  14. Lloyd, J.W. Foundations of Logic Programming, Springer-Verlag, Berlin, Heidelberg, New York (1987).

    Google Scholar 

  15. Miranker, D.P. TREAT: A Better Match Algorithm for AI Production Systems. In Proc. of AAAI-87, Philadelphia, PA, 1987, pp. 42–47.

    Google Scholar 

  16. Morris, P. A Forward Chaining Problem Solver. Logic Programming Newsletter 2(Autumn 1981), pp. 6–7.

    Google Scholar 

  17. Naqvi, S.A. and Tsur, S. A Logical Language for Data and Knowledge Bases, W.H. Freeman (1989).

    Google Scholar 

  18. 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.

    Google Scholar 

  19. 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.

    Google Scholar 

  20. Ullman J. Principles of Database and Knowledge Base Systems, Computer Science Press (1989).

    Google Scholar 

  21. Warren, D.H.D. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Menlo Park, CA, October, 1983.

    Google Scholar 

  22. Yamamoto, A. and Tanaka, H. Translating Production Rules into a Forward Reasoning Prolog Program. New Generation Computing 4(1986), pp. 97–105.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Hans Jürgen Ohlbach

Rights and permissions

Reprints 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

Publish with us

Policies and ethics