May 26, 2015
Joaquín Arias
Logic programming systems featuring Constraint Logic Programming and tabled execution have been shown to increase the declarativeness and efficiency of Prolog, while at the same time making it possible to write very expressive programs.
Previous implementations fully integrating both capabilities (i.e., forcing suspension, answer subsumption, etc. in all the places where it is necessary in order to avoid recomputation and terminate whenever possible) did not feature a simple, well-documented, easy-to-understand interface which made it possible to integrate arbitrary CLP solvers into existing tabling systems. This clearly hinders a more widespread usage of the combination of both facilities.
We examine the requirements that a constraint solver must fulfill in order to be interfaced with a tabling system. We propose a minimal set of operations (e.g., entailment checking and projection) which the constraint solver has to provide to the tabling engine.
We validate and evaluate the performance of our design by a series of use cases and benchmarks: we re-engineer a previously existing tabled constrain domain (difference constraints) in Ciao Prolog, we integrate Holzbauer’s CLP(Q) implementation with Ciao Prolog’s tabling engine, and we implement a simple abstract analyzer whose fixpoint is reached by means of tabled execution and whose domain operations are implemented as a constraint solver, which therefore avoids recomputation of subsumed abstractions.