next up previous index
Next: Starting with Grace Up: Grace 1.0 User Previous: What Grace offers

Constraint Programs

Constraint programs over finite domains have usually a very simple and regular structure:

  1. Definition of problem variables and their domains. They are usually grouped into lists or matrices of variables with similar purpose.

  2. Constraints over these variables are stated.

  3. All variables or only the selected ones are labelled, which most often means that they are instantiated one by one and in this way the program explores the search space and searches for a solution that satisfies all the constraints. Often this step also includes optimisation, e.g. minimisation of a given expression.

The usage of Grace reflects this program structure. At the beginning of each program section a call to an appropriate Grace predicate is inserted into the program source, so that Grace is notified about the program data and execution. For the labelling phase Grace offers even more: instead of just monitoring the labelling process, it is possible to control the whole labelling process through Grace , making use both of its predefined strategies and manual control.

Grace predicates can remain in the program source even if Grace is not used -- the predicates grace/0   and nograce/0   switch the 'gracing' mode on and off. The overhead of executing Grace predicates in the off mode is minimal.



next up previous index
Next: Starting with Grace Up: Grace 1.0 User Previous: What Grace offers



Micha Meier
Tue Jul 2 10:07:34 MET DST 1996