[Oz] Multiple evaluation question

Kent Hoxsey khoxsey at ix.netcom.com
Wed Feb 10 18:49:33 CET 1999


Thanks to all who responded.

Denys Duchier wrote:
> > What I would like to do is to apply a procedure to item A, save the
> > value of R, and then apply the procedure to item B and again save the
> > value of R.
> 
> This is what abstractions are for:
> 
>         declare Rs = {Map [A B] fun {$ I} I.attr1\=:I.attr2 end}
> 
> Now Rs contains a list of boolean variables resulting from evaluating
> the reified constraint for each item.

Ah. I'm having paradigm problems. I still need to wrap my head around
the Oz idiom. I'm starting to wonder if my entire solution can be
expressed in three short lines of code.

> However I wonder why you are using a reified constraint...
> Am I misunderstanding your problem? Also, your example above has items
> with determined attributes; in that case, of course, constraints are
> pointless since there is nothing to be constrained.

The point of the model is to set up the rules governing a valid
configuration, and check each of a large number of items in a database
to see whether they comply with those rules. It's a little different
than search for a solution to a problem. I already know the
configuration for an item, and am interested in whether it complies with
all of the rules, and which rules it violates, if any.

I am using reified constraints because the output of my program is the
list of violated constraints for each item. My thinking was to assign
the success or failure of a constraint to a variable, and thus be able
to produce that value as output. If there's a better way, I'm all ears.

> I hope this helped.  The "Finite Domain Constraint Programming
> Tutorial" is also well worth reading; it has loads of examples that
> may help clarify things a bit.

Thank you very much. I have a large pile of Oz documentation next to my
chair that I read and re-read constantly, including the FD Constraint
Programming tutorial. Unfortunately, I can only absorb it so quickly...

Kent
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list