Hi Martin.
Here is how I use MiniZinc with the PicatSAT solver at
https://github.com/nfzhou/fzn_picat . It's a little messy but I think it's worth it. After you've done these steps you will be able to run MiniZinc as:
$ minizinc quasiGroup3NonIdempotent.mzn --solver picat_sat
or in general
$ minizinc model.mzn data.dzn -a -s --solver picat_sat
Using this, the minizinc program automatically translates the MiniZinc model to FlatZinc using the global constraints dedicated to PicatSAT.
You have already done some of the steps already but I want to describe the steps in full.
Here's the step:
2) Create a .msc definition file for PicatSAT
Here is my own picat_sat.msc
"""
{
"id": "picat_sat",
"name": "picat_sat",
"description": "Picat FlatZinc solver command line",
"version": "3.3#3",
"mznlib": "-Gpicat_sat",
"executable": "/home/hakank/g12/picat/run_picat_sat.sh",
"tags": ["cp","int"],
"stdFlags": ["-a","-n","-p","-r"],
"supportsMzn": false,
"supportsFzn": true,
"needsSolns2Out": true,
"needsMznExecutable": false,
"needsStdlibDir": false,
"isGUIApplication": false
}
"""
This file should be placed together with the other .msc files (gecode.msc, chuffed.msc etc), i.e. in the directory
<minizinc_installation>/share/minizinc/solvers/
See below for comments on "mznlib" and "executable".
This library contains PicatSAT's definitions of the global constraints (all_different etc). Without it the default MiniZinc definitions are used which tends to be slower than the dedicated PicatSAT definitions.
I place this directory in the same directory that contains the directory ./gecode, ./chuffed in the MiniZinc installation. This should be the directory <minizinc_installation>/share/minizinc/
The line
"mznlib": "-Gpicat_sat",
means that MiniZinc will check for the PicatSAT's definitions of the supported global constraints in the directory <minizinc_installation>/share/minizinc/picat_sat (it also checks some other directories but let's keep it simple).
* Create a program/script that calls Picat and the fzn solver program
The reason for having a separate program for calling the Picat program fzn_picat_sat.pi is that
MiniZinc tends to give strange error messages if the "executable" entry
is defined like this:
"executable": "picat /home/hakank/picat/git/nfz/fzn_picat/fzn_picat_sat.pi",
(replace the path to fzn_picat_sat.pi ).
At my Linux computer(s) I have the program /home/hakank/g12/picat/run_picat_sat.sh which simply includes this line
picat /home/hakank/picat/git/nfz/fzn_picat/fzn_picat_sat.pi $*
The program/script should be executable and the path stated the "executable" flag in the .mcs file, e.g.
"executable": "/home/hakank/g12/picat/run_picat_sat.sh",
Hopefully this is enough to use PicatSAT as a FlatZinc solver:
$ minizinc model.mzn --solver picat_sat
Hope this helps,
Hakan