Adding Search to a Declarative Modelling Language Reza Rafeh 1 , Kim Marriott 1 , Maria Garcia de la Banda 1 , Nicholas Nethercote 2 , and Mark Wallace 1 1 Clayton School of IT, Monash University, Australia {reza.rafeh,kim.marriott,Maria.GarciadelaBanda,mark.wallace}@infotech.monash.edu.au 2 NICTA Victoria Research Laboratory, University of Melbourne, Australia njn@csse.unimelb.edu.au Abstract. Modellers would like to automatically translate a declara- tive conceptual model of a constrained combinatorial problem into an efficient design model. However, for efficiency, most solving techniques require a model-specific search strategy, which is inherently procedural and, thus, difficult to integrate with the declarative conceptual model. This paper describes a small, non-intrusive extension to the declarative modelling language Zinc that achieves such an integration by providing a number of generic search patterns that take Zinc user-defined functions as parameters. We show the generality of the approach by using it to im- plement three very different kinds of search: backtracking search, branch- and-bound search, and local search. In each case, the work done by the modeller is small, while the performance is competitive with hand-coded search strategies. This demonstrates that search can be implemented in a manner that maintains the benefits of declarative modelling languages, while still being reasonably efficient. 1 Introduction Recent approaches to solving combinatorial problems divide the task into two steps: developing the conceptual model of the problem which gives a declarative specification without consideration as to how to actually solve it, and solving the problem by mapping the conceptual model into an executable program called the design model. Automatically mapping the same conceptual model to differ- ent design models, each based on a particular solving technique, would allow modellers to easily “plug and play” with different techniques [7, 6, 12]. At present, however, fully automatic generation of the design models is im- practical for most solving techniques. This is because, currently, their efficiency strongly depends on the modeller providing an effective, model-specific search strategy. This requires the integration of a conceptual model and a search strat- egy, something that is difficult to achieve cleanly since, while the former is best expressed declaratively, the latter is inherently procedural. Here we describe how we have integrated model-specific search with the declarative modelling language Zinc, a first-order functional language designed