Constraint Implementation ------------------------- You can find the files you need in /usr/local/eclipse/Tutorial/Exercises/2002 You need to use ECLiPSe 5.5 for these exercises: /usr/local/eclipse/prerelease/bin/$ECLIPSEARCH/tkeclipse 1. Implement a constraint atmost/3 atmost(+N, +List, +V) which takes an integer N, an integer V and a list List containing integers or integer domain variables. Meaning: at most N elements of List have value V. Behaviour: Fail as soon as too many list elements are instantiated to value V. This requires only basic suspension facilities, no domain information needs to be taken into account. Improvement: Fail as soon as not enough variables with V in their domain are left over. Do not use the ic_global library... Tests are provided in the file atmost.tst You can test your constraint by loading the library lib(test_util). and then calling test(atmost). 2. Implement a constraint offset/3 offset(?X,+Const,?Y) which is declaratively like offset(X,Const,Y) :- Y #= X+Const. but maintains domain-arc-consistency (i.e. propagates "holes", while the above definition only maintains bounds-consistency). Use suspension built-ins and domain-access primitives from the ic_kernel module. Use not_unify/2 to test whether a value is outside a variable's domain. Tests are provided in the file offset.tst You can test your constraint by loading the library lib(test_util). and then calling test(offset).