197 research outputs found
Delimited continuations for Prolog
Delimited continuations are a famous control primitive that originates in the functional programming world. It allows the programmer to suspend and capture the remaining part of a computation in order to resume it later. We put a new Prolog-compatible face on this primitive and specify its semantics by means of a meta-interpreter. Moreover, we establish the power of delimited continuations in Prolog with several example definitions of high-level language features. Finally, we show how to easily and effectively add delimited continuations support to the WAM
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
The Functional Perspective on Advanced Logic Programming
The basics of logic programming, as embodied by Prolog, are generally well-known in the programming language community. However, more advanced techniques, such as tabling, answer subsumption and probabilistic logic programming fail to attract the attention of a larger audience. The cause for the community\u27s seemingly limited interest lies with the presentation of these features: the literature frequently focuses on implementations and examples that do little to aid the understanding of non-experts in the field. The key point is that many of these advanced logic programming features can be characterised in more generally known, more accessible terms. In my research I try to reconcile these advanced concepts from logic programming (Tabling, Answer subsumption and probabilistic programming) with concepts from functional programming (effects, monads and applicative functors)
Disjunctive Delimited Control
Delimited control is a powerful mechanism for programming language extension
which has been recently proposed for Prolog (and implemented in SWI-Prolog). By
manipulating the control flow of a program from inside the language, it enables
the implementation of powerful features, such as tabling, without modifying the
internals of the Prolog engine. However, its current formulation is inadequate:
it does not capture Prolog's unique non-deterministic nature which allows
multiple ways to satisfy a goal. This paper fully embraces Prolog's
non-determinism with a novel interface for disjunctive delimited control, which
gives the programmer not only control over the sequential (conjunctive) control
flow, but also over the non-deterministic control flow. We provide a
meta-interpreter that conservatively extends Prolog with delimited control and
show that it enables a range of typical Prolog features and extensions, now at
the library level: findall, cut, branch-and-bound optimisation, probabilistic
programming, . . .Comment: New version of paper is available at: arXiv:2108.0297
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
Suppl: A Flexible Language for Policies
Abstract. We present the Simple Unified Policy Programming Lan-guage (Suppl), a domain-neutral language for stating, executing, and analyzing event-condition-action policies. Suppl uses a novel combina-tion of pure logic programming and disciplined imperative programming features to make it easy for non-expert users to express common policy idioms. The language is strongly typed and moded to allow static detec-tion of common programming errors, and it supports a novel logic-based static analysis that can detect internally inconsistent policies. Suppl has been implemented as a compiler to Prolog and used to build several network security applications in a Java framework.
Tagungsband zum 21. Kolloquium Programmiersprachen und Grundlagen der Programmierung
Das 21. Kolloquium Programmiersprachen und Grundlagen der Programmierung (KPS 2021) setzt eine traditionelle Reihe von Arbeitstagungen fort, die 1980 von den Forschungsgruppen der Professoren Friedrich L. Bauer (TU München), Klaus Indermark (RWTH Aachen) und Hans Langmaack(CAU Kiel) ins Leben gerufen wurde.Die Veranstaltung ist ein offenes Forum für alle interessierten deutschsprachigen Wissenschaftlerinnen und Wissenschaftler zum zwanglosen Austausch neuer Ideen und Ergebnisse aus den Forschungsbereichen Entwurf und Implementierung von Programmiersprachen sowie Grundlagen und Methodik des Programmierens. Dieser Tagungsband enthält die wissenschaftlichen Beiträge,die bei dem 21. Kolloquium dieser Tagungsreihe präsentiert wurden, welches vom 27. bis 29. September 2021 in Kiel stattfand und von der Arbeitsgruppe Programmiersprachen und Übersetzerkonstruktion der Christian-Albrechts-Universität zu Kiel organisiert wurde
Pragmatics of Modular SOS
Modular SOS is a recently-developed variant of Plotkin's Structural Operational Semantics (SOS) framework. It has several pragmatic advantages over the original framework--the most significant being that rules specifying the semantics of individual language constructs can be given definitively, once and for all. Modular SOS is being used for teaching operational semantics at the undergraduate level. For this purpose, the meta-notation for modular SOS rules has been made more user-friendly, and derivation of computations according to the rules is simulated using Prolog. After giving an overview of the foundations of Modular SOS, this paper gives some illustrative examples of the use of the framework, and discusses various pragmatic aspects
SAGA: A project to automate the management of software production systems
The Software Automation, Generation and Administration (SAGA) project is investigating the design and construction of practical software engineering environments for developing and maintaining aerospace systems and applications software. The research includes the practical organization of the software lifecycle, configuration management, software requirements specifications, executable specifications, design methodologies, programming, verification, validation and testing, version control, maintenance, the reuse of software, software libraries, documentation, and automated management
- …