[Newbye] How to run a script?

Raphael Collet raph at info.ucl.ac.be
Thu Dec 23 14:35:44 CET 2004


"romiem at libero.it" wrote:
> 
> I've just installed Mozart because I'm interested to the topic of constraint
> programming, but I'm already blocked by a really basic problem: how to run the
> scripts?

You should give the script to a search engine.  The search engine will
run the script and find solutions.  The purpose of the script is to
state the constraints of the problem, together with a heuristics (via a
distributor).

> For example, I wuold run the script SEND MORE MONEY found on section 3.2 of the
> document about the "Finite domain constraint programming in Oz. A tutorial".

First declare the script itself.  Type the following statement in an "Oz
buffer" of emacs, and run it:

    declare
    proc {Money Root}
       ...
    end

Then you call a search engine to solve it.  In the documentation, you
can read: The statement

    {Browse {SearchAll Money}}

will compute and display the list of all solutions of the Send More
Money Puzzle:

    [sol(d:7 e:5 m:1 n:6 o:0 r:8 s:9 y:2)]

You can also use the Explorer, which is a search engine that displays a
search tree that is built from the script...  Keep reading the
documentation, all this is explained.


I recommend you to read the "Oz tutorial" before digging the constraint
tutorial.  The programming environment is explained there.


Cheers,

raph



More information about the mozart-users mailing list