English

Disjunctive Delimited Control

Programming Languages 2021-08-21 v1 Logic in Computer Science

Abstract

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

Keywords

Cite

@article{arxiv.2108.02972,
  title  = {Disjunctive Delimited Control},
  author = {Alexander Vandenbroucke and Tom Schrijvers},
  journal= {arXiv preprint arXiv:2108.02972},
  year   = {2021}
}

Comments

Pre-proceedings paper presented at the 31st International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR 2021), Tallinn, Estonia, and Virtual, September 7-8, 2021 (arXiv:2107.10160). arXiv admin note: substantial text overlap with arXiv:2009.04909

R2 v1 2026-06-24T04:53:00.190Z