Skip to main content
Log in

Choosing directions for rules

  • Published:
Journal of Automated Reasoning Aims and scope Submit manuscript

Abstract

In ‘expert systems’ and other applications of logic programming, the issue arises of whether to use rules for forward or backward inference, i.e. whether deduction should be driven by the facts available to the program or the questions that are put to it. Often some mixture of the two is cheaper than using either mode exclusively.

We show that, under two restrictive assumptions, optimal choices of directions for the rules can be made in time polynomial in the number of rules in the system. If we abandon one of these restrictions, the optimal choice is NP-complete. Search methods are presented which allow graceful degradation from polynomial time to exponential time.

The cost estimates on which the optimisation is based are also discussed. The methods used to estimate costs fail when recursion is present in the rules, thus limiting the set of logic programs to which this optimisation can be applied.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Boyer, Robert S., Locking: A Restriction of Resolution, PhD thesis, University of Texas at Austin (1971).

  2. Chang, C. L. and Lee, R. C. T., Symbolic Logic and Mechanical Theorem Proving, Academic Press (1973).

  3. Garey, M. R., and Johnson, D. S., Computers and Intractability. W. H. Freeman, 1979.

  4. Henschen, L. J., and Naqvi, S. A., ‘Compiling queries in recursive first order databases’. Journal of the ACM, 31(1), 47–85 (1984).

    Google Scholar 

  5. Martelli, A., and Montanari, U., ‘An efficient unification algorithm’. ACM Transactions on Programming Languages and Systems, 4(2); 258–282 (1982).

    Google Scholar 

  6. McKay, D. P., and Shapiro, S., ‘Using active connection graphs for reasoning with recursive rules’. In Proceedings of the Seventh International Joint Conference on Artificial Intelligence, pages 368–374, Vancouver (1981).

  7. Naqvi, S. A., and Henschen, L. J., ‘Performing inferences over recursive data bases’. In Proceedings of the First National Conference on Artificial Intelligence, pages 263–265, American Association for Artificial Intelligence (1980).

  8. Nilsson, N. J., Principles of Artificial Intelligence. Tioga, Palo Alto, 1980.

  9. Papadimitriou, Christos, Personal communication (1985).

  10. Pearl, Judea, ‘Knowledge versus search: a quantitative analysis using A*’. Artificial Intelligence, 20(1), 1–14 (1983).

    Google Scholar 

  11. Robinson, J. A., ‘A machine-oriented logic based on the resolution principle’. Journal of the ACM, 12(1), 23–41 (1965).

    Google Scholar 

  12. Roussopoulos, Nicholas, ‘Indexing views in a relational database’. ACM Transactions on Database Systems, 7(2), 258–290 (1982).

    Google Scholar 

  13. Smith, David E., and Genesereth, Michael R., ‘Ordering conjunctive queries’. Artificial Intelligence, 26(2), 171–215 (1985).

    Google Scholar 

  14. Sleator, D., An O(nm log n) Algorithm for Maximal Network Flow. PhD thesis, Stanford University (1980).

  15. Smith, David E., Controlling Inference. PhD thesis, Stanford University (1985).

  16. Treitel, R. J., Sequentialization of Logic Programs. PhD thesis, Stanford University (1986).

  17. Ullman, Jeffrey D., Implementation of Logical Query Languages for Databases. Technical Report STAN-CS-84-1000, Stanford University (1984).

  18. Warren, D. H. D., Implementing Prolog — Compiling Predicate Logic Programs. D.A.I. Research Report 39 and 40, University of Edinburgh (1977).

Download references

Author information

Authors and Affiliations

Authors

Additional information

This work was supported by the Office of Naval Research, the National Institute of Health, and Martin-Marietta under contracts N00014-81-K-0004, NIH 5P41 RR 00785, and GH3-116803

Rights and permissions

Reprints and permissions

About this article

Cite this article

Treitel, R., Genesereth, M.R. Choosing directions for rules. J Autom Reasoning 3, 395–431 (1987). https://doi.org/10.1007/BF00247437

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00247437

Key words

Navigation