5,110 research outputs found
Integrating Datalog and Constraint Solving
LP is a common formalism for the field of databases and CSP, both at the
theoretical level and the implementation level in the form of Datalog and CLP.
In the past, close correspondences have been made between both fields at the
theoretical level. Yet correspondence at the implementation level has been much
less explored. In this article we work towards relating them at the
implementation level. Concretely, we show how to derive the efficient Leapfrog
Triejoin execution algorithm of Datalog from a generic CP execution scheme.Comment: Proceedings of the 13th International Colloquium on Implementation of
Constraint LOgic Programming Systems (CICLOPS 2013), Istanbul, Turkey, August
25, 201
Reasoning about modular datatypes with Mendler induction
In functional programming, datatypes a la carte provide a convenient modular
representation of recursive datatypes, based on their initial algebra
semantics. Unfortunately it is highly challenging to implement this technique
in proof assistants that are based on type theory, like Coq. The reason is that
it involves type definitions, such as those of type-level fixpoint operators,
that are not strictly positive. The known work-around of impredicative
encodings is problematic, insofar as it impedes conventional inductive
reasoning. Weak induction principles can be used instead, but they considerably
complicate proofs.
This paper proposes a novel and simpler technique to reason inductively about
impredicative encodings, based on Mendler-style induction. This technique
involves dispensing with dependent induction, ensuring that datatypes can be
lifted to predicates and relying on relational formulations. A case study on
proving subject reduction for structural operational semantics illustrates that
the approach enables modular proofs, and that these proofs are essentially
similar to conventional ones.Comment: In Proceedings FICS 2015, arXiv:1509.0282
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. 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
Religious/secular discourses and practices of good sex
This article focuses on the triangulation of sexuality, religion and secularity in Dutch society by analysing two contemporary case studies. We focus on sexual experiences and practices rather than sexual identities to further understand the constructions of what constitutes 'good' sex. The empirical research is situated in the Netherlands, where the binary of religion and sexual regulation versus secularity and sexual freedom has been dominant in both public and political discourse for a long time. Exploring sexual practices and narratives as central to the constitution of both religious and secular selves, we noted these to be fluctuating, inconsistent and subject to discourses. Our first case study discusses sexual experiences of non-heterosexual Protestant women, whereas the second explores the frequently considered 'neutral' notions of secularity in sexual education. Applying insights from both religious studies and queer studies, we bring the empirical study of sexuality together with the theoretical debates about the conceptualisation of the secular and the religious in contemporary Western Europe.This comparative approach to sexuality not only undermines the culturally presumed exclusive opposition of the secular and the religious but it also provides new empirical contributions for understanding the interactions between sexual practices and sexual discourses
Optimal Union-Find in Constraint Handling Rules
Constraint Handling Rules (CHR) is a committed-choice rule-based language
that was originally intended for writing constraint solvers. In this paper we
show that it is also possible to write the classic union-find algorithm and
variants in CHR. The programs neither compromise in declarativeness nor
efficiency. We study the time complexity of our programs: they match the
almost-linear complexity of the best known imperative implementations. This
fact is illustrated with experimental results.Comment: 12 pages, 3 figures, to appear in Theory and Practice of Logic
Programming (TPLP
Improving Prolog programs: Refactoring for Prolog
Refactoring is an established technique from the object-oriented (OO)
programming community to restructure code: it aims at improving software
readability, maintainability and extensibility. Although refactoring is not
tied to the OO-paradigm in particular, its ideas have not been applied to Logic
Programming until now.
This paper applies the ideas of refactoring to Prolog programs. A catalogue
is presented listing refactorings classified according to scope. Some of the
refactorings have been adapted from the OO-paradigm, while others have been
specifically designed for Prolog. The discrepancy between intended and
operational semantics in Prolog is also addressed by some of the refactorings.
In addition, ViPReSS, a semi-automatic refactoring browser, is discussed and
the experience with applying ViPReSS to a large Prolog legacy system is
reported. The main conclusion is that refactoring is both a viable technique in
Prolog and a rather desirable one.Comment: To appear in Theory and Practice of Logic Programming (TPLP
Tabling as a Library with Delimited Control
Tabling is probably the most widely studied extension of Prolog. But despite
its importance and practicality, tabling is not implemented by most Prolog
systems. Existing approaches require substantial changes to the Prolog engine,
which is an investment out of reach of most systems. To enable more widespread
adoption, we present a new implementation of tabling in under 600 lines of
Prolog code. Our lightweight approach relies on delimited control and provides
reasonable performance.Comment: 15 pages. To appear in Theory and Practice of Logic Programming
(TPLP), Proceedings of ICLP 201
Tabling with Sound Answer Subsumption
Tabling is a powerful resolution mechanism for logic programs that captures
their least fixed point semantics more faithfully than plain Prolog. In many
tabling applications, we are not interested in the set of all answers to a
goal, but only require an aggregation of those answers. Several works have
studied efficient techniques, such as lattice-based answer subsumption and
mode-directed tabling, to do so for various forms of aggregation.
While much attention has been paid to expressivity and efficient
implementation of the different approaches, soundness has not been considered.
This paper shows that the different implementations indeed fail to produce
least fixed points for some programs. As a remedy, we provide a formal
framework that generalises the existing approaches and we establish a soundness
criterion that explains for which programs the approach is sound.
This article is 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, 15 pages,
LaTeX, 0 PDF figure
- …