question

Raphael Collet raph at info.ucl.ac.be
Fri Jan 7 09:30:06 CET 2005


moz mozar wrote:
> 
> We have a question about "triggered" constraints.
> Let us assume we have a constraint program involving variable
> Z among others, and we have a family of constraints C_v, each one
> must be activated when the variable Z is assigned the value v.
> 
> So we want that during the search tree, as soon as Z is assigned
> the value v (either because of the distribution we have a branch on the
> search tree labeled with Z=v, or either because of the propagation of
> constraints during the propagation Z is assigned v) the constraint
> C_v is activated, but we want that when backtracking occurs and Z
> becomes free, none of the constraints C_v is active.

I think you misunderstand how search is done in Mozart.  There is no
"backtracking" in the sense of Prolog.

Here is the idea.  Suppose you are on a node S of the search tree.  When
you develop the first branch of S (labelled with Z=v), you actually make
a copy of S before adding Z=v into S.  Call that copy C.  C contains a
copy of the variables, basic constraints, and propagators of S!  So the
effect of backtracking is simply to forget about the first branch, and
develop the second branch by adding Z\=v into C.  So Z does not "become"
free in C before branching.  It was free already.

If you want a better and more detailed description of search in Mozart,
go into Mozart "publication" page (http://www.mozart-oz.org/papers/). 
Suggested readings: "Programming Constraint Services", "Programming
Constraint Inference Engines" by Christian Schulte, "Problem Solving
with Constraints and Programming" by Gert Smolka.


Cheers,

Raphael



More information about the mozart-users mailing list