Skip to main content

Heuristics entwined with handlers combined

Tom Schrijvers‚ Nicolas Wu‚ Benoit Desouter and Bart Demoen

Abstract

A long-standing problem in logic programming is how to cleanly separate logic and control. While solutions exist, they fall short in one of two ways: some are too intrusive, because they require significant changes to Prolog\textquoterights underlying implementation; others are lacking a clean semantic grounding. We resolve both of these issues in this paper. We derive a solution that is both lightweight and principled. We do so by starting from a functional specification of Prolog based on monads, and extend this with the effect handlers approach to capture the dynamic search tree as syntax. Effect handlers then express heuristics in terms of tree transformations. Moreover, we can declaratively express many heuristics as trees themselves that are combined with search problems using a generic entwining handler. Our solution is not restricted to a functional model: we show how to implement this technique as a library in Prolog by means of delimited continuations.

Book Title
PPDP 2014 : proceedings of the 16th international symposium on principles and practice of declarative programming
ISBN
9781450329477
Language
eng
Location
Canterbury‚ UK
Pages
12
Publisher
Association for Computing Machinery (ACM)
Year
2014