Disjunctive Delimited Control

09/10/2020
by   Alexander Vandenbroucke, et al.
0

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, . . .

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/27/2018

A Systematic Approach to Programming

We show how to systematically implement a mental representation of an al...
research
07/15/2021

An Optimised Flow for Futures: From Theory to Practice

A future is an entity representing the result of an ongoing computation....
research
04/06/2022

P4BID: Information Flow Control in P4

Modern programmable network switches can implement custom applications u...
research
04/01/2021

Retrofitting Effect Handlers onto OCaml

Effect handlers have been gathering momentum as a mechanism for modular ...
research
10/15/2021

GaussED: A Probabilistic Programming Language for Sequential Experimental Design

Sequential algorithms are popular for experimental design, enabling emul...
research
01/05/2021

Control-Data Separation and Logical Condition Propagation for Efficient Inference on Probabilistic Programs

We introduce a novel sampling algorithm for Bayesian inference on impera...
research
05/11/2023

Differentiable Programming: Efficient Smoothing of Control-Flow-Induced Discontinuities

We want to obtain derivatives in discontinuous program code, where defau...

Please sign up or login with your details

Forgot password? Click here to reset