The Use of Mercury for the Implementation of a Finite Domain Solver


Author(s)
H. Vandecasteele
B. Demoen
J. Van Der Auwera

Department of Computer Science
Celestijnenlaan 200A
B-3001 Heverlee
Belgium
{enk.vandecasteele, bart.demoen}@cs.kuleuven.ac.be

Abstract
Mercury is a recent phenomenon in the field of logic programming: it is faster than other logic language implementations (e.g. Prolog) and better suited for the development of large applications because of its compile-time error-detection capabilities. The concepts and technology used in the implementation of Mercury are rather new and not yet evaluated thoroughly outside its implementors group. This paper reports on an evaluation of Mercury, by describing the porting from the medium-sized constraint solving tool ROPE written originally in Prolog, to Mercury. At first our aim and hope, was only to arrive at a faster implementation of the constraint solving tool, but in the course of the porting, it became clear that the main feature necessary for efficiency and missing from the current implementation of Mercury, is efficient backtrackable destructive assignment, at least for our application. We report on a naive port of the Prolog implementation of ROPE in Mercury, a redesigned version using more efficient data-structures and finally a version which uses our own hacked together implementation of backtrackable destructive assignment: a future version of Mercury will hopefully support this functionality through user-declarations or analysis.