This directory contains the G12 MiniZinc distribution version rotd-2009-10-14.
It is Copyright (C) 2005-2009
The University of Melbourne and NICTA, except where otherwise noted.
See the file COPYING for the license terms.
The directory src/xml2fzn contains a modified copy of the source of the
XML parser from the Mercury extras distribution. This source code
is Copyright (C) 2000, 2001 The University of Melbourne. It is distributed
under the GNU LGPL version 2.0. The Mercury extras distribution is
available from . (A copy of
this license is included in src/xml2fzn/XML.LICENSE.)
The files in the directories `src/fzn-parser', `benchmarks', `examples',
`tests', `fcts', and `lib' are in the public domain.
CONTENTS
benchmarks A suite of MiniZinc models used for benchmarking
MiniZinc and FlatZinc implementations.
bin Executables: mzn2fzn is a the G12 MiniZinc-to-FlatZinc
converter; flatzinc is the G12 FlatZinc interpreter;
minizinc is the G12 MiniZinc interpreter; fzn2xml is
the G12 MiniZinc-to-XML converter; solns2dzn is a
FlatZinc output processing tool.
doc Documentation: specifications for the Zinc, MiniZinc
and FlatZinc languages, a description of the MiniZinc-
to-FlatZinc transformation implemented by the mzn2fzn
tool, and tutorials.
fcts A conformance test suite for FlatZinc implementations.
examples Sample MiniZinc models.
lib The MiniZinc standard library.
src A parser for FlatZinc using lex and yacc; Mercury
source code for mzn2fzn, fzn2xml, and xml2fzn.
tests A regression test suite for mzn2fzn, minizinc and flatzinc.
(See the section TESTING below for further details.)
tools Miscellaneous tools related to MiniZinc, e.g.
syntax highlighting files for text editors, etc.
INSTALLATION
Step 1. Download and unzip the MiniZinc package.
Packages for various platforms are available from the G12 MiniZinc website
at .
The packages have the form minizinc-rotd-2009-10-14-.tar.gz where
specifies the architecture for which the package was built,
e.g. Linux/x86.
To unpack the distribution, use:
$ tar zxf minizinc-rotd-2009-10-14-.tar.gz
if your version of tar supports that. Otherwise, use:
$ gunzip -c minizinc-rotd-2009-10-14-.tar.gz | tar xf -
`$' is used here to denote the command prompt.
Step 2. Configure the distribution
Change into the directory minizinc-rotd-2009-10-14 and run the SETUP script
to configure the distribution.
$ sh SETUP
Step 3. Try it out!
The MiniZinc-to-FlatZinc converter and a FlatZinc interpreter are installed
in the bin directory. They are named mzn2fzn and flatzinc respectively.
A variety of sample MiniZinc models is available in the examples directory.
If the bin directory is in your PATH, the models can be run, by first
converting them into FlatZinc,
$ mzn2fzn zebra.mzn
and then evaluated using
$ flatzinc zebra.fzn
The MiniZinc interpreter avoids the need to first convert models into
FlatZinc. It maybe invoked as follows:
$ minizinc zebra.mzn
The above invocations of mzn2fzn and minizinc will use the default
global constraint definitions. You may get better performance by
using the global constraint definitions that are specific to G12's
finite-domain solver. This can be done using the -G option to
mzn2fzn or minizinc:
$ mzn2fzn -G g12_fd zebra.mzn
or
$ minizinc -G g12_fd zebra.mzn
Other FlatZinc implementations may provide alternative solver-specific
global constraint definitions. (See GLOBAL CONSTRAINTS and RELATED below.)
Further documentation for MiniZinc and FlatZinc can be found in the
doc directory.
SOURCE CODE
The G12 MiniZinc distribution includes the Mercury source code for
the MiniZinc-to-FlatZinc converter, FlatZinc-to-XML converter, and
XML-to-FlatZinc converter. This source code is in the directories
src/mzn2fzn, src/fzn2xml and src/xml2fzn respectively.
Consult the README files in those directories for further details.
GLOBAL CONSTRAINTS
The MiniZinc library contains standard definitions for many global
constraints. Solver-specific versions of some globals are also
provided for use with the G12/FD solver.
Where possible, names for global constraints are taken from the Global
Constraint Catalog, .
The following table lists name differences between the MiniZinc library
and the catalog:
MiniZinc GCC
-------- ---
at_least atleast
at_most atmost
at_most1 atmost1
sum_pred sum
TESTING
Developers who modify the MiniZinc-to-FlatZinc converter or who
implement their own FlatZinc interpreters may wish to run their changes
against the regression and conformance test suites. The former are
in the directory `tests', while the latter are in `fcts'.
The directory scripts contains the shell scripts used by the G12 team
to run the test suites. For example,
$ run-tests mer_mzn .mzn tests
will run the regression tests for minizinc.
The comments at the head of the various scripts provide further details
of their use. (The scripts run-test and run-tests are a good starting
place.)
MINIZINC WIKI
The MiniZinc Wiki at contains
tutorials, documentation and MiniZinc models.
OTHER FLATZINC IMPLEMENTATIONS
A FlatZinc interface to the Gecode generic constraint development
environment, FlatZinc for Gecode, is available.
See the Gecode/FlatZinc WWW page at .
The ECLiPSe Constraint Programming System provides support for evaluating
FlatZinc using ECLiPSe's constraint solvers. MiniZinc models can be embedded
into ECLiPSe code in order to add user-defined search and I/O facilities to
the models.
See the ECLiPSe WWW page at .
SICStus Prolog (from version 4.0.5) includes a library for interpreting
FlatZinc.
See the SICStus WWW page at
.
The JaCoP constraint solver (from version 2.4) has an interface to
FlatZinc.
See the JaCoP WWW page at
FURTHER INFORMATION
The MiniZinc developers can be contacted at minizinc@csse.unimelb.edu.au.
For more information about the G12 project, see the G12 WWW page at
.
There is a G12 users mailing list which is intended for general discussion.
If you would like to join, then send a mail with "subscribe" in the body
to g12-users-request@csse.unimelb.edu.au.
Please submit bug reports via our