27 research outputs found
Generating Random Logic Programs Using Constraint Programming
Testing algorithms across a wide range of problem instances is crucial to
ensure the validity of any claim about one algorithm's superiority over
another. However, when it comes to inference algorithms for probabilistic logic
programs, experimental evaluations are limited to only a few programs. Existing
methods to generate random logic programs are limited to propositional programs
and often impose stringent syntactic restrictions. We present a novel approach
to generating random logic programs and random probabilistic logic programs
using constraint programming, introducing a new constraint to control the
independence structure of the underlying probability distribution. We also
provide a combinatorial argument for the correctness of the model, show how the
model scales with parameter values, and use the model to compare probabilistic
inference algorithms across a range of synthetic problems. Our model allows
inference algorithm developers to evaluate and compare the algorithms across a
wide range of instances, providing a detailed picture of their (comparative)
strengths and weaknesses.Comment: This is an extended version of the paper published in CP 202
Lock-free atom garbage collection for multithreaded Prolog
The runtime system of dynamic languages such as Prolog or Lisp and their
derivatives contain a symbol table, in Prolog often called the atom table. A
simple dynamically resizing hash-table used to be an adequate way to implement
this table. As Prolog becomes fashionable for 24x7 server processes we need to
deal with atom garbage collection and concurrent access to the atom table.
Classical lock-based implementations to ensure consistency of the atom table
scale poorly and a stop-the-world approach to implement atom garbage collection
quickly becomes a bottle-neck, making Prolog unsuitable for soft real-time
applications. In this article we describe a novel implementation for the atom
table using lock-free techniques where the atom-table remains accessible even
during atom garbage collection. Relying only on CAS (Compare And Swap) and not
on external libraries, the implementation is straightforward and portable.
Under consideration for acceptance in TPLP.Comment: Paper presented at the 32nd International Conference on Logic
Programming (ICLP 2016), New York City, USA, 16-21 October 2016, 14 pages,
LaTeX, 4 PDF figure
Comparing the Reasoning Capabilities of Equilibrium Theories and Answer Set Programs
[Abstract] Answer Set Programming (ASP) is a well established logical approach in artificial intelligence that is widely used for knowledge representation and problem solving. Equilibrium logic extends answer set semantics to more general classes of programs and theories. When intertheory relations are studied in ASP, or in the more general form of equilibrium logic, they are usually understood in the form of comparisons of the answer sets or equilibrium models of theories or programs. This is the case for strong and uniform equivalence and their relativised and projective versions. However, there are many potential areas of application of ASP for which query answering is relevant and a comparison of programs in terms of what can be inferred from them may be important. We formulate and study some natural equivalence and entailment concepts for programs and theories that are couched in terms of inference and query answering. We show that, for the most part, these new intertheory relations coincide with their model-theoretic counterparts. We also extend some previous results on projective entailment for theories and for the new connective called fork.This research has received partial support from the European Cooperation in Science & Technology (COST) Action CA17124. The third author acknowledges the funding of project PID 2020-116201GB-I00 (Ministerio de Ciencia e Innovación, Spain) and also the financial support supplied by the Consellería de Educación, Universidade e Formación Profesional (accreditations GPC ED431B 2022/23 and 2019–2022 ED431G-2019/01). The last author has been supported by the Austrian Science Fund (FWF) grant Y698Xunta de Galicia; ED431B 2022/23Xunta de Galicia; ED431G-2019/0
Modularity in answer set programs
Answer set programming (ASP) is an approach to rule-based constraint programming allowing flexible knowledge representation in variety of application areas. The declarative nature of ASP is reflected in problem solving. First, a programmer writes down a logic program the answer sets of which correspond to the solutions of the problem. The answer sets of the program are then computed using a special purpose search engine, an ASP solver. The development of efficient ASP solvers has enabled the use of answer set programming in various application domains such as planning, product configuration, computer aided verification, and bioinformatics.
The topic of this thesis is modularity in answer set programming. While modern programming languages typically provide means to exploit modularity in a number of ways to govern the complexity of programs and their development process, relatively little attention has been paid to modularity in ASP. When designing a module architecture for ASP, it is essential to establish full compositionality of the semantics with respect to the module system. A balance is sought between introducing restrictions that guarantee the compositionality of the semantics and enforce a good programming style in ASP, and avoiding restrictions on the module hierarchy for the sake of flexibility of knowledge representation.
To justify a replacement of a module with another, that is, to be able to guarantee that changes made on the level of modules do not alter the semantics of the program when seen as an entity, a notion of equivalence for modules is provided. In close connection with the development of the compositional module architecture, a transformation from verification of equivalence to search for answer sets is developed. The translation-based approach makes it unnecessary to develop a dedicated tool for the equivalence verification task by allowing the direct use of existing ASP solvers.
Translations and transformations between different problems, program classes, and formalisms are another central theme in the thesis. To guarantee efficiency and soundness of the translation-based approach, certain syntactical and semantical properties of transformations are desirable, in terms of translation time, solution correspondence between the original and the transformed problem, and locality/globality of a particular transformation.
In certain cases a more refined notion of minimality than that inherent in ASP can make program encodings more intuitive. Lifschitz' parallel and prioritized circumscription offer a solution in which certain atoms are allowed to vary or to have fixed values while others are falsified as far as possible according to priority classes. In this thesis a linear and faithful transformation embedding parallel and prioritized circumscription into ASP is provided. This enhances the knowledge representation capabilities of answer set programming by allowing the use of existing ASP solvers for computing parallel and prioritized circumscription
Improving PARMA Trailing
Taylor introduced a variable binding scheme for logic variables in his PARMA
system, that uses cycles of bindings rather than the linear chains of bindings
used in the standard WAM representation. Both the HAL and dProlog languages
make use of the PARMA representation in their Herbrand constraint solvers.
Unfortunately, PARMA's trailing scheme is considerably more expensive in both
time and space consumption. The aim of this paper is to present several
techniques that lower the cost.
First, we introduce a trailing analysis for HAL using the classic PARMA
trailing scheme that detects and eliminates unnecessary trailings. The
analysis, whose accuracy comes from HAL's determinism and mode declarations,
has been integrated in the HAL compiler and is shown to produce space
improvements as well as speed improvements. Second, we explain how to modify
the classic PARMA trailing scheme to halve its trailing cost. This technique is
illustrated and evaluated both in the context of dProlog and HAL. Finally, we
explain the modifications needed by the trailing analysis in order to be
combined with our modified PARMA trailing scheme. Empirical evidence shows that
the combination is more effective than any of the techniques when used in
isolation.
To appear in Theory and Practice of Logic Programming.Comment: 36 pages, 7 figures, 8 table
Epistemic Foundation of Stable Model Semantics
Stable model semantics has become a very popular approach for the management
of negation in logic programming. This approach relies mainly on the closed
world assumption to complete the available knowledge and its formulation has
its basis in the so-called Gelfond-Lifschitz transformation.
The primary goal of this work is to present an alternative and
epistemic-based characterization of stable model semantics, to the
Gelfond-Lifschitz transformation. In particular, we show that stable model
semantics can be defined entirely as an extension of the Kripke-Kleene
semantics. Indeed, we show that the closed world assumption can be seen as an
additional source of `falsehood' to be added cumulatively to the Kripke-Kleene
semantics. Our approach is purely algebraic and can abstract from the
particular formalism of choice as it is based on monotone operators (under the
knowledge order) over bilattices only.Comment: 41 pages. To appear in Theory and Practice of Logic Programming
(TPLP
Declarative Programming with Intensional Sets in Java Using JSetL
Intensional sets are sets given by a property rather than by enumerating
their elements. In previous work, we have proposed a decision procedure for a
first-order logic language which provides Restricted Intensional Sets (RIS),
i.e., a sub-class of intensional sets that are guaranteed to denote
finite---though unbounded---sets. In this paper we show how RIS can be
exploited as a convenient programming tool also in a conventional setting,
namely, the imperative O-O language Java. We do this by considering a Java
library, called JSetL, that integrates the notions of logical variable, (set)
unification and constraints that are typical of constraint logic programming
languages into the Java language. We show how JSetL is naturally extended to
accommodate for RIS and RIS constraints, and how this extension can be
exploited, on the one hand, to support a more declarative style of programming
and, on the other hand, to effectively enhance the expressive power of the
constraint language provided by the library