question

Gustavo Pabon gpabon at atlas.puj.edu.co
Fri Jan 7 21:13:29 CET 2005


Hello moz mozart,

I agree with Mr. Collet. A review of logic programming and constraint
programming in Mozart could clarify how search is done.

the papers that Mr. Collect suggest are the suitable literature but you can
check the following tutorials out too:

http://www.mozart-oz.org/documentation/tutorial/node12.html#chapter.lp
http://www.mozart-oz.org/documentation/fdt/node2.html#chapter.constraints

Nevertheless, I think you can achieve what you want by the follow code:


thread cond Z=v then {TellC_v} end end   
% This line must be inside your Script. 


Where TellC_v is a procedure that "tells" all the constraints of the C_v family.

It is that easy to do in Mozart.

Cheers,

Gustavo P.


On Fri, 07 Jan 2005 09:30:06 +0100, Raphael Collet wrote
> 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
>
_________________________________________________________________________________
> mozart-users mailing list                               mozart-
> users at ps.uni-sb.de http://www.mozart-oz.org/mailman/listinfo/mozart-users


--
Open WebMail Project (http://openwebmail.org)
Debian Project (http://www.debian.org)




More information about the mozart-users mailing list