@INPROCEEDINGS{HanusPeemoellerTikovsky14ATPS, author = {Hanus, M. and Peem{\"o}ller, B. and Tikovsky, J.R.}, title = {Integration of Finite Domain Constraints in KiCS2}, year = {2014}, booktitle = {Proc. of the 7th Working Conference on Programming Languages (ATPS'14)}, pages = {151-170}, publisher = {CEUR Workshop Proceedings 1129}, abstract = { A constraint programming system usually consists of two main components: a modelling language used to describe a constraint satisfaction problem and a constraint solver searching for solutions to the given problem by applying specific algorithms. As constraint programming and functional logic languages share some common features, like computing with logic variables or the use of backtracking for non-deterministic search, it is reasonable to embed a modelling language for finite domain constraints in a functional logic language like Curry. Due to the absence of side effects or global state over non-deterministic computations in Curry, the implementation of a stateful constraint solver is rather difficult. In this paper we consider KiCS2, a Curry compiler translating Curry programs into Haskell programs. In order to embed finite domain constraints in KiCS2, we propose a new implementation technique compatible with the purely functional nature of its back end. Our implementation collects finite domain constraints occurring during a program run and passes them to a constraint solver available in Haskell whenever solutions are requested. } }