100,596 research outputs found
Inferring Termination Conditions for Logic Programs using Backwards Analysis
This paper focuses on the inference of modes for which a logic program is
guaranteed to terminate. This generalises traditional termination analysis
where an analyser tries to verify termination for a specified mode. Our
contribution is a methodology in which components of traditional termination
analysis are combined with backwards analysis to obtain an analyser for
termination inference. We identify a condition on the components of the
analyser which guarantees that termination inference will infer all modes which
can be checked to terminate. The application of this methodology to enhance a
traditional termination analyser to perform also termination inference is
demonstrated
Implementing Default and Autoepistemic Logics via the Logic of GK
The logic of knowledge and justified assumptions, also known as logic of
grounded knowledge (GK), was proposed by Lin and Shoham as a general logic for
nonmonotonic reasoning. To date, it has been used to embed in it default logic
(propositional case), autoepistemic logic, Turner's logic of universal
causation, and general logic programming under stable model semantics. Besides
showing the generality of GK as a logic for nonmonotonic reasoning, these
embeddings shed light on the relationships among these other logics. In this
paper, for the first time, we show how the logic of GK can be embedded into
disjunctive logic programming in a polynomial but non-modular translation with
new variables. The result can then be used to compute the extension/expansion
semantics of default logic, autoepistemic logic and Turner's logic of universal
causation by disjunctive ASP solvers such as claspD(-2), DLV, GNT and cmodels.Comment: Proceedings of the 15th International Workshop on Non-Monotonic
Reasoning (NMR 2014
Super Logic Programs
The Autoepistemic Logic of Knowledge and Belief (AELB) is a powerful
nonmonotic formalism introduced by Teodor Przymusinski in 1994. In this paper,
we specialize it to a class of theories called `super logic programs'. We argue
that these programs form a natural generalization of standard logic programs.
In particular, they allow disjunctions and default negation of arbibrary
positive objective formulas.
Our main results are two new and powerful characterizations of the static
semant ics of these programs, one syntactic, and one model-theoretic. The
syntactic fixed point characterization is much simpler than the fixed point
construction of the static semantics for arbitrary AELB theories. The
model-theoretic characterization via Kripke models allows one to construct
finite representations of the inherently infinite static expansions.
Both characterizations can be used as the basis of algorithms for query
answering under the static semantics. We describe a query-answering interpreter
for super programs which we developed based on the model-theoretic
characterization and which is available on the web.Comment: 47 pages, revised version of the paper submitted 10/200
A Refinement Calculus for Logic Programs
Existing refinement calculi provide frameworks for the stepwise development
of imperative programs from specifications. This paper presents a refinement
calculus for deriving logic programs. The calculus contains a wide-spectrum
logic programming language, including executable constructs such as sequential
conjunction, disjunction, and existential quantification, as well as
specification constructs such as general predicates, assumptions and universal
quantification. A declarative semantics is defined for this wide-spectrum
language based on executions. Executions are partial functions from states to
states, where a state is represented as a set of bindings. The semantics is
used to define the meaning of programs and specifications, including parameters
and recursion. To complete the calculus, a notion of correctness-preserving
refinement over programs in the wide-spectrum language is defined and
refinement laws for developing programs are introduced. The refinement calculus
is illustrated using example derivations and prototype tool support is
discussed.Comment: 36 pages, 3 figures. To be published in Theory and Practice of Logic
Programming (TPLP
Automatic Termination Analysis of Programs Containing Arithmetic Predicates
For logic programs with arithmetic predicates, showing termination is not
easy, since the usual order for the integers is not well-founded. A new method,
easily incorporated in the TermiLog system for automatic termination analysis,
is presented for showing termination in this case.
The method consists of the following steps: First, a finite abstract domain
for representing the range of integers is deduced automatically. Based on this
abstraction, abstract interpretation is applied to the program. The result is a
finite number of atoms abstracting answers to queries which are used to extend
the technique of query-mapping pairs. For each query-mapping pair that is
potentially non-terminating, a bounded (integer-valued) termination function is
guessed. If traversing the pair decreases the value of the termination
function, then termination is established. Simple functions often suffice for
each query-mapping pair, and that gives our approach an edge over the classical
approach of using a single termination function for all loops, which must
inevitably be more complicated and harder to guess automatically. It is worth
noting that the termination of McCarthy's 91 function can be shown
automatically using our method.
In summary, the proposed approach is based on combining a finite abstraction
of the integers with the technique of the query-mapping pairs, and is
essentially capable of dividing a termination proof into several cases, such
that a simple termination function suffices for each case. Consequently, the
whole process of proving termination can be done automatically in the framework
of TermiLog and similar systems.Comment: Appeared also in Electronic Notes in Computer Science vol. 3
- …