Download PDF

International Symposium on Principles and Practice of Declarative Programming, Date: 2014/09/08 - 2014/09/10, Location: Canterbury, UK

Publication date: 2014-01-01
Pages: 259 - 270
ISBN: 9781450329477
Publisher: ASSOC COMPUTING MACHINERY

PPDP'14: PROCEEDINGS OF THE 16TH INTERNATIONAL SYMPOSIUM ON PRINCIPLES AND PRACTICE OF DECLARATIVE PROGRAMMING

Author:

Schrijvers, Tom
Wu, Nicolas ; Desouter, Benoit ; Demoen, Bart ; Chitil, Olaf ; King, Andy ; Danvy, Olivier

Keywords:

Haskell, Prolog, monads, algebraic effect handlers, nondeterminism, search heuristics, delimited control, Science & Technology, Technology, Computer Science, Software Engineering, Computer Science, Theory & Methods, Computer Science, effect handlers, free monad transformer, delimited continuations, logic programming, heuristic tree search, SEARCH

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’s 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.