The Monadic Constraint Programming framework leverages
Haskell’s rich static type system and powerful abstraction mechanisms to
implement an embedded domain specific language (EDSL) for constraint
programming.
In this paper we show how the same constraint model expressed in the
EDSL can be processed in various modes by external constraint solvers.
We distinguish between on-line and off-line use of solvers. In off-line
mode, the model is not solved; instead it is compiled to lower-level code
that will search for solutions when compiled and run. For on-line use, the
search can be handled by either the framework or in the external solver.
Off-line mode requires recompilation after each change to the model. To
avoid repeated recompilation, we separate model from data by means of
parameters that need not be known at compile time. Parametrization
poses several challenges, which we resolve by embedding the EDSL more
deeply.status: publishe