Recycling Computed Answers in Rewrite Systems for Abduction

Fangzhen Lin, Jia-Huai You

Abstract

In rule-based systems, goal-oriented computations correspond naturally to the possible ways that an observation may be explained. In some applications, we need to compute explanations for a series of observations with the same domain. The question arises as to whether previously computed answers can be recycled. A “yes” answer could result in substantial savings of repeated computations. For systems based on classical logic, the answer is yes. For nonmonotonic systems, however, one tends to believe that the answer should be no, since recycling is a form of adding information. In this article, we show that computed answers can always be recycled, in a nontrivial way, for the class of rewrite procedures proposed earlier by the authors for logic programs with negation. We present some experimental results on an encoding of the logistics domain.

Introduction

Abduction is a fundamental process in rule-based AI used to find explanations for observations. In a logistics context, for instance, if a package is observed at a specific location, abduction identifies the sequence of truck movements or initial states that explain this outcome. While classical logic allows for the safe reuse of proven subgoals, the situation is more complex in nonmonotonic reasoning. In such systems, adding new information can lead to the retraction of previous conclusions, leading many to assume that recycling proofs might be unsound because the validity of a conclusion often depends heavily on its specific context.

This paper investigates whether previously computed answers can be safely and effectively recycled within a specific class of rewrite systems designed for logic programs with negation. The goal is to determine if such a system can remain sound and complete while achieving significant computational efficiency.

Methods: The Goal Rewrite System and Recycling Rule

The authors extend their previously developed Goal Rewrite System, which treats logic queries as formulas iteratively rewritten into simpler forms. This process utilizes three primary rule types: Program Rules, Simplification Rules, and Loop Rules.

Rewrite chains in the Goal Rewrite System

The central innovation is the Recycling Rule (RC). When the system encounters a previously solved literal, it replaces it with a disjunction of its "contexts"—the sets of literals that supported the prior proof. Crucially, only contexts consistent with the current rewrite chain are retained. To ensure completeness, the authors introduce the Loop Rotation lemma, proving that any proof involving a loop can be reoriented such that any literal within it can serve as a starting point.

Experimental Evaluation

The approach was evaluated using a Logistics Domain benchmark, a classic AI planning problem involving truck movements and package locations. The experiments compared a standard rewrite system ("No Recycling" or NR) against the new system ("With Recycling" or WR) across domains with 9 and 10 locations.

Performance comparison between No Recycling (NR) and With Recycling (WR)

The results demonstrate dramatic performance improvements. For the most complex query in the 9-location domain, computation time dropped from over two hours to just 20 seconds. In the 10-location domain, the same query's execution time was reduced from approximately 8 hours to 35 seconds. These gains highlight the power of context-aware recycling in nonmonotonic systems.

Conclusion and Future Work

The research proves that recycling is not only safe but highly beneficial for rewrite-based abductive reasoning. By preserving the context of proofs, the system maintains soundness and completeness under partial stable model semantics. Currently, maximizing efficiency requires manual selection of the order in which subgoals are solved. Future work aims to automate this process by analyzing the dependency structures of logic programs to optimize the computation and recycling of subgoals.

Summary updated

Abstract

In rule-based systems, goal-oriented computations correspond naturally to the possible ways that an observation may be explained. In some applications, we need to compute explanations for a series of observations with the same domain. The question arises as to whether previously computed answers can be recycled. A “yes” answer could result in substantial savings of repeated computations. For systems based on classical logic, the answer is yes. For nonmonotonic systems, however, one tends to believe that the answer should be no , since recycling is a form of adding information. In this article, we show that computed answers can always be recycled, in a nontrivial way, for the class of rewrite procedures proposed earlier by the authors for logic programs with negation. We present some experimental results on an encoding of the logistics domain.
BibTeX
@article{lin2004recycling,
  author = {Fangzhen Lin and Jia-Huai You},
  title = {{Recycling Computed Answers in Rewrite Systems for Abduction}},
  journal = {ACM Trans. Comput. Log.},
  year = {2004},
  doi = {10.1145/1227839.1227841},
}
Figure