For practical applications, the use of top-down query-driven proof-procedures is essential for an efficient use and computation of answers using Logic Programs as knowledge bases. Additionally, abductive reasoning on demand is intrinsically a top-down search method. A query-solving engine is thus highly desirable.
The current standard 2-valued semantics for Normal Logic Programs (NLPs), the Stable Models (SMs) semantics, does not allow for top-down query-solving because it does not enjoy the relevance property — and moreover, it does not guarantee the existence of a model for every NLP. To overcome these current limitations we introduce here a new 2-valued semantics for NLPs—the Layered Models semantics — which conservatively extends the SMs, enjoys relevance and guarantees model existence among other useful properties. Moreover, for existential query answering there is no need to compute total models, but just the partial models that sustain the answer to the query, or one might simply know a model one exists without producing it; relevance ensures these can be extended to total models.
A first implementation of a query-solving engine based on this new semantics is presented and described here. It uses the XSB-Prolog engine and its XASP interface to Smodels, thereby providing a useful tool built as a hybrid of the two systems and taking advantage of the best of each.
Conclusions and further work end the paper.