Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Barnier, N.: Application de la programmation par contraintes à des problèmes de gestion du trafic aérien. PhD thesis, Institut National Polytechnique de Toulouse (December 2002), http://www.recherche.enac.fr/opti/papers/thesis/
Cipriano, R., Dovier, A., Mauro, J.: Compiling and executing declarative modeling languages to gecode. In: de la Banda, M.G., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 744–748. Springer, Heidelberg (2008)
Duck, G.J., Stuckey, P.J., Brand, S.: ACD term rewriting. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 117–131. Springer, Heidelberg (2006)
Fages, F., Martin, J.: From Rules to Constraint Programs with the Rules2CP Modelling Language. In: Federrath, H. (ed.) Designing Privacy Enhancing Technologies. LNCS, vol. 2009, Springer, Heidelberg (2001)
Fernandez, A.J., Hortala-Gonzalez, T., Saenz-Perez, F., Del Vado-Virseda, R.: Constraint functional logic programming over finite domains. Theory Pract. Log. Program. 7(5), 537–582 (2007)
Gecode Team: Gecode: Generic constraint development environment (2006), http://www.gecode.org
Hanus, M. (ed.): Curry: An integrated functional logic language, vers. 0.8.2 (2006), http://www.curry-language.org
Marriott, K., et al.: The design of the Zinc modelling language. Constraints 13(3), 229–267 (2008)
Peyton Jones, S., et al.: The Haskell 1998 language and libraries: The revised report. Journal of Functional Programming 13(1), 255 (2003)
Schrijvers, T., Stuckey, P., Wadler, P.: Monadic Constraint Programming. J. Func. Prog. 19(6), 663–697 (2009)
Wadler, P.: Monads for functional programming. In: Advanced Functional Programming, London, UK, pp. 24–52 (1995)
Wuille, P., Schrijvers, T.: Monadic Constraint Programming with Gecode. In: Proceedings of the 8th International Workshop on Constraint Modelling and Reformulation, pp. 171–185 (2009)
Wuille, P., Schrijvers, T.: Expressive Models for Monadic Constraint Programming. In: Proceedings of the 9th International Workshop on Constraint Modelling and Reformulation (2010) (accepted)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Wuille, P., Schrijvers, T. (2011). Parameterized Models for On-Line and Off-Line Use. In: Mariño, J. (eds) Functional and Constraint Logic Programming. WFLP 2010. Lecture Notes in Computer Science, vol 6559. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-20775-4_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-20775-4_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-20774-7
Online ISBN: 978-3-642-20775-4
eBook Packages: Computer ScienceComputer Science (R0)