1,298 research outputs found
SLT-Resolution for the Well-Founded Semantics
Global SLS-resolution and SLG-resolution are two representative mechanisms
for top-down evaluation of the well-founded semantics of general logic
programs. Global SLS-resolution is linear for query evaluation but suffers from
infinite loops and redundant computations. In contrast, SLG-resolution resolves
infinite loops and redundant computations by means of tabling, but it is not
linear. The principal disadvantage of a non-linear approach is that it cannot
be implemented using a simple, efficient stack-based memory structure nor can
it be easily extended to handle some strictly sequential operators such as cuts
in Prolog.
In this paper, we present a linear tabling method, called SLT-resolution, for
top-down evaluation of the well-founded semantics. SLT-resolution is a
substantial extension of SLDNF-resolution with tabling. Its main features
include: (1) It resolves infinite loops and redundant computations while
preserving the linearity. (2) It is terminating, and sound and complete w.r.t.
the well-founded semantics for programs with the bounded-term-size property
with non-floundering queries. Its time complexity is comparable with
SLG-resolution and polynomial for function-free logic programs. (3) Because of
its linearity for query evaluation, SLT-resolution bridges the gap between the
well-founded semantics and standard Prolog implementation techniques. It can be
implemented by an extension to any existing Prolog abstract machines such as
WAM or ATOAM.Comment: Slight modificatio
Linear Tabulated Resolution Based on Prolog Control Strategy
Infinite loops and redundant computations are long recognized open problems
in Prolog. Two ways have been explored to resolve these problems: loop checking
and tabling. Loop checking can cut infinite loops, but it cannot be both sound
and complete even for function-free logic programs. Tabling seems to be an
effective way to resolve infinite loops and redundant computations. However,
existing tabulated resolutions, such as OLDT-resolution, SLG- resolution, and
Tabulated SLS-resolution, are non-linear because they rely on the
solution-lookup mode in formulating tabling. The principal disadvantage of
non-linear resolutions is that they cannot be implemented using a simple
stack-based memory structure like that in Prolog. Moreover, some strictly
sequential operators such as cuts may not be handled as easily as in Prolog.
In this paper, we propose a hybrid method to resolve infinite loops and
redundant computations. We combine the ideas of loop checking and tabling to
establish a linear tabulated resolution called TP-resolution. TP-resolution has
two distinctive features: (1) It makes linear tabulated derivations in the same
way as Prolog except that infinite loops are broken and redundant computations
are reduced. It handles cuts as effectively as Prolog. (2) It is sound and
complete for positive logic programs with the bounded-term-size property. The
underlying algorithm can be implemented by an extension to any existing Prolog
abstract machines such as WAM or ATOAM.Comment: To appear as the first accepted paper in Theory and Practice of Logic
Programming (http://www.cwi.nl/projects/alp/TPLP
Recommended from our members
Efficient recursion termination for function-free horn logic
We present an efficient scheme to terminate infinite recursion in function-free Horn logic. In [BW84], Brough and Walker show that a preorder linear resolution with a goal termination strategy is incomplete, i.e. it must miss some answers. Their theory is true if left-recursion is allowed. The crucial assumption underlying Brough and Walker's theory is that the order of literals in a clause should not be altered. This assumption, however, is not necessary in programs that do not contain any extra-logical features such as the 'cut' symbol of Prolog. This is because the order of literals does not affect the correctness of such programs, only their efficiency. In this paper, we show that left-recursion can always be eliminated. The idea is to transform loops of the input set into safe loops, that are left-recursion free. Consequently, the goal termination strategy guarantees to always terminate properly with all possible answers; thus, it is complete in the domain of safe loops. We further show that all rules in a safe loop can be transformed into rules that begin with a base literal. This permits the implementation of a simple scheme to carry out the goal termination strategy more efficiently. The basic idea of this scheme is to distribute the history containing all executed goals over assertions, rather than maintaining it as a centralized data structure. This reduces the amount of work performed during execution
Loop elimination, a sound optimisation technique for PTTP related theorem proving
In this paper we present loop elimination, an important optimisation technique for first-order theorem proving based on Prolog technology, such as the Prolog Technology Theorem Prover or the DLog Description Logic Reasoner. Although several loop checking techniques exist for logic programs, to the best of our knowledge, we are the first to examine the interaction of loop checking with ancestor resolution. Our main contribution is a rigorous proof of the soundness of loop elimination
TOR: modular search with hookable disjunction
Horn Clause Programs have a natural exhaustive depth-first procedural
semantics. However, for many programs this semantics is
ineffective. In order to compute useful solutions, one needs the
ability to modify the search method that explores the alternative
execution branches.
Tor, a well-defined hook into Prolog disjunction, provides this ability.
It is light-weight thanks to its library approach and efficient
because it is based on program transformation.
Tor is general enough to mimic search-modifying
predicates like ECLiPSe's search/6. Moreover, Tor supports
modular composition of search methods and other hooks.
The Tor library is already
provided and used as an add-on to SWI-Prolog.publisher: Elsevier
articletitle: Tor: Modular search with hookable disjunction
journaltitle: Science of Computer Programming
articlelink: http://dx.doi.org/10.1016/j.scico.2013.05.008
content_type: article
copyright: Copyright © 2013 Elsevier B.V. All rights reserved.status: publishe
Automated Termination Analysis for Logic Programs with Cut
Termination is an important and well-studied property for logic programs.
However, almost all approaches for automated termination analysis focus on
definite logic programs, whereas real-world Prolog programs typically use the
cut operator. We introduce a novel pre-processing method which automatically
transforms Prolog programs into logic programs without cuts, where termination
of the cut-free program implies termination of the original program. Hence
after this pre-processing, any technique for proving termination of definite
logic programs can be applied. We implemented this pre-processing in our
termination prover AProVE and evaluated it successfully with extensive
experiments
Analyzing Catastrophic Backtracking Behavior in Practical Regular Expression Matching
We develop a formal perspective on how regular expression matching works in
Java, a popular representative of the category of regex-directed matching
engines. In particular, we define an automata model which captures all the
aspects needed to study such matching engines in a formal way. Based on this,
we propose two types of static analysis, which take a regular expression and
tell whether there exists a family of strings which makes Java-style matching
run in exponential time.Comment: In Proceedings AFL 2014, arXiv:1405.527
- …