Abstract
AbstractDelimited 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, …
Publisher
Cambridge University Press (CUP)
Subject
Artificial Intelligence,Computational Theory and Mathematics,Hardware and Architecture,Theoretical Computer Science,Software
Reference34 articles.
1. Schimpf, J. Logical loops 2002, volume 2401 of LNCS, pp. 224–238.
2. Hinze, R. Kan extensions for program optimisation or: Art and Dan explain an old trick. In Gibbons, J. and Nogueira, P., editors, Mathematics of Program Construction - 11th International Conference, MPC 2012, volume 7342 of LNCS, pp. 324–362. Springer.
3. The theory and practice of first-class prompts
4. Abdallah, S. 2017. More declarative tabling in Prolog using multi-prompt delimited control. CoRR, abs/1708.07081.
5. A useful extension to Prolog’s definite clause grammar notation;Van Roy;ACM SIGPLAN Notices,1989